[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 295
  • Last Modified:

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

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
wnchan
Asked:
wnchan
  • 2
1 Solution
 
alokanantCommented:
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
 
wnchanAuthor Commented:
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
 
alokanantCommented:
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
 
macuCommented:
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

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now