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

Preview and Data Explorer with connection string in a file specified by configSource

1 Answer 95 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Joe Solano
Top achievements
Rank 1
Joe Solano asked on 16 Feb 2011, 04:17 PM
Hello, we have reports defined in our primary web site project, in the web.config for that project are connection strings are specified in a seperate file using the configSource attribute, for example:

<connectionStrings configSource="Config\connectionStrings.local.config" />

This works fine at runtime, the report displays the correct data, however at design time the data explorer and preview return an error that indicate it can not find the connection string.  It is the standard "Unable to establish a connection to the database."

If the web.config is changed to include the connection string directly in the same file then the preview and data explorer work correctly.  
Is there some way to get the reporting designer capabilities to work with connection strings specified with a configSource?

I should mention that we are using the name of the connection string on the data source.

Thanks
Joe


1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 22 Feb 2011, 10:28 AM
Hello Joe Solano,

Currently this scenario is not supported. As the Best Practices help article suggests, you have to create a class library that contains your reports and then reference that class library in applications. This way in the class library app.config you can set a local connection string that will be used at report's design time only and at runtime the web application's web.config connection string that is in a configSource will be used.

Best wishes,
Peter
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
General Discussions
Asked by
Joe Solano
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or