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

how to create a dynamic column report using MSReport(rdlc). For instance I have a datatable with n columns. I need to give the column choosable option to the application user to make visible the column or to hide the column in runtime like how the gridview is working. Or can we send the boolean value to hide or visible the column created in rdlc with datasource.
Posted
Updated 12-Mar-12 1:56am
v2

hi Shiva,
You can achieve this easily by passing parameters to your report.
for example I have a column named Country code
I will pass parameter to report let say CountryVisible
in that parameter I will pass true or false

Well all this is a part of code you will be writing for your report

At report end you select a column of you table and right click on it and select visibility.
Then go to expression and type
=iif(Parameters!CountryVisible.Value="True",true,false)
 
Share this answer
 
v2
Comments
Shivapragasam 14-Mar-12 2:18am    
what is true, false in the expression

=iif(Parameters!CountryVisible.Value="True",true,false)
Finally i found it. i just send a Boolean parameter (isVisible) to the report. I used the following expression in column visibility "Hidden" property expression

=Parameters!isVisible.Value
 
Share this answer
 
that what i said to you ..
true and false were the bool type values
 
Share this answer
 
Comments
Shivapragasam 14-Mar-12 4:38am    
i know we are at the same page. also i know those two are boolean type values. Can you please explain that expression. i cant understand how its working. i think if the value of 'CountryVisible.Value="True"' means true else means false am i correct.

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