Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

CRYSTAL REPORTS 9 -SET DATA SOURCE LOCATION PROBLEM

Posted on 2003-11-29
5
Medium Priority
?
526 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 672 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 664 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 664 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
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…

704 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