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. Image for the cookie policy date
Starting in 2019, the Reporting control is no longer included in Essential Studio. If you're experiencing issues with the Syncfusion Reporting Platform, Report Viewer, Report Designer, or Report Writer, we recommend migrating to Bold Reports, our dedicated reporting platform.

Bold Reports offers a comprehensive suite of tools and features for all your reporting needs, and we will help you make a smooth transition from the discontinued control. Our support team at https://support.boldreports.com/ is here to assist you with any questions or difficulties you may encounter during the migration process.

We thank you for choosing Syncfusion and appreciate your understanding.

System ArgumentNullException

Hi. 

I am currently trying to view a report that is stored on a Microsoft 2016 Report Server in my MVC application using your reportviewer tool. 

I have followed the steps in your documentation, and examples you have provided to other Syncfusion users with issues with this tool. 

When i am running the page, i am getting an error returned in the reportViewer Dialog box. with the following Message. 

_reportLoaded:Sf_Exception - System.ArgumentNullException: Value cannot be null. 
Parameter name: source at System.Linq.Enumerable.Contains[TSource](IEnumerable`1 source, TSource value, IEqualityComparer`1 comparer) 
at System.Linq.Enumerable.Contains[TSource](IEnumerable`1 source, TSource value) 
at Syncfusion.EJ.ReportViewer.ReportHelper.ReportLoad(Dictionary`2 jsonResult, IReportController _reportController) 
at Syncfusion.EJ.ReportViewer.ReportHelper.ProcessReport(Dictionary`2 jsonResult, IReportController reportController)

I have attached the code that i have created for you to look over and i hope you are able to provide help or direct me in the correct place to where i am going wrong. 



Attachment: New_folder_(4)_607ae009.7z

11 Replies

MM Mageshyadav M Syncfusion Team December 18, 2018 10:51 AM UTC

Hi Paul, 
 
Thanks for your interest in our Syncfusion product. 
 
The mentioned NullReferenceException may occur when we did not pass the hidden parameter value for RDL file. Could you please check your report for hidden parameters. If there is hidden parameters, then can you please pass that parameter value in Client side or Server side as shown in below code example. 
 
Index.cshtml: 
            @(Html.EJ().ReportViewer("reportViewer") 
                                    .ProcessingMode(Syncfusion.JavaScript.ReportViewerEnums.ProcessingMode.Remote) 
                                            .ReportServiceUrl(VirtualPathUtility.ToAbsolute("~/api/ReportAPI")) 
                                           .ReportServerUrl("http://mvc.syncfusion.com/reportserver") 
                                            .ReportPath("/SSRSSamples2/Territory Sales new") 
                                            .Parameters(param => { param.Name("InvoiceID").Labels(new List<string>() { "InvoiceID" }) 
                                                .Values(new List<string>() { "10250" }).Add(); })) 
 
ReportApiController.cs: 
            string userName = "test"; 
            List<ReportParameter> parameters = new List<ReportParameter>(); 
            if (!reportOption.ReportModel.IsDrillthroughReport) 
            { 
                parameters.Add(new ReportParameter() { Name = "UserName", Labels = new List<string>() { "User Name" }, Values = new List<string>() { userName } }); 
                reportOption.ReportModel.Parameters = parameters; 
            } 
 
Please find the below help documentation for how to pass a parameter values in client side or server side. 
 
If issue still persists then can you please share that RDL file to validate the mentioned problem at our end. 
 
Regards, 
Mageshyadav.M 



PL Paul Lees December 19, 2018 12:02 PM UTC

Hi 

I have had a look at this and I believe that I do not have any hidden parameters attached to my report. 

I have supplied the RDL file for you to look at. 


Thanks


Paul 


Attachment: New_folder_(4)_eeec9807.zip


MM Mageshyadav M Syncfusion Team December 20, 2018 11:40 AM UTC

Hi Paul, 
 
Thanks for sharing the report. 
 
We have checked your shared report with dummy data and the report is rendered properly with our updated source. So we have prepared the simple sample to load the SSRS Server report and can you please confirm sample is working or not with your SSRS URL, ReportPath , Server credentials and datasource credential at your end. If your sample only not working still then can you please share the Syncfusion assemblies version and script version you are using to validate further on our end. 
 
 
Regards, 
Mageshyadav.M 



PL Paul Lees December 21, 2018 09:04 AM UTC

HI

Thanks for the response, demo you gave, it works well. 

What I am trying to do is to view a report within MVC to prevent users from being able to perform certain actions which the Syncfusion report viewer is able to supply me with the ability to restrict user actions. The Reports themselves use the windows login of the users to determine what they can see within their report. 

My Question is, is there a way of using windows authentication to connect to the server when setting up the ServerCredentials in the API. Currently I have a generic user to access this server, however this means that the report can only view the information against the generic user. 


MM Mageshyadav M Syncfusion Team December 24, 2018 05:39 AM UTC

Hi Paul, 
 
Yes, you can pass the Windows Active Directory username and password while setting up the ServerCredentials in the API to communicate/connect with report server. We don’t have separate method to call report server API using Windows Authentication. 
 
Regards, 
Mageshyadav.M 



PL Paul Lees December 27, 2018 03:14 PM UTC

Hi. 

Do you have any idea how you would obtain the password from AD, or if there is a way of connecting to the server using windows authentication without having to obtain the logged in users password, as this is sensitive information. 

Kind Regards 

Paul 


MM Mageshyadav M Syncfusion Team December 31, 2018 12:52 PM UTC

Hi Paul,  
 
We have an alternative way to connect with the server without users password.   
 
Please use the below details to generate token and make use of it.  
 
·        ValidationKey 
·        DecryptionKey 
·        UserId 
 
   
 
The ValidationKey and DecryptionKey will be available in the Web.config (refer image) file in the below installed location of Report server.  
 
C:\Syncfusion\Report Server\ReportServer.Web  
 
   
 
Please let us know whether this suggestion fits your requirement. 
 
Regards, 
Mageshyadav.M 



PL Paul Lees January 3, 2019 08:33 AM UTC

Hi 

Thanks for your response, however I am using a Microsoft SQL report server and not a syncfusion report server, which is what your response suggests. 

Is there a method similar to this that will work for a Microsoft SQL report server? 

Thanks

Paul


MM Mageshyadav M Syncfusion Team January 3, 2019 10:05 AM UTC

Hi Paul, 
 
Query 
Response 
 
Thanks for your response, however I am using a Microsoft SQL report server and not a syncfusion report server, which is what your response suggests.  
 
Is there a method similar to this that will work for a Microsoft SQL report server?  
 
Sorry for the inconvenience. 
 
Please ignore our updates on December 24, 2018 and December 31, 2018. Since we have mistakenly responded based on Syncfusion Report Server instead of dealing with SSRS server as per your usage. 
 
What I am trying to do is to view a report within MVC to prevent users from being able to perform certain actions which the Syncfusion report viewer is able to supply me with the ability to restrict user actions. The Reports themselves use the windows login of the users to determine what they can see within their report.  
 
My Question is, is there a way of using windows authentication to connect to the server when setting up the ServerCredentials in the API. Currently I have a generic user to access this server, however this means that the report can only view the information against the generic user.  
 
Actually we don’t have option to validate/use the windows authentication to connect to SSRS server. We will just connect to SSRS server based on your credentials shared only to get the report. 
 
Anyhow, please share some additional details how you are wishing to authenticate the windows credentials and restrict the report information based on generic user so that we can share you possibilities and suggestions based on that. 
 
Regards, 
Mageshyadav.M 



PL Paul Lees January 3, 2019 10:33 AM UTC

Hi Thanks for your response. 

This is my scenario,

I have an SSRS server which holds the reports. This uses windows authentication to log the user into the server.
I also have an MVC application which uses windows authentication. 

I want to view the reports from the server through the application, however using the syncfusion report viewer, I need to authenticate the user, using (Username, Password, Domain). I have the username and domain, however I am wanting to be able to authenticate the user without having to also pass a password to the server. The reason for this is, I want to be able to use single sign on for this. 

Passing these credentials through is important, as this will then allow the user to be picked up at the report server, which will hold the information on what the user can see from the server. 

The reason I want to use the syncfusion report viewer, is like asp classic, I am able to restrict options on the tool bar such as export functionality. Therefore, short of building into my MVC application, an aspx page, which I prefer not to do, I would like to use this option, however my struggle is connecting to the server without the password.

Thanks

Paul 




MM Mageshyadav M Syncfusion Team January 8, 2019 10:50 AM UTC

Hi Paul, 
  
Sorry for the delay in getting back to you. 
  
Thanks for your detailed information on your requirement. We have validated your requirement and found that we cannot provide authenticating users using windows authentication as per your requirement considering security reasons. But we can provide User ID information to be accessed in report for applying filters using this expression "=User!UserID”. 
 
Apart from this, we cannot assist further on this requirement and you can do validation by yourself in controller side regarding authentication and apply filters inside report using UserID. 
 
Regards, 
Mageshyadav.M 


Loader.
Up arrow icon