Solved

CRYSTAL REPORTS 9 -SET DATA SOURCE LOCATION PROBLEM

Posted on 2003-11-29
5
504 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
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now