Solved

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

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

759 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

23 Experts available now in Live!

Get 1:1 Help Now