Wednesday, December 16, 2009

Microsoft Reporting Service Report in Iron Speed and Different Viewer Control Version

Today I tried to integrate a SSRS report with iron speed I bumped up with some initial problems. Application is using ASP.net 3.5 framework.

1) First I wanted to show a report developed on SQL Server 2008 Reporting Services on Report Viewer 8.0, which is a part of SQL Server 2005 Reporting Service.

2) Reports navigation was disabled but print and preview was working fine.

After going through some research I resolved theses issues and found some more interesting issues.

If you have to change the report viewer from 8.0 to 9.0, after installing 9.0 viewer control in your machine change all the .aspx pages assemble reference from

<% Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb"%>

to

<% Register Assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

After doing this if you try to compile you will get compilation error to fix compilation error just change the solution config file reference to the report viewer from

verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"

to

verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"

Wallah it will compile and it will work perfectly fine.

Now lets get back to original issues how to fix two error after carefully analyzing the code I figure out the problem it lied in the code generated by the control developed by timt http://sjc.ironspeed.com/post?id=2290052. Actually

PDFData = CreatePDF(ReportViewer1); // returns a byte array of the PDF file which we can do what we like with
Session["ReportAsPDF"] = PDFData; // store in session for later use (possibly)

This was disabling the navigation in the report after comment out these lines, Navigation was working perfectly, function createPDF is overriding the render method and it was displaying PDF only version which was causing to disable the navigation.

No comments:

Post a Comment