1. Shaila Panwar
  2. PowerBuilder
  3. Monday, 16 April 2018 05:48 AM UTC

Can we create Data window dynamically from XML in PB17.

The XML can vary hence each time it could have deferent number of elements.

Please share any example if it can be done.

 

 

 

René Ullrich Accepted Answer Pending Moderation
  1. Monday, 16 April 2018 07:09 AM UTC
  2. PowerBuilder
  3. # 1

I don't know a direct way to do this in Powerbuilder.

You may try to use an ODBC XML driver to access the XML data like a database. So you can use the SyntaxFromSQL function to create a datawindow.

More difficult is to build the datawindow syntax yourself.

Comment
There are no comments made yet.
Alexander Strelkov Accepted Answer Pending Moderation
  1. Monday, 16 April 2018 07:37 AM UTC
  2. PowerBuilder
  3. # 2

In our project we create all DataWindow objects dynamically. DW syntax is generated on the basis of data that stored in the meta database or in XML. You can see some example here.

Comment
  1. Alexander Strelkov
  2. Monday, 16 April 2018 11:26 AM UTC
SyntaxFromSQL is very slow and not productive for such task/s. You must generate dw syntax on your own. Extract syntax from some example datawindow, analyze it and write similarly. This process is time consumed, but result is worth it.

  1. Helpful
  1. Roland Smith
  2. Monday, 16 April 2018 13:17 PM UTC
Here is bare minimum External DW syntax:



release 12.5;

datawindow(color=1073741824 processing=1 )

header(height=80 color="536870912" )

summary(height=0 color="536870912" )

footer(height=0 color="536870912" )

detail(height=92 color="536870912" )

table(column=(type=char(10) name=column1 dbname="column1" )

 column=(type=char(10) name=column2 dbname="column2" )

 )

  1. Helpful
  1. Shaila Panwar
  2. Tuesday, 17 April 2018 04:25 AM UTC
Thanks for the Syntax that can be taken from the Edit Source.



What I am looking for is how I would run through the XML to get the elements which can be added as columns in the datawindow dynamicaly.



 

  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.