Archive for category SSRS

Reporting Services – HtmlViewer styles not being displayed

There is no shame in it. You make a change to your HtmlViewer.css style sheet, and the changes are not being reflected in Report Manager. It happens to lots of guys. But, help is on the way. Maybe.

This whole situation came about when I made a change to my HtmlViewer stylesheet on my development machine, which worked. When that same change was made to a test server, it didn’t. The style I changed was pretty straight-forward – it just hides the Atom icon in Report Manager:

display: none;

While poking around, I looked in the rsreportserver.config file, which was located in the “C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer” folder on my machine. I found that in the machine that worked, the “HTMLViewerStyleSheet ” element was there, and the one that didn’t, that same element was missing:


After making this change, the Reporting Services service will need to be restarted.

See your doctor if your style changes don’t last more than four hours.


Leave a comment

Export a report in pipe-delimited format in Reporting Services

This is an extra special two-fer blog post – you get to see how to change a comma-delimited CSV file into a pipe-delimited file, and how to remove an extra space that was being included at the end of a pipe-delimited export. To accomplish these exciting things, I had to dive into the rsreportserver.config, a place I don’t like going, but somebody had to do the dirty work. In the DeviceInfo element, I added the “ExcelMode” element with a value of False:

      <Extension Name=”PIPE” Type=”Microsoft.ReportingServices.Rendering.DataRenderer.CsvReport,Microsoft.ReportingServices.DataRendering”>
                  <Name Language=”en-US”>CSV (PIPE Delimited)</Name>

You can also see how to create a pipe-delimited export, by creating a new “Extension” element. The “OverrideNames\Name” element contains the label that will appear when you click the Export button in Report Manager to see the list of options to export your file, such as Excel, PDF, and CSV. I changed the “FieldDelimiter” element to the pipe character, and the other fields are standard with the existing CSV export. With this knowledge, you’ll be the life of the party.

Leave a comment

Modifying Report Manager and the ReportViewer controls

Say the following line in that voice of the guy that announces monster truck rallies: 

Are you ready for code that is going to BLOW YOUR MIND???? 

Too bad, because you’re getting this instead.

I was tasked to make the Reporting Services ReportViewer control look the same as the one in Report Manager. The ReportViewer looked like this:



And reports in Report Manager looked like this:

Report Manager

Report Manager

Most of the work was done with ReportViewer, removing buttons or rearranging them. So in the code behind for the page that held the ReportViewer (and in the following code, “rvReport” is a Microsoft.Reporting.WinForms.ReportViewer control):

            ToolStrip toolStrip = (ToolStrip)rvReport.Controls.Find(“toolStrip1”, true)[0];

            ToolStripItem refresh = toolStrip.Items[10];
            ToolStripItem print = toolStrip.Items[12];
            ToolStripItem export = toolStrip.Items[15];

            for (int i = 0;i < 10; i++)
            toolStrip.Items.Insert(12, export);
            toolStrip.Items.Insert(13, refresh);
            toolStrip.Items.Insert(14, print);

What? What’s with calling RemoveAt(7) ten times? Well, there were ten controls that needed to be removed between the page navigation arrows on the left side of the ReportViewer and the zoom control. I know, it doesn’t look like there are ten, but there are.

But my important, life-changing work wasn’t done. No no, there was more fun to be had because the Atom feed button was still lurking on the Report Manager screen. So to get rid of that travesty, I had to change the Report Server configuration file, HtmlViewer.css. My file was located at C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer\Styles.

Track down the ToolbarAtomDataFeed style and change it’s display from inline to none:

 display: none;

You’re probably out of breath because of the non-stop excitement that was this post. But you can get a breather now, until the next awesome post. Enjoy the rest.