IntroductionIn this article we will see how to integrate a RDL file in ASP.Net using ReportViewer.Contents
Step 2
Click on "File", expand "New" and click on "Web Site…".Step 3Select "ASP.NET Empty Web Site" in Visual C#.Provide a good name for the website.Step 4Right-click on "SSRSWeb", select Add >> Add ASP.NET Folder >> App_Code.Step 5Right-click on "SSRSWeb", select Add >> Add ASP.NET Folder >> Bin.Step 6Right-click on "SSRSWeb", select Add >> Add New Item.Step 7Select "Web Form" and provide a name for it.Step 8Now right-click on "Bin" and click on "Add Reference".Step 9In Extensions, select "Microsoft.ReportViewer.WebForms" and press the "OK" button.Step 10Add a class inside App_Code, right-click on "App_Code" and select "Add" >> "Add New Item…".Step 11Select "Class" and provide it the name "ReportCredentials".Step 12This class is used to get and set the report credentials.Step 13Inherit "IReportServerCredentials" using the namespace "Microsoft.Reporting.WebForms".Step 14Create a parameterized constructor to set the credentials and also create a method to get those details.Step 15Open "Default.aspx", drag and drop a "ReportViewer" from the toolbox under "Reporting".Step 16It will add a ReportViewer control to the aspx page and also register an assembly on the top of the page.Step 17Jump to "Default.aspx.cs" and implement the following code snippet.Here we set the credentials, ProcessingMode, ReportServerUrl and ReportPath.Step 18Now run the website and it asks for the ScriptManager.Step 19Add the ScriptManager from the toolbox under "AJAX Extensions" inside the form element in Default.aspx.Step 20Now run the website again.Step 21It asks us to register the web control inside the web.config under HTTP Handler.Step 22Copy the details from the preceding error and paste them under HttpHandler inside web.config.Step 23Now run the website and we can see the report in Default.aspx using the Report Viewer.
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: