To Hide columns at runtime ( dynamic) Powerbuilder 7

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.

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.


Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


Please modify your code as per code snippet.

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'")

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
one correction...

hide_column[1] = "nic_no"
hide_column[2] = "ntn_no"
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.