Adding SharePoint Toolpart to SQL Report viewer
I am new to the Business Intelligence Project plug in for Visual Studio. I have a SQL Report created in Visual Studio using the Business Intelligence Report Server Project. I am hosting the report in a SharePoint Report Viewer Web part. I have 2 questions: 1. Is it possible to create a code behind module for the report in C#? The only codebehind module I see is in XML. I have seen many posts with C# code in them however they do not explain how to get to the code behind. 2. Is it possible to pass values from a SharePoint Toolpart to a SQL Report (via the Report Viewer web part) and use the value to generate the report? Thanks in advance.
September 14th, 2010 8:49pm

Hi jd_hancock, Firstly, short answer for your questions is Yes. Is it possible to create a code behind module for the report in C#? Yes. It is possible. By default, we have two ways to use custom code for a report. One is embedded code, and the other one is custom assembly. For more information, please see the "Reference" section in my post. Is it possible to pass values from a SharePoint Toolpart to a SQL Report (via the Report Viewer web part) and use the value to generate the report? Once the report has parameters, the parameter area in SharePoint toolbar will be generated automatically. So, in order to show the parameter in SharePoint toolbar, and then pass the values to the report, please add parameters for the report. Reference: How to use custom assemblies or embedded code in Reporting Services: http://support.microsoft.com/kb/920769 (For your question, please see Custome Assembly. In custom assembly, we can C# code.) Adding Parameters to Your Report: http://msdn.microsoft.com/en-us/library/ms155917(v=SQL.100).aspx If there is anything unclear, please feel free to ask. Thanks, Jin ChenJin Chen - MSFT
Free Windows Admin Tool Kit Click here and download it now
September 15th, 2010 1:58pm

Thank you for the quick reply Jin. I will check your post. I see the embeded code can only be VB. C# can only be used by creating a class module. I did more research and realized that I need to clarify my second question. I would like to pass the parameter via the URL (as a link in the Quicklaunch). I saw the parameters work nicely just by including them in the report. I've tried various parameters but so far have only been able to generate the report with URL parameters outside of the SharePoint master page. This link generates the report however not in page the report viewer web part exists in: http://sp-webserver2/c/PROJ1/SRSS/_layouts/ReportServer/RSViewerPage.aspx?rv%3aRelativeReportUrl=%2fc%2fproj1%2fsrss%2freports%2freport3.rdl&DefaultItemOpen=0&rp:pProject=003 Basically I need to be able to provide a quicklaunch link to the page containing the Report Viewer web part but include a parameter in that link for the report to use. This allows me to create as many links as I like and still reference only one report. Thank you again.
September 15th, 2010 4:07pm

From the lack of responses to this, I will trust that toolparts in SharePoint are not fully developed yet and are therefore unreliable and should not be used. I will hope that 2010 offers a functional toolpart.
Free Windows Admin Tool Kit Click here and download it now
February 7th, 2011 7:53am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics