Hi,
I am trying to load SSRS report from report server to div.. I changed code in ReportController like this
public void OnInitReportOptions(ReportViewerOptions reportOption)
{
reportOption.ReportModel.ReportServerUrl = @"http://192.168.10.36:5001/Reports_SSRS";
reportOption.ReportModel.ProcessingMode = ProcessingMode.Remote;
reportOption.ReportModel.ReportServerCredential = new System.Net.NetworkCredential("MSSQLSERVER/user1", "password!");
string basePath = _hostingEnvironment.WebRootPath;
// Here, we have loaded the sales-order-detail.rdl report from the application folder wwwroot\Resources. sales-order-detail.rdl should be in the wwwroot\Resources application folder.
System.IO.FileStream inputStream = new System.IO.FileStream(reportOption.ReportModel.ReportServerUrl + reportOption.ReportModel.ReportPath + ".rdl", System.IO.FileMode.Open, System.IO.FileAccess.Read);
MemoryStream reportStream = new MemoryStream();
inputStream.CopyTo(reportStream);
reportStream.Position = 0;
inputStream.Close();
reportOption.ReportModel.Stream = reportStream;
}
// This code in razor component
<div id="report-viewer" style="width: 100%;height:800px" />
public async void RenderReportViewer()
{
viewerOptions.ReportName = "/ARMS_Reports/truck_report";
viewerOptions.ServiceURL = "/api/BoldReportsAPI";
BoldReports.Web.ReportParameter par1 = new (){Name = "branch",Values = new List<string>(){"CBE"}};
BoldReports.Web.ReportParameter par2 = new (){Name = "br",Values = new List<string>(){"1"}};
BoldReports.Web.ReportParameter par3 = new (){Name = "ason",Values = new List<string>(){"20220810"}};
BoldReports.Web.ReportParameter par4 = new (){Name = "ev",Values = new List<string>(){"1"}};
viewerOptions.Parameters = new[] { par1, par2, par3, par4 };
await JSRuntime.InvokeVoidAsync("BoldReports.RenderViewer", "report-viewer", viewerOptions);
}
But an error hit at here System.IO.FileStream inputStream = new System.IO.FileStream(reportOption.ReportModel.ReportServerUrl + reportOption.ReportModel.ReportPath + ".rdl", System.IO.FileMode.Open, System.IO.FileAccess.Read);
Error : System.IO.IOException: 'The filename, directory name, or volume label syntax is incorrect. : 'C:\Users\RIJASMK\source\repos\ARMS.v2\Views\http:\192.168.10.25:4456\Reports_SSRS.
How to load SSRS report from remote server.
Thank you
Hi Rijas,
Thanks for contacting Bold Reports support.
You don't need to provide the report stream. You have to provide the server URL and report path to load the report from your SSRS. Please refer to the below documentation.
https://help.boldreports.com/embedded-reporting/aspnet-core-reporting/report-viewer/ssrs-report/
We have attached the sample for your reference. Please check this sample with your server URL.
Regards,
Manoranjan R
Thank you for the reply sir, I tried to run the sample project you provided . But it throws an error. Failed to retrieve the report 'New-Kyle_EmployeeList' stream from the provided server details 'http://synclapn-18443/reports'
I changed the server name and report path . But I get same error with my report server name.
Hi Rijas,
Thanks for the update.
Please ensure whether you have provided the below permission to access the SSRS server and
ensure that you have provided the correct credentials details to access the report server
?
https://help.boldreports.com/embedded-reporting/faq/ssrs-enable-permission/
We have prepared the test sample to check the issue. Could you please add your report server credentials details in the attached sample and share the details?
Sample Details:
Add your server credentials in the Homecontroller.cs file.
|
Regards,
Manoranjan R