I tried using a local rdl file, same error.
If I use invalid credentials, I will get a 404 from the server. With the correct credentials I get the null exception.
Can it be the report server version? What about the parameters? The report have three parameters, do i need to include them in the definition? Does the datasource name in the code have to match the datasource name in the report?
Here is an extract from the rdl file:
<DataSourceName>DataSourceHistorial</DataSourceName>
<QueryParameters>
<QueryParameter Name="@EBTAcc">
<Value>=Parameters!EBTAcc.Value</Value>
</QueryParameter>
<QueryParameter Name="@segSoc">
<Value>=Parameters!segSoc.Value</Value>
</QueryParameter>
<QueryParameter Name="@caso">
<Value>=Parameters!caso.Value</Value>
</QueryParameter>
</QueryParameters>
This is the view code:
@(Html.EJ().ReportViewer("viewer")
.ProcessingMode(Syncfusion.JavaScript.ReportViewerEnums.ProcessingMode.Local)
.ReportPath("~/App_Data/rptHistDetallePago.rdl")
.ReportServiceUrl("/api/SSRSReport")
.ToolbarSettings(tb => tb.Items(Syncfusion.JavaScript.ReportViewerEnums.ToolbarItems.All))
.ReportServerUrl("http://reportserver.cfse.gov/ReportServer"
)
Here is part of the api
public void OnInitReportOptions(ReportViewerOptions reportOption)
{
string reportserverUrl = WebConfigurationManager.AppSettings["ReportServerUrl"];
reportOption.ReportModel.ReportServerCredential = new System.Net.NetworkCredential("theuser", "thepassword");
//reportOptions.ReportModel.ProcessingMode = ProcessingMode.Remote;
reportOptions.ReportModel.ReportServerUrl = reportserverUrl ;
reportOption.ReportModel.DataSourceCredentials.Add(new DataSourceCredentials("DataSourceHistorial", "anotheruser","anotherpassword"));
}