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!

Change CR fields at runtime 1

Status
Not open for further replies.

160473

IS-IT--Management
Apr 16, 2003
55
FI
I run a mysql query that populates as dataset. This is then used for displaying data in a Crystal Report.

But now to the problem. The dataset contains many columns but only a few is used in the report. Is it possible to change the datafields in the report to show different data based on what I want to see? (based on checkboxes on a form).
The dataset always contains the same columns.

Example:

Dataset: Col1, Col2, Col3 ..... Col10

 
In your query, use the "as" statement and rename the fields.
For example:
Select Col1, Col2, Col3 from mytable could read
Select Col1 as mycol1, Col2 as mycol2, Col3 as mycol3 from mytable

Now set up your report to use mycol1,mycol2,mycol3.

Then you could have a case statement to append the sql statements together. I can create you some code if this is what you had in mind.

 
Thanks!
That was a new approach to the problem ;)

No need to create code, done that already and it works greate!!!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top