Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Table Names - Dream or Reality ?

Status
Not open for further replies.

pstarling

MIS
Mar 12, 2002
11
NZ
I want to be able to pass a parameter (the table name) at run time into a Crystal 8.5 report and report fields from the table whose name has just been passed through.

Every table in this database (at least that is what it's manufacturers call it!) is in the same format.

Is what I am trying to acheive possible?
 
You can do a set location on server based tables as well. I do not believe you can do this with a parameter as a pure crystal solution, you will have to go to VB and do this. Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
Hi there,

You could create a Crystal Query that would be able to acheive this. The important part here is that the data structure of the Fields and Field order with be identical all the time.

In the query designer you can create a parameter called "Table" for example and the code would look like this in SQL:

Select * From {?Table}

Note the Parameter must be a string for this to work. As well make sure there is no saved data on the QRY. Now when you report off of that query in Crystal Reports you will be prompted for the Parameter and you must enter in the Table value in order to populate.

Please be warned that missing the table name or incorrect data structure could cause GPF's and Page Fault errors in the product.

CJ a.c.e.
 
Keep in mind that CD usually doesn't recommend combining apps with QRY Files. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top