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

How to get the "column name" in a crosstab DW

Status
Not open for further replies.

ThierryR

Programmer
Sep 9, 2003
11
0
0
BE
Hello,
I have a crosstab DW, and I would like to get
the value of the colums header.

In the Header[2] Band,
I have a field name val_t
with text : @Name

When I retrieve this DW, the header of the colums are fulfilled with Names comming from the DB.

How can I do to get them ?

Example:

C1 C2 C3 C4
V1 1 5 6 2
V2 3 4 8 9
V3 4 7 2 1


How can I find the column name "C1,C2,C3,C4"


Thank you


Thierry



 
You have probably already found a way to do this... I will offer this up in case you haven't... this is getting the values on the clicked event of the datawindow...

LONG ll_col
STRING ls_col, ls_objects, ls_value

//This obtains the column number...
ll_col = this.GetClickedColumn() // get column number

//You must set the static mode to yes to be able to obtain all of the objects...
dw_rpt.modify('datawindow.crosstab.staticmode=yes')

//This is the list of objects for the datawindow in question...
ls_objects=dw_rpt.object.datawindow.objects

//After looking at the objects in ls_objects... it was determined that I needed.... t_4, t_4_1,t_4_2, etc... yours will be different obviously... A describe will allow you to obtain the text...

//ps. gl_static was set using the following line after the retrieve...this obtains the static columns count...
gl_static = long(dw_rpt.describe('datawindow.column.count'))

ls_col = dw_rpt.describe("t_4_"+String(li_col - gl_static)+".text")

Messagebox('Hey',ls_col)


Anyhow.. hope this helps...
 
I was just missing the setting of the static mode to yes.

Thank you for you help

Thierry.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top