Solved

CRYSTAL REPORTS 9 -SET DATA SOURCE LOCATION PROBLEM

Posted on 2003-11-29
5
523 Views
Last Modified: 2012-05-04
query regarding CRYSTAL REPORTS 9:
actually what i needed is,when adding any database fields in the design view.when i see the sql

query dialog box automatically,the database name gets added in front of the tables .so the

problem is when i change the database ,the report gives error like "field names not known"
0
Comment
Question by:ashok_btech
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 13

Accepted Solution

by:
EwaldL earned 168 total points
ID: 9842015
using the set location command in the crystal reports designer you shouldnt have any problem changing the database. this should be done for you. so i assume you are changing the database at runtime? if so, you need to change the table location. here is some vb6 / rdc 9 code that should take care of this. i hope this helps, but let me know in case i misunderstood the question or in case you are using some other object model

Dim myReport As CRAXDRT.Report
Dim myTable As CRAXDRT.DatabaseTable
For Each myTable In myReport.Database.Tables
  myTable.ConnectionProperties("Data Source") = "NewSqlServer"
  myTable.ConnectionProperties("Database") = "newDatabase"
  myTable.ConnectionProperties("Password") = "ThePassword"
  myTable.ConnectionProperties("User ID") = "TheUser"
  myTable.Location "NewDatabase.dbo." + myTable.Name
Next
0
 
LVL 1

Assisted Solution

by:yuniar
yuniar earned 166 total points
ID: 9846945
This problem has been fixed in Crystal Reports patch.
Have you deploy Crystal Report 9 patch?
0
 

Assisted Solution

by:yadav_surender
yadav_surender earned 166 total points
ID: 9940819
For setting the databaes at runtime use the following code

First declare the recordset of that table which you are using the report
then write the following code
Report.Database.SetDatasource rs,3,1  'rs is the recordset of that  table which you are using

If you are using more than one table then you can use another recordset
Report.Database.SetDatasource rs23,2 'rs2 the recordset of thoe second table

Cheers
Surender
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question