Archive for category SSRS

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:

.ToolbarAtomDataFeed
{
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:

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:

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.

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:

ReportViewer

And reports in Report Manager looked like this:

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):

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:

.ToolbarAtomDataFeed
{
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.