views:

735

answers:

4

Hi guys

depending on information, my report RDLC on Visual Studio 2008 has some fields that are printed or not.

I would like to know how could I suppress only this section when there is no data to be printed.

I recall that crystal reports has something like that. But what about a RDLC file?

thank you

A: 

You could set an IIF statement on the Visibility property of the control you want to hide. =IFF(ROWCOUNT=0, FALSE, TRUE)

That way, the report will not render that control if there is no data. you can even take it a step further, and make another control appear when no data is present, to display a message ("There is no data")

Jon
Hi Jon, I have tried =IIf(1=1, False, True). I have tables and textboxes. I think the problem might be these textboxes? Perhaps there's no way to supress them? I'm going to put them within a panel and see what happens
Junior Mayhé
The property you are setting is HIDDEN... so if HIDDEN=FALSE, you will still see it. Your =IIf(1=1, False, True) would be equal to FALSE.
Jon
A: 

In my case there was a page footer. So the space between body and footer was giant.

I had to remove this page footer and its text field, move it to the header.

Later within the body, I manually inserted rows into a table so I could get rid of textfields' content and put their contents in the table.

I shall say, there's no magic way to suppress a report section, rectangle. And table doesn't completely collapse the empty space we wanted to.

If anyone knows about something please new let me know

thank you

Junior Mayhé
A: 

Still Problem not solve, empty space is still there. Anyone please help.

sahil kaundal
A: 

I have done one thing, that solve my problem, may be helpful for someone.

First of all i apply the above code:

You could set an IIF statement on the Visibility property of the control you want to hide. =IFF(ROWCOUNT=0, FALSE, TRUE)

then, i set this property for every column.

Now with the help of above code every column is suppress. but there is one thing that is not supress till and take space. that is our static headers. Now , the final step come, that is more interesting. Make height of all your static headers to 0 or minimum value.

and Enjoy...

From Sahil Kaundal Mohali Punjab.

sahil kaundal