<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>SSRS</title>
        <link>http://geekswithblogs.net/microsoftian/category/9631.aspx</link>
        <description>SSRS</description>
        <language>en-US</language>
        <copyright>microsoftian</copyright>
        <managingEditor>veeragoni@gmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>SSRS 2008 - Excel Export Date Format and some other formatting tips</title>
            <link>http://geekswithblogs.net/microsoftian/archive/2009/06/12/ssrs-2008---excel-export-date-format-and-some-other.aspx</link>
            <description>&lt;p&gt;&lt;font size="2"&gt;Recently I am working little bit more on SSRS.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;Last week, we migrated from SSRS 2005 to SSRS 2008. The migration was smooth except few gotchas in Line charts.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;The way we handle empty points (null values) is improved. for more information, look at: &lt;/font&gt;&lt;a title="http://msdn.microsoft.com/en-us/library/cc281301.aspx" href="http://msdn.microsoft.com/en-us/library/cc281301.aspx"&gt;&lt;font size="2"&gt;http://msdn.microsoft.com/en-us/library/cc281301.aspx&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a title="http://msdn.microsoft.com/en-us/library/bb934424.aspx" href="http://msdn.microsoft.com/en-us/library/bb934424.aspx"&gt;&lt;font size="2"&gt;http://msdn.microsoft.com/en-us/library/bb934424.aspx&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;-------&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;Coming to some tips regarding formatting date time, text etc.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;1) How do you persist the date format when you export the report to Excel?&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;In earlier version of SSRS, when we need DateTime format to be international standard dd-MMM-yy, we used convert the datetime to varchar in the query. convert(varchar,mydate,106) which gives dd MMM yy. But when you export the generated report to excel, you can’t play with sorting of that particular date column, as it exports as a string!&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;SSRS 2008, provides you the flexibility of identifying the type within the report and when you export it will persist the format.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;Here is the screenshot where you mention the format, without converting anything the queries…&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/microsoftian/WindowsLiveWriter/SSRS2008ExcelExportDateFormatandsomeothe_A80F/image_2.png"&gt;&lt;font size="2"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/microsoftian/WindowsLiveWriter/SSRS2008ExcelExportDateFormatandsomeothe_A80F/image_thumb.png" width="498" height="484" /&gt;&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;If you do like that, when you export the report to Excel, it will retain the date format and Excel treats it as a date. If you do string operations in Report, when you export to Excel, it doesn’t treat as a date.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;2) How do we custom format text in SSRS reports?&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;Well, SSRS uses VB syntax to format anything inside the expressions. So, we have to use VB functions to format text.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;One good function available in SSRS is Replace(). you can find a character and replace it with what you want.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;for example, if you want to replace space with - (hyphen) , how do you do that in SSRS?&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;Replace(Fields.myValue, Chr(32),Chr(45))&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;Here is the wiki of list of VB characters:&lt;/font&gt;&lt;a title="http://www.gtwiki.org/mwiki/index.php?title=VB_Chr_Values" href="http://www.gtwiki.org/mwiki/index.php?title=VB_Chr_Values"&gt;&lt;font size="2"&gt;http://www.gtwiki.org/mwiki/index.php?title=VB_Chr_Values&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:3d72b584-1309-4682-af58-7d6491c66f80" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/SSRS" rel="tag"&gt;SSRS&lt;/a&gt;&lt;/div&gt;  &lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=132775"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=132775" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/microsoftian/aggbug/132775.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>microsoftian</dc:creator>
            <guid>http://geekswithblogs.net/microsoftian/archive/2009/06/12/ssrs-2008---excel-export-date-format-and-some-other.aspx</guid>
            <pubDate>Sat, 13 Jun 2009 04:56:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/microsoftian/comments/132775.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/microsoftian/archive/2009/06/12/ssrs-2008---excel-export-date-format-and-some-other.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/microsoftian/comments/commentRss/132775.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/microsoftian/services/trackbacks/132775.aspx</trackback:ping>
        </item>
        <item>
            <title>Adding Carriage Return functionality to Textbox in SSRS 2005</title>
            <link>http://geekswithblogs.net/microsoftian/archive/2009/04/15/adding-carriage-return-functionality-to-textbox-in-ssrs-2005.aspx</link>
            <description>&lt;h1&gt;&lt;/h1&gt;  &lt;h2&gt;&lt;/h2&gt;  &lt;p&gt;&lt;font size="2"&gt;Consider you have a SQL Server Table with some multiline text data. And that data contains carriage return in it.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;Now, if you want to display that data with carriage return in SSRS 2005 textbox, there is no direct way to display it.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;Because SSRS 2005 uses VB engine to render the data, where it doesn’t understand line feed--&amp;gt;CHR(10) or Carriage Return --&amp;gt;CHR(13) characters.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;So, what is the alternative?&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;Well, simple we need to use the Replace() function available and replace the specific characters with &lt;strong&gt;VbCrLf&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt; &lt;font size="2"&gt; &lt;/font&gt;  &lt;p&gt;&lt;font size="2"&gt;ex:&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;=&lt;strong&gt;Replace&lt;/strong&gt;(First(Fields!YourField.Value, "DataSource"),CHR(10),VbCrLf) –&amp;gt;This worked for me.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;or &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;=Replace(First(Fields!YourField.Value, "DataSource"),CHR(13),VbCrLf)&lt;/font&gt;&lt;/p&gt; &lt;font size="2"&gt; &lt;/font&gt;  &lt;p&gt;&lt;font size="2"&gt;In my case, The user was entering the data into SQL Server Database from an InfoPath form and wanted the carriage return to be persisted in the report. And in this case, CHR(10) worked instead of CHR(13).&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;Good to see SSRS 2008 added lot of rich text functionality, where you don't have to deal with these kind of silly things..,&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;Happy Reporting!&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=130972"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=130972" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/microsoftian/aggbug/130972.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>microsoftian</dc:creator>
            <guid>http://geekswithblogs.net/microsoftian/archive/2009/04/15/adding-carriage-return-functionality-to-textbox-in-ssrs-2005.aspx</guid>
            <pubDate>Wed, 15 Apr 2009 14:40:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/microsoftian/comments/130972.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/microsoftian/archive/2009/04/15/adding-carriage-return-functionality-to-textbox-in-ssrs-2005.aspx#feedback</comments>
            <slash:comments>6</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/microsoftian/comments/commentRss/130972.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/microsoftian/services/trackbacks/130972.aspx</trackback:ping>
        </item>
    </channel>
</rss>