We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

nullReferenceexption when loading SSRS report

Thread ID:

Created:

Updated:

Platform:

Replies:

121664 Jan 14,2016 08:46 AM Jan 19,2016 01:43 AM ASP.NET MVC 3
loading
Tags: ReportViewer
Agustin Silva
Asked On January 14, 2016 08:46 AM


We haven't been able to open reports in SSRS using the control. I'm able to got directly to the reporting services web site and open the report and run it, but not from the control.

In order to verify if it was my code, I modified the sample code, just to point to our reporting server, no luck, same error.

Attached is the image.

Attachment: Capture_23803288.zip

Soundara Rajan S [Syncfusion]
Replied On January 15, 2016 03:30 AM

Hi Agusti,

Thanks for contacting Syncfusion support.

We are unable to reproduce the mentioned issue at our end and it’s working fine. The mentioned issue might be occurred due to specify the invalid the report path to report in your application. So please ensure the provided reportPath in your sample. We have prepared standalone based on your requirement and it can be downloaded from below location,
http://www.syncfusion.com/downloads/support/directtrac/142785/MVCReportSample1020409770.zip 

Please refer the below UG Documentation more details on this,
http://help.syncfusion.com/aspnetmvc/reportviewer/ssrs-configuration

If the issue still persists, then share the razor view page and implemented the IReportController(WebAPI service) file with us to validate this issue.

Regards,
Soundara Rajan S.

Agustin Silva
Replied On January 15, 2016 07:30 AM

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"));
        }

Soundara Rajan S [Syncfusion]
Replied On January 19, 2016 01:43 AM

Hi Agusti,

In the shared code example, you have specified the invalid report processing mode and report path. Due to this, you are facing the null exception while loading the report at your end. So, please specify the processing mode as Remote for SSRS report and modify the SSRS report path as shown in the below example,

Processing Mode
 @(Html.EJ().ReportViewer("viewer")
                .ProcessingMode(Syncfusion.JavaScript.ReportViewerEnums.ProcessingMode.Remote)
                .ReportPath(“/Report Project1/rptHistDetallePago")
                .ReportServiceUrl("/api/SSRSReport")
                .ToolbarSettings(tb => tb.Items(Syncfusion.JavaScript.ReportViewerEnums.ToolbarItems.All))
                .ReportServerUrl("http://reportserver.cfse.gov/ReportServer"
            )


Report Path(Specify the report name without rdl file extension along with Folder Directory)


Regards,
Soundara Rajan S.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;