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.

ReportViewer cant connect to database

Thread ID:

Created:

Updated:

Platform:

Replies:

118562 Mar 19,2015 03:01 AM Mar 30,2015 06:20 AM ASP.NET MVC 5
loading
Tags: ReportViewer
Peter Lange
Asked On March 19, 2015 03:01 AM

I have a report viewer control on my website. It was initially setup (bare minimal) by Syncfusion's consultants, and on the version of my website they did it for it works. But as I have tried integrating my own reports into the viewer they invariably fail. I have confirmed that the connection string in the DataSource is correct, and by watching the connections in SQL Server Profiler, I can tell that the stored procedure that pulls the data is never called.

When I run the report viewer, I first receive the following JavaScript error:
Javascript runtime error: Unable to get property 'HeaderStyleModel' of undefined or null reference  (file: ej.web.all.min.js)

After choosing to continue, the page with the report viewer loads and it gives me the following error:
Datasource values are empty, Dataset depends on DataSource
Stacktrace:
  at Synchfusion.RDL.Data.ReportModelContentCollection.Evaluate()
  at Synchfusion.RDL.Data.ReportModel.Evaluate()
Provide Dataset inputs for Report

Attachment: Contact_List_f4c441b.zip

Soundara Rajan S [Syncfusion]
Replied On March 20, 2015 03:19 PM

Hi Peter,

 

Thank you for using Syncfusion Products.

I have a report viewer control on my website. It was initially setup (bare minimal) by Syncfusion's consultants, and on the version of my website they did it for it works. But as I have tried integrating my own reports into the viewer they invariably fail. I have confirmed that the connection string in the DataSource is correct, and by watching the connections in SQL Server Profiler, I can tell that the stored procedure that pulls the data is never called.

 

When I run the report viewer, I first receive the following JavaScript error:

Javascript runtime error: Unable to get property 'HeaderStyleModel' of undefined or null reference  (file: ej.web.all.min.js)

We were able to reproduce this and have logged defect report regarding this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates

 

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

After choosing to continue, the page with the report viewer loads and it gives me the following error:

Datasource values are empty, Dataset depends on DataSource
Stacktrace:
  at Synchfusion.RDL.Data.ReportModelContentCollection.Evaluate()
  at Synchfusion.RDL.Data.ReportModel.Evaluate()
Provide Dataset inputs for Report

We are unable to reproduce this issue in our end and shared report has working fine. we suspect this issue is due to failed open your sql connection. Therefore, Could you please ensure your connection string?.

 

Please let us know, if you have any concerns.

 

Regards,

Soundara Rajan S.


Peter Lange
Replied On March 20, 2015 06:53 PM

Hi Soundara,

First, let me say thanks for the reply. Everything is helpful. Regarding the connection string, I have tested the connection string and those are the same credentials the rest of my website uses to connect to the database. I am certainly willing to entertain that there may be something inherently wrong, or different, about how the Db connection string needs to be formatted in the report and I am just unaware of what that is. Could you post the DataSource node from the report after you updated it for your local crednetials? Perhaps that would help me understand what I need to change on my version.

Thanks Again

Soundara Rajan S [Syncfusion]
Replied On March 23, 2015 07:15 AM

Hi Peter,

Thanks for your update.

We can pass the userid and password with connection string to datasource as shown by below snippet,

Data Source=76.74.153.81;Initial Catalog=AdventureWorks;User Id=username;Password=password

Also, we can pass the datasource credential in code behind as shown by below code snippet,

//Method will be called when initialize the report options before start processing the report

public void OnInitReportOptions(ReportViewerOptions reportOption)

{

reportOption.ReportModel.DataSourceCredentials.Add(new DataSourceCredentials("AdventureWorks", "username", "password"));

}

For your convenience, we have prepared sample with remote database and it can downloaded below location,

http://www.syncfusion.com/downloads/support/forum/118562/RDLDemo-226779082.zip

Please let us know, if you have any queries.

Regards,

Soundara Rajan S.


Peter Lange
Replied On March 29, 2015 08:25 PM

Hi Soundara,

I wanted to check in on this and see if there was an update on the javascript error? Using the original project delivered to me, I was able to get the Contact List RDL I attached to hit the database and pull results, but nothing displayed due to that JS Error. (The tool bard showed that there were 634 pages in the report -- correctly -- but where the report would have rendered was just the grey background.)

Also, that fact that the original project was able to use this report shows that the connection string variables are correct. There has to be something, like maybe another DLL that is in the main project and not in the test project, that is interfering with this? Are there any known compatibility issues with the report viewer?

Soundara Rajan S [Syncfusion]
Replied On March 30, 2015 06:20 AM

Hi Peter,

Thanks for your reply and Sorry about inconvenience caused.

I wanted to check in on this and see if there was an update on the javascript error? Using the original project delivered to me, I was able to get the Contact List RDL I attached to hit the database and pull results, but nothing displayed due to that JS Error. (The tool bard showed that there were 634 pages in the report -- correctly -- but where the report would have rendered was just the grey background.)

Also, that fact that the original project was able to use this report shows that the connection string variables are correct. There has to be something, like maybe another DLL that is in the main project and not in the test project, that is interfering with this? Are there any known compatibility issues with the report viewer?

This is not compatibility issue and that the issue raised due to report borders. Also, we have logged issue report regarding this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

Please let us know, if you have any queries.

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.

;