I'm trying to open an ssrs report on my web pages using ReportViewer. For the Report Serverl URL I have:
http://db_servers/ReportsServer_SENSORSQLSERVER
and for my report path I have:
http://db_servers/ReportsServer_SENSORSQLSERVER/Pages/ReportViewer.aspx?%2fCustomer1&rs:Command=Render.
I have looked through many sites and tutorial on how to add URL but I still get an error saying: The length of my link must be below 260 characters long. (rsInvalidItemPath). I also want to mention that my report server is in Native mode. My report server is located in another computer so I made sure the processing mode on my report viewer is remote. Whenever I go to the surver url I can clearly see the list of my reports and when I click on a report I can see it as well so I know my urls are correct. I have tried including a slash in front of my report path url, replacing "2%f" with a space. Nothing seems to work. Any idea? Thanks.
Locate the ReportViewer control in the Toolbox. If the Toolbox is not visible, you can access it from the View menu by selecting Toolbox. Drag the ReportViewer control onto the design surface of the Windows Form. A ReportViewer control named reportViewer1 is added to the form.
Under Installed | Templates, select Visual C# | ASP.NET Core | C1 ReportViewer View Page (ASP.NET Core) to open the C1 MVC ReportViewer dialog. In the C1 MVC ReportViewer dialog, select Report in SSRS server option. In the SSRS server field, enter a SSRS server URL to access the reports.
This is an old one but I bumped into it for a client. To get the report URL, I found it easiest to connect to the SQL instance that the Report Server is running on via SSMS, then open the ReportServer database, and query the Catalog table for the path fields.
You need to separate out the URL to the server, report path and add the parameters to a parameters array.
Here's a sample:
protected void Page_Init(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
// Set the processing mode for the ReportViewer to Remote
reportViewer.ProcessingMode = ProcessingMode.Remote;
ServerReport serverReport = reportViewer.ServerReport;
// Set the report server URL and report path
serverReport.ReportServerUrl =
new Uri("http://<Server Name>/reportserver");
serverReport.ReportPath =
"/AdventureWorks Sample Reports/Sales Order Detail";
// Create the sales order number report parameter
ReportParameter salesOrderNumber = new ReportParameter();
salesOrderNumber.Name = "SalesOrderNumber";
salesOrderNumber.Values.Add("SO43661");
// Set the report parameters for the report
reportViewer.ServerReport.SetParameters(
new ReportParameter[] { salesOrderNumber });
}
}
Above taken from Using the WebForms ReportViewer Control.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With