Click here to Skip to main content
15,890,336 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
I have been trying to add some custom code to my data report (.rdlc)
But I really donot know where to write the code. In vb6, I could do it behind the report, in code area but I donot know where is the code area in vb.net.

I want to:
1) I have added a text box to header of the report, I want to assign some value to it from my variable.

2)I want to make this control visible and invisible depending on user's choice.

4)In page footer, I want to display page nos.

Thanks a lot.
Furqan
Posted

1 solution

This article of mine would help you in understanding and learning on how to use Custom code: Localization of SSRS Reports[^]

Now, pointwise:
1) I have added a text box to header of the report, I want to assign some value to it from my variable.
You can do it via custom code or using a hidden textbox in report body and referring that as a reportitem object in your header.

2)I want to make this control visible and invisible depending on user's choice.
In Visible property of control, you can set an expression. Use it and put whatever condition you like to.

4)In page footer, I want to display page nos.
It's an inbuilt feature. Just use the Report Pages. Place a textbox and check the option when you select expressions. You can find the pagination option in it.

Try!
 
Share this answer
 
Comments
Espen Harlinn 6-Feb-11 10:51am    
Excellent answer, nice tutorial too :)
Sandeep Mewara 6-Feb-11 10:58am    
Thanks. :)
Furqan Sehgal 6-Feb-11 11:11am    
Thanks a lot for your help.
Could you kindly elaborate the point2 a bit more?
Sandeep Mewara 6-Feb-11 11:15am    
Just chect the Proprty grid of the control selected.
You will find a 'Visible' property in it. When you check the dropdown you can see, 'true','false','Expression'....
Select the third one and then based on any value you can set the visibility something like:
=iif(Fields!MyField.Value >12,true,false)
Furqan Sehgal 6-Feb-11 11:12am    
Kindly give me code snippet for point 1
Thanks
Furqan

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