The Case For Renaming Controls In a Reporting Services Report

Since my Access days, I've believed in renaming important* controls in reports. Now that I use Reporting Services daily, this practice still holds: ambiguous names like "Textbox1" or "Textbox112" become "ReportName" or "FinalBalance", "table1" becomes "WidgetSalesTable", and "chart1" becomes "MonthlyTrendChart".

As well as better organising the report while in development and adding only a small amount of time to actually do, renaming controls is useful to me later when I'm maintaining a report as I can see which controls contain which data points.

There's one further advantage to renaming controls in a Reporting Services report: because reports are stored in XML format, I can extract the static contents of a control (as long as I know it's name) either from the RDL file or from the RDL file stored as XML in the Catalog table in the ReportServer database.

I recently needed this functionality as I wanted a list of reports with the contents of a textbox on each report body called "Purpose".

This was fairly straightforward to accomplish using the XML nodes() method, which is dependent on the control being sought (which is why there's no code for this blog post, sorry!)

* I don't usually rename controls that contain "meta" information, like column headers and blank cells.

Tags: ,

posted @ Tuesday, July 28, 2009 12:54 PM

Print

Comments on this entry:

# re: The Case For Renaming Controls In a Reporting Services Report

Left by Darren Gosbell at 7/29/2009 7:08 AM
Gravatar
It's also helpful for debugging. An error like "Invalid expression in SalesAmount" is much easier to deal with than "Invalid expression in TextBox63".

# re: The Case For Renaming Controls In a Reporting Services Report

Left by Thomas Williams at 7/29/2009 7:38 PM
Gravatar
Good point Darren!

# re: The Case For Renaming Controls In a Reporting Services Report

Left by Casey at 9/10/2009 3:01 PM
Gravatar
Hi there,

Apologies for the uninvited email, I saw your website and thought that you may want to know that the domain www.thomas-williams.com is currently up for auction via sedo.com. The .com top level domain is an “international” domain ending, and the hyphen between thomas and williams makes search engines treat the two words like they have a space between them, which is ideal for search engine optimization.

If you are interested in placing a bid, please visit the website at www.thomas-williams.com and click on the “The domain thomas-williams.com may be for sale by its owner!“. This will take you to http://www.sedo.com/search/details.php4?domain=thomas-williams.com&partnerid=14456&language=e&et_cid=25&et_lid=65 where you can place a bid via Sedo’s auction service.

There are 6 days left in the auction.

Cheers,
Casey Ellis
Comments have been closed on this topic.
«June»
SunMonTueWedThuFriSat
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567