Detect columns in Jiwa Grid  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Detect columns in Jiwa Grid

Postby SBarnes » Tue Jul 27, 2021 5:44 pm

Is there a way of telling in a Jiwa Grid which columns are set to visible by the grid manager?

I have to write a custom export screen for a customer and I am looking for a way of determining what columns should go into the output.

I suppose als I would need to turn all the columns back on when the screen loads.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1618
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Detect columns in Jiwa Grid  Topic is solved

Postby Mike.Sheen » Tue Jul 27, 2021 6:23 pm

SBarnes wrote:Is there a way of telling in a Jiwa Grid which columns are set to visible by the grid manager?

I have to write a custom export screen for a customer and I am looking for a way of determining what columns should go into the output.

I suppose als I would need to turn all the columns back on when the screen loads.


Each grid has a property "CustomColumnXML" - if the "Use Custom Columns" context menu item is checked, then this XML is what is applied to the grid. When that is off the "StandardColumnXML" property contains the XML of the column definition when not customised (ie: default as defined by the form code) - so be comparing the two, you can work out which columns have had their visibility, captions and order changed.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: Detect columns in Jiwa Grid

Postby SBarnes » Tue Jul 27, 2021 6:38 pm

Is this XML along similar lines to that used by first result set in a custom tabs stored procedure?
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1618
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Detect columns in Jiwa Grid

Postby Mike.Sheen » Wed Jul 28, 2021 10:57 am

SBarnes wrote:Is this XML along similar lines to that used by first result set in a custom tabs stored procedure?


Look and ye shall see.

But no.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: Detect columns in Jiwa Grid

Postby SBarnes » Thu Jul 29, 2021 9:41 am

Thanks Mike

Given that information I think going the Custom Tabs approach is probably easier.

Given I have discovered BuildGridFromDataReader on the JiwaGrid which is public, if I create a table to hold the name of the stored procedures and a meaningful description that the user can choose from on the screen from a combo box when they run it, I can use BuildGridFromDataReader to fill the grid and then just add the rubbish bin button as a column after this and react to the button press to remove rows.

I may need a DataTable behind the scenes for the eventual export to excel to keep track of any rows removed and have an up to date set of rows but the indexes into the datarows should correspond to the grid rows.

It should work and get rid of code needed to setup the grid and any code to display the lines etc which will save a fair bit of time unless you can think of anything that might be a problem?
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1618
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 3 guests

cron