How to Write Text Top to Bottom using Custom Code in SQL Server Reporting Services Reports
Microsoft SQL Server Reporting Services is a flexiable tool for SQL Server Report Developers.
MS SQLServer 2005 SSRS or SQLServer 2008 SSRS Business Intelligence Development Studio (BIDS) gives a handful tools and controls for report developers to build customized reports for their needs.
One of the major tools I apppretiate most is the ability to inject code in your reports.
This feature is known as Custom Code in Reporting Services. In the Report Properties dialog screen there exists a tab named Code where you can write custom code for that report.
Now using custom code, I will try to demonstrate how you can write a text or a string value from top to bottom with a sample Reporting Services report.
You now you can arrange the text format in MS SQL Server 2005, using writing mode in the Format tab of the textbox properties.
Or in Microsoft SQL Server 2008 you can alter the writing mode of the text by setting it to vertical.
Or you can use the custome code function SplitTextWithLineBreaks() that I had developed
Actually the idea is simple. Split the text into its characters by calling the method ToCharArray() and keep all in a Char() array.
Then build a new string by iterating all items in the Character array and adding line breaks using vbCrLf between each character in the string.
At last return the resultant text or string back to the caller of the function SplitTextWithLineBreaks()
And you can call this custom function by a sample expression like Code.SplitTextWithLineBreaks with the sample code shown below: