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
Solved

How to change the table name of crystal report in run time?

Posted on 2000-02-13
4
286 Views
Last Modified: 2010-05-02
Hi,

   I would like to create crystal report to show some fields of a table. But the table name is changed while field names remain unchanged when the report is created by VB5 each time. How can I do that in run time?

Richard
2/14
0
Comment
Question by:wnchan
  • 2
4 Comments
 
LVL 2

Expert Comment

by:alokanant
ID: 2517633
u can create a temporary table and copy data from different tables into it. then u can use this temp table in crystal report.

hth
alok
0
 

Author Comment

by:wnchan
ID: 2517754
The method is possible. But If two users create the same report at the same time, the data will be copied to the same temporary table at the same time. How to solve this problem?
0
 
LVL 2

Expert Comment

by:alokanant
ID: 2517888
i think this can be resolved by making the temporary table accessible to only one user at a time. Possibly when one user has pressed option for generating a report based on the temporary table, u can set a flag on. as soon as the user completes using the temporary table set the option off. whenever a user wants to create a report u can first check the flag and give appropriate message.

hth
alok.
0
 
LVL 1

Accepted Solution

by:
macu earned 50 total points
ID: 2518106
You should look in to using .ttx files. All you need to tell crystal is the table definitions, no names, and then pass it a recordset. I use ADO but you can use DAO, RDO or even a data control. To set this up, create a new SQL/ODBC report and choose Active Data (field definitions only), go through the steps of setting up your .ttx file. You then need to use SetPrivateData to transfer the recordset at run time. This is a bit more hassle than the other ways of using Crystal but well worth it, and much faster than getting Crystal to select your data. To read more about this search for this string in the crystal developer help file: 'Using the Active Data Driver'. One more thing, you need to use client side cursors for this to work.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying 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

Suggested Solutions

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

860 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