I can't believe that there aren't lots of developers who:
1. create a crystal report that connects to sql server
2. calls the report using the crystalreportviewer control to view it and
then, if appropriate, print it
3. tries to deploy that report to the client's database, but now it calls
for a different database name
Yet I can't get an answer to the question:
I have developed numerous reports in an app (Windows Database App) that is
soon to go into production. When I built each report, CR connected to sql
server on my development platform. The connection string is different than
it will be at my client.
How can I change the connection string so that it recognizes my client's
server instead of mine for each of these reports?
Of course, I could install a version of crystal on the client and rebuild
the reports there, but that seems a terrible pain - and for every customer
with sql server? I've written to crystal and I get links to unhelpful kbase
articles.
Thanks for any help.
Bernie Yaeger 7 2133
Hello Bernie
You can use the SQL-DMO ListAvailableSQLServers to
retrieve all SQL servers on your client. If there's only
one then use that one if not ask the user which one to
use.
And when you define the ConnectionInfo of the report you
can use .ServerName = <your variable>
Kind Regards
Jorge Cavalheiro -----Original Message----- I can't believe that there aren't lots of developers who:
1. create a crystal report that connects to sql server 2. calls the report using the crystalreportviewer
control to view it andthen, if appropriate, print it 3. tries to deploy that report to the client's
database, but now it callsfor a different database name
Yet I can't get an answer to the question: I have developed numerous reports in an app (Windows
Database App) that issoon to go into production. When I built each report,
CR connected to sqlserver on my development platform. The connection
string is different thanit will be at my client.
How can I change the connection string so that it
recognizes my client'sserver instead of mine for each of these reports?
Of course, I could install a version of crystal on the
client and rebuildthe reports there, but that seems a terrible pain - and
for every customerwith sql server? I've written to crystal and I get
links to unhelpful kbasearticles.
Thanks for any help.
Bernie Yaeger
.
As addenda to what i say.
All MS SQL Servers have a Master database.
You can use the following command :
<code>
Use Master
exec sp_databases
</code>
That will return all databases on the server and there
size.
You still need to have the database admin password on
your client to run this.
Kind Regards
Jorge Cavalheiro -----Original Message----- Hello Bernie
You can use the SQL-DMO ListAvailableSQLServers to retrieve all SQL servers on your client. If there's only one then use that one if not ask the user which one to use.
And when you define the ConnectionInfo of the report you can use .ServerName = <your variable>
Kind Regards Jorge Cavalheiro
-----Original Message----- I can't believe that there aren't lots of developers
who: 1. create a crystal report that connects to sql server 2. calls the report using the crystalreportviewer control to view it andthen, if appropriate, print it 3. tries to deploy that report to the client's database, but now it callsfor a different database name
Yet I can't get an answer to the question: I have developed numerous reports in an app (Windows Database App) that issoon to go into production. When I built each report, CR connected to sqlserver on my development platform. The connection string is different thanit will be at my client.
How can I change the connection string so that it recognizes my client'sserver instead of mine for each of these reports?
Of course, I could install a version of crystal on the client and rebuildthe reports there, but that seems a terrible pain - and for every customerwith sql server? I've written to crystal and I get links to unhelpful kbasearticles.
Thanks for any help.
Bernie Yaeger
. .
Hi Jorge,
Tx for your help; I think I'm in the right direction now.
Bernie
"Jorge Cavalheiro" <an*******@discussions.microsoft.com> wrote in message
news:11****************************@phx.gbl... As addenda to what i say.
All MS SQL Servers have a Master database.
You can use the following command : <code> Use Master exec sp_databases </code> That will return all databases on the server and there size.
You still need to have the database admin password on your client to run this.
Kind Regards Jorge Cavalheiro
-----Original Message----- Hello Bernie
You can use the SQL-DMO ListAvailableSQLServers to retrieve all SQL servers on your client. If there's only one then use that one if not ask the user which one to use.
And when you define the ConnectionInfo of the report you can use .ServerName = <your variable>
Kind Regards Jorge Cavalheiro
-----Original Message----- I can't believe that there aren't lots of developers who: 1. create a crystal report that connects to sql server 2. calls the report using the crystalreportviewer control to view it andthen, if appropriate, print it 3. tries to deploy that report to the client's database, but now it callsfor a different database name
Yet I can't get an answer to the question: I have developed numerous reports in an app (Windows Database App) that issoon to go into production. When I built each report, CR connected to sqlserver on my development platform. The connection string is different thanit will be at my client.
How can I change the connection string so that it recognizes my client'sserver instead of mine for each of these reports?
Of course, I could install a version of crystal on the client and rebuildthe reports there, but that seems a terrible pain - and for every customerwith sql server? I've written to crystal and I get links to unhelpful kbasearticles.
Thanks for any help.
Bernie Yaeger
. .
Bernie
I have gone through this, and the following code circumvents all of the known bugs that I worked through to resolve the problem. Apparently there are more obvious ways to handle this that simply don't work (or didn't when I wrote the code)
I store connection information in a 'Registration' dll file that is located on each client. That way I can have an identical application running on many different clients, and each uses it's own set of connection info to get to the appropriate server and database. You could also use application settings that the users can change themselves
With this in place, I can create or revise reports on my dev machine and simply copy the report file to any and all clients with no changes at all, which was the main goal. The clients do not need Crystal Reports, and you certainly don't have to build the reports for each client
One note: this particular method will not work if you use Windows Integrated Security to connect the report to the database on your dev machine. So, if you used Integrated Security, and you want to use this code, open each report, change the database connection to use a UserName & Password, and re-save it. I informed Crystal that it would be really nice if this could be changed at run-time, but I am not aware if they have accomplished this yet
Declarations..
Imports CrystalDecisions.Share
Imports CrystalDecisions.CrystalReports.Engin
...
'Pass connection inf
Dim crTableLogonInfo As New TableLogOnInf
Dim crConnectionInfo As New ConnectionInf
Dim crTable As Tabl
Dim subRepDoc As New ReportDocumen
Dim crSection As Sectio
Dim crReportObject As ReportObjec
Dim crSubreportObject As SubreportObjec
With crConnectionInf
.DatabaseName = <<Insert DatabaseName>
.ServerName = <<Insert ServerName or IP Address and Port>
.UserID = <<Insert UserID>
.Password = <<Insert Password>
End Wit
crTableLogonInfo.ConnectionInfo = crConnectionInf
'CurrentReport is the ReportDocument loaded from a file earlier in this subroutin
For Each crTable In CurrentReport.Database.Table
crTable.ApplyLogOnInfo(crTableLogonInfo
crTable.Location = crTable.Nam
Nex
'If you have any sub-reports, they need the connection info too..
For Each crSection In CurrentReport.ReportDefinition.Section
For Each crReportObject In crSection.ReportObject
If crReportObject.Kind = ReportObjectKind.SubreportObject The
crSubreportObject = CType(crReportObject, SubreportObject
subRepDoc = crSubreportObject.OpenSubreport(crSubreportObject. SubreportName
For Each crTable In subRepDoc.Database.Table
crTable.ApplyLogOnInfo(crTableLogonInfo
crTable.Location = crTable.Nam
Nex
End I
Nex
Nex
'ReportViewer is the Crystal Reports Forms viewer on my for
ReportViewer.ReportSource = CurrentRepor
I hope this prevents the same headaches that I had to go through to get here..
Best Regards
Mark Lauser - Crimson Software
Hi Mark,
Finally, the right answers!
I had gotten some hard-to-understand suggestions in this direction from
Crystal, but the settings would not change using code very similar to yours.
I had just been guessing that the reason it wasn't working was because of
integrated security, and your remarks confirm that.
Now the last difficult part - how do I change from integrated security to a
login/pwd connection? Please let me know at your earliest convenience - and
thanks so much!
Bernie
"Mark Lauser .com>" <Mark@CrimsonSoftware<remove> wrote in message
news:9B**********************************@microsof t.com... Bernie,
I have gone through this, and the following code circumvents all of the
known bugs that I worked through to resolve the problem. Apparently there
are more obvious ways to handle this that simply don't work (or didn't when
I wrote the code). I store connection information in a 'Registration' dll file that is
located on each client. That way I can have an identical application
running on many different clients, and each uses it's own set of connection
info to get to the appropriate server and database. You could also use
application settings that the users can change themselves. With this in place, I can create or revise reports on my dev machine and
simply copy the report file to any and all clients with no changes at all,
which was the main goal. The clients do not need Crystal Reports, and you
certainly don't have to build the reports for each client. One note: this particular method will not work if you use Windows
Integrated Security to connect the report to the database on your dev
machine. So, if you used Integrated Security, and you want to use this
code, open each report, change the database connection to use a UserName &
Password, and re-save it. I informed Crystal that it would be really nice
if this could be changed at run-time, but I am not aware if they have
accomplished this yet. Declarations... Imports CrystalDecisions.Shared Imports CrystalDecisions.CrystalReports.Engine
... 'Pass connection info Dim crTableLogonInfo As New TableLogOnInfo Dim crConnectionInfo As New ConnectionInfo Dim crTable As Table Dim subRepDoc As New ReportDocument Dim crSection As Section Dim crReportObject As ReportObject Dim crSubreportObject As SubreportObject With crConnectionInfo .DatabaseName = <<Insert DatabaseName>> .ServerName = <<Insert ServerName or IP Address and Port>> .UserID = <<Insert UserID>> .Password = <<Insert Password>> End With crTableLogonInfo.ConnectionInfo = crConnectionInfo
'CurrentReport is the ReportDocument loaded from a file
earlier in this subroutine For Each crTable In CurrentReport.Database.Tables crTable.ApplyLogOnInfo(crTableLogonInfo) crTable.Location = crTable.Name Next
'If you have any sub-reports, they need the connection info
too... For Each crSection In CurrentReport.ReportDefinition.Sections For Each crReportObject In crSection.ReportObjects If crReportObject.Kind =
ReportObjectKind.SubreportObject Then crSubreportObject = CType(crReportObject,
SubreportObject) subRepDoc =
crSubreportObject.OpenSubreport(crSubreportObject. SubreportName) For Each crTable In subRepDoc.Database.Tables crTable.ApplyLogOnInfo(crTableLogonInfo) crTable.Location = crTable.Name Next End If Next Next
'ReportViewer is the Crystal Reports Forms viewer on my form ReportViewer.ReportSource = CurrentReport
I hope this prevents the same headaches that I had to go through to get
here... Best Regards, Mark Lauser - Crimson Software
Hi Mark,
Nevermind - figured that out.
Once again, thanks so much - major headache gone.
Bernie
"Mark Lauser .com>" <Mark@CrimsonSoftware<remove> wrote in message
news:9B**********************************@microsof t.com... Bernie,
I have gone through this, and the following code circumvents all of the
known bugs that I worked through to resolve the problem. Apparently there
are more obvious ways to handle this that simply don't work (or didn't when
I wrote the code). I store connection information in a 'Registration' dll file that is
located on each client. That way I can have an identical application
running on many different clients, and each uses it's own set of connection
info to get to the appropriate server and database. You could also use
application settings that the users can change themselves. With this in place, I can create or revise reports on my dev machine and
simply copy the report file to any and all clients with no changes at all,
which was the main goal. The clients do not need Crystal Reports, and you
certainly don't have to build the reports for each client. One note: this particular method will not work if you use Windows
Integrated Security to connect the report to the database on your dev
machine. So, if you used Integrated Security, and you want to use this
code, open each report, change the database connection to use a UserName &
Password, and re-save it. I informed Crystal that it would be really nice
if this could be changed at run-time, but I am not aware if they have
accomplished this yet. Declarations... Imports CrystalDecisions.Shared Imports CrystalDecisions.CrystalReports.Engine
... 'Pass connection info Dim crTableLogonInfo As New TableLogOnInfo Dim crConnectionInfo As New ConnectionInfo Dim crTable As Table Dim subRepDoc As New ReportDocument Dim crSection As Section Dim crReportObject As ReportObject Dim crSubreportObject As SubreportObject With crConnectionInfo .DatabaseName = <<Insert DatabaseName>> .ServerName = <<Insert ServerName or IP Address and Port>> .UserID = <<Insert UserID>> .Password = <<Insert Password>> End With crTableLogonInfo.ConnectionInfo = crConnectionInfo
'CurrentReport is the ReportDocument loaded from a file
earlier in this subroutine For Each crTable In CurrentReport.Database.Tables crTable.ApplyLogOnInfo(crTableLogonInfo) crTable.Location = crTable.Name Next
'If you have any sub-reports, they need the connection info
too... For Each crSection In CurrentReport.ReportDefinition.Sections For Each crReportObject In crSection.ReportObjects If crReportObject.Kind =
ReportObjectKind.SubreportObject Then crSubreportObject = CType(crReportObject,
SubreportObject) subRepDoc =
crSubreportObject.OpenSubreport(crSubreportObject. SubreportName) For Each crTable In subRepDoc.Database.Tables crTable.ApplyLogOnInfo(crTableLogonInfo) crTable.Location = crTable.Name Next End If Next Next
'ReportViewer is the Crystal Reports Forms viewer on my form ReportViewer.ReportSource = CurrentReport
I hope this prevents the same headaches that I had to go through to get
here... Best Regards, Mark Lauser - Crimson Software
Bernie
I'm sorry I didn't get back to you, I'm not in these newsgroups very often
I'm glad to hear that you got everything situated
Best Regards
Mark Lauser - Crimson Software This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Bob Rosen |
last post by:
Based on the information I have now, the answer would seem to be No. Does
anyone have information to the contrary?
Here's the problem. On my first attempt to display a report, Crystal...
|
by: Mithun Verma |
last post by:
Hello All,
I have a Windows application that uses Crystal Reports 9 (bundled Version)
developed using VS.NET 2003 on a windows server 2003 m/c.
The application has to be deployed on the client...
|
by: Grant Stanley |
last post by:
I'm developing an application in VS.Net 2003 using C#, which uses Crystal
Reports.
When creating each report, crystal asks where the database to use is, so I
specify our SQL server using the ADO...
|
by: mollyf |
last post by:
I have tried various suggestions that I have found searching the
newsgroups and still haven't been able to figure why I keep getting the
logon failed error.
I created a report in Crystal (not...
|
by: Henry |
last post by:
I am writing a Windows forms VB.Net/MS SQL application that utilizes
Crystal Reports. I want to be able to dynamically set the report data
source at run time. According to article...
|
by: Ddraig |
last post by:
Howdy,
I've got a little project going and I am trying to figure out a good
way to do this. But since I'm still learning I'm probably missing a
few obvious
steps. Also not sure if I have my...
|
by: Bernie Yaeger |
last post by:
I asked two fairly simple questions, or so I thought, but have received no
ideas at all.
1. What is the control that MS uses in Outlook Express that contains
attachments? It appears to be a...
|
by: cantonarv |
last post by:
Just trying to do a basic crystal report and viewing it with dynamic
sql server database but dont no what i'm doing wrong? I am using
integrated security.
Dim myRpt As crpt1 = New crpt1 ...
|
by: Cesar Ronchese |
last post by:
Hi,
I built the sample code showing the problem with dates when viewed at
different machines, different Time Zones and transported via Remoting.
The zip can be downloaded here:
...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: Mushico |
last post by:
How to calculate date of retirement from date of birth
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
|
by: Teri B |
last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course.
0ne-to-many. One course many roles.
Then I created a report based on the Course form and...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM)
Please note that the UK and Europe revert to winter time on...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
| | |