Recent

Author Topic: How to change crosstab column title text?  (Read 1353 times)

Fai

  • New Member
  • *
  • Posts: 24
How to change crosstab column title text?
« on: July 05, 2015, 03:08:33 am »
The crosstab source data is from table that has 4 fields: idno, hour, day_num, description.

In order to sort the day in the right order, I put value in 'day_num' field a number representing day name : value 1 is for 'Mon', 2 for 'Tue', 3 for 'Wed, and so on.

In the crosstab object inspector, the RowFields is from 'hour' field, ColumnFields is from 'day_num' field & CellFields is from 'description' field.

Because 'day_num' values is a number, I need to change the column title text  to day name : Mon, Tue, Wed,....

I try to change the column title text using ParName, ParValue in OnGetValue but does not change anything.

I try to put script in column title memo, but it seems to only change the value of the first record.
If I query the table and sort asc the day_num, all the column title changed to Mon. If I sort desc, all the column title changed to Sat.

This is the script :
Code: [Select]
if Text = '1' then Text:='Mon' else if
Text = '2' then Text:='Tue' else if
Text = '3' then Text:='Wed' else if
Text = '4' then Text:='Thu' else if
Text = '5' then Text:='Fri' else if
Text = '6' then Text:='Sat';

 :-\