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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic creation of a report column(urgent!!!!!)

Status
Not open for further replies.

riya

Programmer
Mar 1, 2001
12
0
0
IN
hi ,

I need to know How to create a dynamic column in crystal reports at run time.This is a very urgent requirement.
All answers welcomed.

Thanx in advance
 
By dynamic do you mean you need a field that is capable of displaying various fields from the database based on the user's requirements at run time? Cheers

Marc
 
Put a formula field on the report, and then pass it a formula from the app which consists of the field name that you want to be printed. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
hi marc,

Its exactly this is what i want.A dynamic field which is created in runtime should get reflected in the reports.I hope u understand my problem.

Thanx in advance
 
Well in the past I've done this by asking the user to select the field they want to display via a parameter at runtime.

The formula for the dynamic field looks like this

if {?.Parameterfield} = "Name" then table.Name else
if {?.Parameterfield} = "Age" then table.Age else
if {?.Parameterfield} = "Company" then table.Company
etc!

So you create a parameter field named {?.Parameterfield} in the example above and then enter the selection you wish the user to see at runtime and enter this into the the if statement in a formula against the corresponding field.

Hope this helps
Cheers

Marc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top