I know this is not related directly to Visual Basic, but maybe I can get some helpful feedback here.
We have developed a CR XI report using a local SQL Server database and several tables/views from it. The way we normally change the database a report uses is by going to the Change Datasource Location menu option, creating a new connection to the database and mapping both the main report and each table/view in the report to the new datasource and the new tables/views.
This is what I mean:
http://img411.imageshack.us/img411/9236/crmain8wz.jpg (general report connection properties)
http://img92.imageshack.us/img92/3397/crtable4zp.jpg (specific table/view connection properties)
We now need to distribute this report to the client and need to change the database the report uses. We have the name of the server and database at the client's site, but we obviously have no access to connect to it.
How do we change the datasource location in this case?
Thank you in advance.By the way, I tried using the code in this Microsoft page:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/crystlrf/html/crlrftableclassapplylogoninfomethodtopic.asp
The code is:
Private Sub LogonToReport (ByVal server As String, ByVal database As String, ByVal ID As String, ByVal password As String)
Dim logonInfo As New TableLogOnInfo()
Dim table As Table
' Set the logon information for each table.
For Each table In Report.Database.Tables
' Get the TableLogOnInfo object.
logonInfo = Table.LogOnInfo
' Set the server or ODBC data source name, database name,
' user ID, and password.
logonInfo.ConnectionInfo.ServerName = server
logonInfo.ConnectionInfo.DatabaseName = database
logonInfo.ConnectionInfo.UserID = ID
logonInfo.ConnectionInfo.Password = password
' Apply the connection information to the table.
Table.ApplyLogOnInfo(logonInfo)
Next table
End Sub
(Although I actually used the C# variant, but this is a VB forum.)
The second the ApplyLogOnInfo method is called, the CR component tries to connect to the database. WHY? Is there a way to avoid this?|||I have used this same code and I still have a problem
The connection details are passed using an ini file.
When developing the report (the actual rpt file) we have one database e.g. db1. When the report is copied to the production server we have another database name e.g. db2
The report rpt file holds on to the first name (db1), even though the c# code is showing the database name passed is db2.
Does anyone out there know a way to get the report to use the new database name?sql
Showing posts with label visual. Show all posts
Showing posts with label visual. Show all posts
Wednesday, March 21, 2012
Monday, March 19, 2012
How to change an existing UID to autonumbering?
Hullo!
Doubt it matters too much, but I'll just start off by saying that I'm using C# ASP.NET 2.0 in Visual Studio 2005.
I currently have a UID field entitled "ID", and I'd like to make it autonumbering so that users can input stuff into it through a simple web interface and not have to worry about the user's ID.
Anyone know how I could go about doing this? I can't seem to find a way through VS2005's GUI, and I can't seem to find anything on the internet about doing it through an SQL statement.
Thanks!I may have already figured my own problem out - I just have to test something really quick. If it works, I'll come back and tell ya what I did.
Subscribe to:
Posts (Atom)