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

Change colunm name dynamically. 1

Status
Not open for further replies.

albertov10

Programmer
May 19, 2001
10
US
Hi everyone,

I work with VB and Crystal reports, normally through VB code I fill in Access tables and then I call Crystal reports to show the table.

the columns names of my reports are just text. and i make them in design mode. The problem i have now is that i need to change the name of those columns depending on the data I'm going to show using the same report.

for example I'm going to create groups on my report for instance I will like to show on the first group:

Columns
"August" "Sales"

1 250 €
2 450 €
3 15 €

etc

on the next group i will like to show something like this

Columns
"September" "Sales"
1 850 €
2 925 €
3 875 €

Any idea on how can i change dynamically the column names? thanks
 
Have you tried to group in specified order? If you Use specified order grouping you can create your own group names using various table.field values, formulas, etc.
 
This is simply done in Crystal

Make the column header a formula like this

//@HeaderColumn1

WhilePrintingRecords;

if {Table.value} = something then
"Choice1"
else if {Table.value} = somethingelse then
"Choice2"
else if {Table.value} = somethingother then
"Choice3"
else
"ChoiceDefault";

{Table.value} can be the groupName or a specific value in your database



Jim Broadbent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top