Solved

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

Posted on 2000-02-13
4
283 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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 Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

863 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

20 Experts available now in Live!

Get 1:1 Help Now