We help IT Professionals succeed at work.

To Hide columns at runtime ( dynamic) Powerbuilder 7

Mehram
Mehram asked
on
PB 7

I alwasy call all reporting datawindows in datawindow control [dw_1] in a window W_resp_criteria_report
The datawindow object is set at runtime and the reporting till the end is quite sucessfully running.

Now,
1) I will always call grid datawindow.
2) I want to hide some columns of the reporting datawindow at runtime (dynamically)

Lets suppose I have a datawindow rdw_salary with columns (emp_name,gross_salary,inc_tax,adv,discount,loan,nic_no,ntn_no)
Sometimes I need not to show column nic_no
Sometimes I need not to show column ntn_no
Sometimes I need not to show column nic_no and column ntn_no.

The columns which are not to be shown, I will assign in array variables

hide_column[1] = nic_no
hide_column[2] = ntn_no


If the array hide_column[] is empty then ok elseif
hide_column[1] = nic_no
then  I would like to hide the columns nic_no from the report rdw_salary
or if
hide_column[1] = nic_no
hide_column[2] = ntn_no
then  I would like to hide the columns nic_no,ntn_no from the report rdw_salary

I have some idea but very week in commands like dw_1.modify, dw_1.column.width=0 etc.
Please somebody help.

Mateen









Comment
Watch Question

Hi,

Please modify your code as per code snippet.

Regards,
Sandeep
string hide_column[]
integer li_count
 
hide_column[1] = nic_no
hide_column[2] = ntn_no
 
For li_count = 1 To upperbound(hide_column)
	dw_1.Modify(hide_column[li_count] + ".visible='0'")
Next

Open in new window

one correction...

hide_column[1] = "nic_no"
hide_column[2] = "ntn_no"