Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Services / Reporting Services / December 2005

Tip: Looking for answers? Try searching our database.

selecting datasource when redistributing reports

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Craig L - 30 Dec 2005 18:07 GMT
Hi,
Thanks to an earlier post, I can distribute report to our client base =),
but I have hit a new snag.

The connection string used to create the report is not the string needed on
the client sites. Is there a way to automagically update the connection
string in a report with the correct info from the server it is being
installed on?

Thanks,
Craig
Potter - 30 Dec 2005 19:11 GMT
Craig,

The report is associated with a datasource.  The datasource is where
you'll find the connection string used by a report.

It is possible to programmatically create a datasource.   You could
collect the connection string server/db/user/pw in your installer and
then code the creation of the datasource by the report.

---------------------------------------------------------------------------
Public Sub CreateSampleDataSource()
   Dim name As String = "AdventureWorks"
   Dim parent As String = "/" + parentFolder

   'Define the data source definition.
   Dim definition As New DataSourceDefinition()
   definition.CredentialRetrieval = CredentialRetrievalEnum.Integrated
   definition.ConnectString = "data source=(local);initial
catalog=AdventureWorks2000"
   definition.Enabled = True
   definition.EnabledSpecified = True
   definition.Extension = "SQL"
   definition.ImpersonateUser = False
   definition.ImpersonateUserSpecified = True
   'Use the default prompt string.
   definition.Prompt = Nothing
   definition.WindowsCredentials = False

Try
   rs.CreateDataSource(name, parent, False, definition, Nothing)

Catch e As Exception
   Console.WriteLine(e.Message)
End Try
   
End Sub
------------------------------------------------
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.