Click here to Skip to main content
15,917,321 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I've been using report viewer for some time. I am now trying to create a report with multiple tables (which i have done previously) but this time I need to only view the tables that have data in them.

I have multiple datasources, one for each table. If datasource count is 0 I would like the table not to be visible.

Does any one know how to do this please?

Thanks in advance
Posted

1 solution

What about Datasource's dataset row count? You can use this in expressions to supress visibility. Try!
 
Share this answer
 
Comments
milenalukic 27-Jul-10 10:49am    
That is what I tried first.

through C# I have tried o find an option e.g. reportviewer1.table1.visible but have not succeeded

through the report designer on table properties there is the visible option but when I tried the function I could not find how to set the visibility
e.g. iif(Count(Fieldname)=0,table1.visible=false,table1.visible=true)
Sandeep Mewara 27-Jul-10 11:04am    
Why are you trying reportviewer1.table... instead try through datasource/dataset
milenalukic 27-Jul-10 11:49am    
I think I did not explain properly what I am trying to do:

I have 1 report with multiple tables (6) each with its own dataset.

What I need to do is to hide a table if there is no data for that table leaving the others visible.
I am using LINQ for the data so hat will be in a List - If list.count=0 hide table
milenalukic 27-Jul-10 12:31pm    
I managed to do it through parameters.

Thanks for your time

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900