This is a migrated thread and some comments may be shown as answers.

DataSource Problem with exporting programatically

1 Answer 58 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Alex Mitchell
Top achievements
Rank 1
Alex Mitchell asked on 11 May 2010, 05:15 PM
Hello,

I am currently trying to export a report as a PDF in code (from a WCF Service specifically) and I believe that I have that working correctly, but when i save the report and open it manually it complains and says

"An error has occured while processing Report '':
Unable to connect to database. Please verify that your connection string is valid; in case you use a connection string from the application configuration file, make sure the name is correct and the connection string settings are present in the configuration file of your application."

I don't know how to check what the problem is because when I open this same report in a WPF Report Viewer code, it works just fine. If I export the report from that Report Viewer and open it however, I do not get the error.

Basically, I only get this error on this report when in code. I have not gotten this on any other report or in any other fashion on this report.

If anybody knows something that I can check or set to make this work then that would be great.


I just updated my program and it turns out that the report no longer works in the report viewer. The data works just fine in the Preview but when I actually build the project or try to deploy it, I get the afore mentioned error.

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 13 May 2010, 02:03 PM
Hello Alex,

In case you use a connection string from the application configuration file (the one in the report class library), make sure the name is correct and the same connection string settings are present in the configuration file of your application as well."

In other words if you have saved a connectionString in your class library and it is e.g.:

<connectionStrings>
        <add name="Telerik.Reporting.Examples.CSharp.Properties.Settings.TelerikConnectionString"
            connectionString="Server=(local);Database=AdventureWorks;Integrated Security=SSPI;"
            providerName="System.Data.SqlClient" />
    </connectionStrings>

you should copy it to the web.config (in case of a website) or app.config (in case of a windows forms/wpf) as well.

Greetings,
Steve
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
General Discussions
Asked by
Alex Mitchell
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or