Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2000-02-13
4
Medium Priority
?
292 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
[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
  • 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 100 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

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 …
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
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…
Suggested Courses

636 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