1. François Rossignol
  2. PowerBuilder
  3. Wednesday, 21 February 2018 08:47 AM UTC

Hi

What I'm doing is using external datawindows as templates for another external datawindow (to make a calendar).

From the templates I get the objects I'll create in the calendar datawindow.

 

Basically I dw_template.describe('Datawindow.Objects')

Loop though the objects.

for each object I dw_template.describe('object_name.attributes')

Loop through the attributes and store the key:values in a datastore.

Along the key I ignore the key "type" and "attributes" and those pesky "?" (why would the .attributes return me attributes that not relevant for the object in question ?)

I do some mumbo jumbo on certain attribute .

Loop through the key:values datastore to generate a create string.

Finnaly I dw_calendar.modify(create_string)

An example of a create string

create text(accessiblerole='0' alignment='2' band='detail' border='0' color='8421504' enabled='1' focusrectangle='no' height='64' height.autosize='no' html.valueishtml='0' moveable='0' name='t_libelle_jour_semaine_1_1' pointer='Arrow!' resizeable='0' slideleft='no' slideup='no' tabsequence='0' text=' libelle_jour_semaine_1 ' visible='1' width='0 compute_x_ligne_verticale_2 - compute_x_ligne_verticale_1 - 18' x='0 compute_x_ligne_verticale_1 + 9' y='8' background.brushmode='0' background.color='536870912' background.gradient.angle='0' background.gradient.color='8421504' background.gradient.focus='0' background.gradient.repetition.count='0' background.gradient.repetition.length='100' background.gradient.repetition.mode='0' background.gradient.scale='100' background.gradient.spread='100' background.gradient.transparency='0' background.mode='1' background.transparency='0' tooltip.backcolor='134217752' tooltip.delay.initial='0' tooltip.delay.visible='32000' tooltip.enabled='0' tooltip.hasclosebutton='0' tooltip.icon='0' tooltip.isbubble='0' tooltip.maxwidth='0' tooltip.textcolor='134217751' tooltip.transparency='0' font.charset='0' font.face='Verdana' font.family='2' font.height='-10' font.pitch='2' font.weight='700' tag='-')

But the modify fails. I'm trying to figure it out but I'm a bit at a loss there.

Now I have some questions for the experts:

1 - Are quotes important ?

Will they make it fail if there's quotes where there's to supposed to be some ? (for example band='detail' instead of band=detail)

And the opposite will it fail if I don't put them where they're supposed to be (except when there's spaces of course) (for example pointer=Arrow! instead of Pointer=Arrow!

 

Now if that's important how can I know where I'm supposed to add quotes or not without going through all the attributes of all the objets with the datawindow syntax tool.

I'd like to keep things generic and not have to create/maintain such a list.

 

2 - When I compare the list of attributes from the object_name.attributes to what I have from the datawindow syntax tool, there's a few extras in the attributes list.

Now those extras are included in the create_string that I generate. Is that the reason for the failure ? Or is it that certain attributes must not be included in the create and others are just optional ?

 

3 - Is there a more efficient way to get all those attributes apart from getting the datawindow.syntax and parsing the lines with some kind of regular expression (I still want the key:value thing)

 

Thanks in advance.

Regards,

François

François Rossignol Accepted Answer Pending Moderation
  1. Thursday, 22 February 2018 10:34 AM UTC
  2. PowerBuilder
  3. # 1

Hi

 

Thanks for the tips and answers.

The ~t are present in my code (lost in copy and paste) as well as the "default" values.

Each objet has its own individual modify command, I did not try to create multiple objects with a single modify command.

1 - I wanted to avoid going through the edit source and whatnot and wanted to do it programmatically and generically. read all the properties from the template, modify some, create a new object in the destination datawindow with all the properties.

What I wanted to achieve (raw draft)

ll_count = this.rowCount()
ll_find = this.find("nom_objet = '" + as_nom_objet + "'",1,ll_count)
 
do while ll_find > 0
ls_nom_attribut = this.getItemString(ll_find,'nom_attribut')
ls_valeur_attribut = this.getItemString(ll_find,'valeur_attribut')
 
if ls_valeur_attribut <> '' then
// also tried to put quotes everywhere
if pos(ls_valeur_attribut,' ') > 0 then
ls_apostrophe = "'"
else
ls_apostrophe = ""
end if
ls_ret += " " + ls_nom_attribut + "=" + ls_apostrophe + ls_valeur_attribut + ls_apostrophe
end if
ll_find = this.find("nom_objet = '" + as_nom_objet + "'",ll_find + 1,ll_count + 1)
loop
 
ll_find = this.liste_types.find("nom_objet = '" + as_nom_objet + "'",1,this.liste_types.rowCount())
 
if ls_ret <> '' and ll_find > 0 then
ls_ret = 'create ' + this.liste_types.getItemString(ll_find,'valeur_attribut') + '(' + mid(ls_ret,2) + ')'
end if
 
what I ended up doing, it suits my need at the moment I'll try a better version later.
ll_find = this.liste_types.find("nom_objet = '" + as_nom_objet + "'",1,this.liste_types.rowCount())
if ll_find > 0 then
ls_type = this.liste_types.getItemString(ll_find,'valeur_attribut')
choose case ls_type
case 'text'
ls_ret = &
"create text(band=detail" + &
" color='"+ this.of_get_attribut(as_nom_objet,'color') + "' alignment='" + this.of_get_attribut(as_nom_objet,'alignment') + "' border='" + this.of_get_attribut(as_nom_objet,'border') + "' visible='" + this.of_get_attribut(as_nom_objet,'visible') + "'" + &
" height.autosize=" + this.of_get_attribut(as_nom_objet,'height.autosize') + " pointer='" + this.of_get_attribut(as_nom_objet,'pointer') + "' moveable=0 resizeable=0 x='" + this.of_get_attribut(as_nom_objet,'x') + "' y='" + this.of_get_attribut(as_nom_objet,'y') + "' height='" + this.of_get_attribut(as_nom_objet,'height') + "' width='"+ this.of_get_attribut(as_nom_objet,'width') + "' text='" + this.of_get_attribut(as_nom_objet,'text') + "'" + &
" name=" + this.of_get_attribut(as_nom_objet,'name') + " tag='" + this.of_get_attribut(as_nom_objet,'tag') + "' font.face='" + this.of_get_attribut(as_nom_objet,'font.face') + "' font.height='" + this.of_get_attribut(as_nom_objet,'font.height') + "' font.weight='" + this.of_get_attribut(as_nom_objet,'font.weight') + "' font.family='" + this.of_get_attribut(as_nom_objet,'font.family') + "' font.pitch='" + this.of_get_attribut(as_nom_objet,'font.pitch') + "' font.charset='" + this.of_get_attribut(as_nom_objet,'font.charset') + "' font.italic='" + this.of_get_attribut(as_nom_objet,'font.italic') + "' font.strikethrough='" + this.of_get_attribut(as_nom_objet,'font.strikethrough') + "' font.underline='" + this.of_get_attribut(as_nom_objet,'font.underline') + "' background.mode='" + this.of_get_attribut(as_nom_objet,'background.mode') + "' background.color='" + this.of_get_attribut(as_nom_objet,'background.color') + "')"
case 'bitmap'
ls_ret = &
"create bitmap(band=Detail pointer='"  + this.of_get_attribut(as_nom_objet,'pointer') + "' visible='" + this.of_get_attribut(as_nom_objet,'visible') + "'" + &
" moveable=0 resizeable=0 x='" + this.of_get_attribut(as_nom_objet,'x') + "' y='" + this.of_get_attribut(as_nom_objet,'y') + "' height='" + this.of_get_attribut(as_nom_objet,'height') + "' width='" + this.of_get_attribut(as_nom_objet,'width') + "'" + &
" filename='" + this.of_get_attribut(as_nom_objet,'filename') + "' name=" + this.of_get_attribut(as_nom_objet,'name') + ""  + &
" tag='" + this.of_get_attribut(as_nom_objet,'tag') + "')"
case 'rectangle'
ls_ret = &
"create rectangle(band=Detail"  +  &
" pointer='" + this.of_get_attribut(as_nom_objet,'pointer') + "' moveable=0 resizeable=0 x='" + this.of_get_attribut(as_nom_objet,'x') + "' y='" + this.of_get_attribut(as_nom_objet,'y') + "' height='" + this.of_get_attribut(as_nom_objet,'height') + "' width='" + this.of_get_attribut(as_nom_objet,'width') + "' name=" + this.of_get_attribut(as_nom_objet,'name') + " visible='" + this.of_get_attribut(as_nom_objet,'visible') + "'" + &
" tag='" + this.of_get_attribut(as_nom_objet,'tag') + "' brush.hatch='" + this.of_get_attribut(as_nom_objet,'brush.hatch') + "'" + &
" brush.color='" + this.of_get_attribut(as_nom_objet,'brush.color') + "' pen.style='" + this.of_get_attribut(as_nom_objet,'pen.style') + "' pen.width='" + this.of_get_attribut(as_nom_objet,'pen.width') + "' pen.color='" + this.of_get_attribut(as_nom_objet,'pen.color') + "' background.mode='" + this.of_get_attribut(as_nom_objet,'background.mode') + "' background.color='" + this.of_get_attribut(as_nom_objet,'background.color') + "')"
case 'roundrectangle'
ls_ret = &
"create roundrectangle(band=Detail"  +  &
" pointer='" + this.of_get_attribut(as_nom_objet,'pointer') + "' moveable=0 resizeable=0 x='" + this.of_get_attribut(as_nom_objet,'x') + "' y='" + this.of_get_attribut(as_nom_objet,'y') + "' height='" + this.of_get_attribut(as_nom_objet,'height') + "' width='" + this.of_get_attribut(as_nom_objet,'width') + "' name=" + this.of_get_attribut(as_nom_objet,'name') + " visible='" + this.of_get_attribut(as_nom_objet,'visible') + "'" + &
" ellipseheight='" + this.of_get_attribut(as_nom_objet,'ellipseheight') + "' ellipsewidth='" + this.of_get_attribut(as_nom_objet,'ellipsewidth') + "'" + &
" tag='" + this.of_get_attribut(as_nom_objet,'tag') + "' brush.hatch='" + this.of_get_attribut(as_nom_objet,'brush.hatch') + "'" + &
" brush.color='" + this.of_get_attribut(as_nom_objet,'brush.color') + "' pen.style='" + this.of_get_attribut(as_nom_objet,'pen.style') + "' pen.width='pen.width' pen.color='" + this.of_get_attribut(as_nom_objet,'pen.color') + "' background.mode='" + this.of_get_attribut(as_nom_objet,'background.mode') + "' background.color='" + this.of_get_attribut(as_nom_objet,'background.color') + "')"
case 'compute'
ls_ret = &
"create compute(band=Detail"  +  &
" color='" + this.of_get_attribut(as_nom_objet,'color') + "' alignment='" + this.of_get_attribut(as_nom_objet,'alignment') + "' border='" + this.of_get_attribut(as_nom_objet,'border') + "' visible='" + this.of_get_attribut(as_nom_objet,'visible') + "'" + &
" height.autosize=" + this.of_get_attribut(as_nom_objet,'height.autosize') + " pointer='" + this.of_get_attribut(as_nom_objet,'pointer') + "' moveable=0 resizeable=0 x='" + this.of_get_attribut(as_nom_objet,'x') + "' y='" + this.of_get_attribut(as_nom_objet,'y') + "' height='" + this.of_get_attribut(as_nom_objet,'height') + "' width='" + this.of_get_attribut(as_nom_objet,'width') + "' format='" + this.of_get_attribut(as_nom_objet,'format') + "'" + &
" name=" + this.of_get_attribut(as_nom_objet,'name') + " tag='" + this.of_get_attribut(as_nom_objet,'tag') + "' expression='" + this.of_get_attribut(as_nom_objet,'expression') + "' font.face='" + this.of_get_attribut(as_nom_objet,'font.face') + "' font.height='" + this.of_get_attribut(as_nom_objet,'font.height') + "' font.weight='" + this.of_get_attribut(as_nom_objet,'font.weight') + "' font.family='" + this.of_get_attribut(as_nom_objet,'font.family') + "' font.pitch='" + this.of_get_attribut(as_nom_objet,'font.pitch') + "' font.charset='" + this.of_get_attribut(as_nom_objet,'font.charset') + "' font.italic='" + this.of_get_attribut(as_nom_objet,'font.italic') + "' font.strikethrough='" + this.of_get_attribut(as_nom_objet,'font.strikethrough') + "' font.underline='" + this.of_get_attribut(as_nom_objet,'font.underline') + "' background.mode='" + this.of_get_attribut(as_nom_objet,'background.mode') + "' background.color='" + this.of_get_attribut(as_nom_objet,'background.color') + "')"
case 'column'
choose case this.of_get_attribut(as_nom_objet,'edit.style')
case 'edit'
ls_ret = &
"create  column(id=" + this.of_get_attribut(as_nom_objet,'id') + " tabsequence=" + this.of_get_attribut(as_nom_objet,'tabsequence') + " moveable=0 resizeable=0 pointer='" + this.of_get_attribut(as_nom_objet,'pointer') + "' band=Detail visible='" + this.of_get_attribut(as_nom_objet,'visible') + "'"  +  &
" x='" + this.of_get_attribut(as_nom_objet,'x') + "' y='" + this.of_get_attribut(as_nom_objet,'y') + "' bitmapname=" + this.of_get_attribut(as_nom_objet,'bitmapname') + " format='" + this.of_get_attribut(as_nom_objet,'format') + "' alignment='" + this.of_get_attribut(as_nom_objet,'alignment') + "' height.autosize=" + this.of_get_attribut(as_nom_objet,'height.autosize') + " border='" + this.of_get_attribut(as_nom_objet,'border') + "' color='" + this.of_get_attribut(as_nom_objet,'color') + "' height='" + this.of_get_attribut(as_nom_objet,'height') + "' width='" + this.of_get_attribut(as_nom_objet,'width') + "' name=" + this.of_get_attribut(as_nom_objet,'name') + " tag='" + this.of_get_attribut(as_nom_objet,'tag') + "' protect='" + this.of_get_attribut(as_nom_objet,'protect') + "'" + &
" background.mode='" + this.of_get_attribut(as_nom_objet,'background.mode') + "' background.color='" + this.of_get_attribut(as_nom_objet,'background.color') + "' font.face='" + this.of_get_attribut(as_nom_objet,'font.face') + "' font.height='" + this.of_get_attribut(as_nom_objet,'font.height') + "' font.weight='" + this.of_get_attribut(as_nom_objet,'font.weight') + "' font.family='" + this.of_get_attribut(as_nom_objet,'font.family') + "' font.pitch='" + this.of_get_attribut(as_nom_objet,'font.pitch') + "' font.charset='" + this.of_get_attribut(as_nom_objet,'font.charset') + "' font.italic='" + this.of_get_attribut(as_nom_objet,'font.italic') + "' font.strikethrough='" + this.of_get_attribut(as_nom_objet,'font.strikethrough') + "' font.underline='" + this.of_get_attribut(as_nom_objet,'font.underline') + "' html.link='" + this.of_get_attribut(as_nom_objet,'html.link') + "' html.linktarget='" + this.of_get_attribut(as_nom_objet,'html.linktarget') + "'" + &
"  edit.validatecode=" + this.of_get_attribut(as_nom_objet,'edit.validatecode') + " edit.focusrectangle=" + this.of_get_attribut(as_nom_objet,'edit.focusrectangle') + " edit.nilisnull=" + this.of_get_attribut(as_nom_objet,'edit.nilisnull') + " edit.password=" + this.of_get_attribut(as_nom_objet,'edit.password') + " edit.required=" + this.of_get_attribut(as_nom_objet,'edit.required') + " edit.hscrollbar=" + this.of_get_attribut(as_nom_objet,'edit.hscrollbar') + " edit.limit=" + this.of_get_attribut(as_nom_objet,'edit.limit') + " edit.codetable=" + this.of_get_attribut(as_nom_objet,'edit.codetable') + " edit.displayonly=" + this.of_get_attribut(as_nom_objet,'edit.displayonly') + " edit.autovscroll=" + this.of_get_attribut(as_nom_objet,'edit.autovscroll') + " edit.case=" + this.of_get_attribut(as_nom_objet,'edit.case') + " edit.autohscroll=" + this.of_get_attribut(as_nom_objet,'edit.autohscroll') + " edit.autoselect=" + this.of_get_attribut(as_nom_objet,'edit.autoselect') + " edit.vscrollbar=" + this.of_get_attribut(as_nom_objet,'edit.vscrollbar') + " edit.name='" + this.of_get_attribut(as_nom_objet,'edit.name') + "') "
//" x='" + this.of_get_attribut(as_nom_objet,'x') + "' y='" + this.of_get_attribut(as_nom_objet,'y') + "' bitmapname=" + this.of_get_attribut(as_nom_objet,'bitmapname') + " criteria.dialog=" + this.of_get_attribut(as_nom_objet,'criteria.dialog') + " criteria.override_edit=" + this.of_get_attribut(as_nom_objet,'criteria.override_edit') + " format='" + this.of_get_attribut(as_nom_objet,'format') + "' alignment='" + this.of_get_attribut(as_nom_objet,'alignment') + "' criteria.required=" + this.of_get_attribut(as_nom_objet,'criteria.required') + " height.autosize=" + this.of_get_attribut(as_nom_objet,'height.autosize') + " border='" + this.of_get_attribut(as_nom_objet,'border') + "' color='" + this.of_get_attribut(as_nom_objet,'color') + "' height='" + this.of_get_attribut(as_nom_objet,'height') + "' width='" + this.of_get_attribut(as_nom_objet,'width') + "' name=" + this.of_get_attribut(as_nom_objet,'name') + " tag='" + this.of_get_attribut(as_nom_objet,'tag') + "'" + &
//"  edit.validatecode=" + this.of_get_attribut(as_nom_objet,'edit.validatecode') + " edit.focusrectangle=" + this.of_get_attribut(as_nom_objet,'edit.focusrectangle') + " edit.format=" + this.of_get_attribut(as_nom_objet,'edit.format') + " edit.nilisnull=" + this.of_get_attribut(as_nom_objet,'edit.nilisnull') + " edit.password=" + this.of_get_attribut(as_nom_objet,'edit.password') + " edit.required=" + this.of_get_attribut(as_nom_objet,'edit.required') + " edit.hscrollbar=" + this.of_get_attribut(as_nom_objet,'edit.hscrollbar') + " edit.limit=" + this.of_get_attribut(as_nom_objet,'edit.limit') + " edit.codetable=" + this.of_get_attribut(as_nom_objet,'edit.codetable') + " edit.displayonly=" + this.of_get_attribut(as_nom_objet,'edit.displayonly') + " edit.autovscroll=" + this.of_get_attribut(as_nom_objet,'edit.autovscroll') + " edit.case=" + this.of_get_attribut(as_nom_objet,'edit.case') + " edit.autohscroll=" + this.of_get_attribut(as_nom_objet,'edit.autohscroll') + " edit.autoselect=" + this.of_get_attribut(as_nom_objet,'edit.autoselect') + " edit.vscrollbar=" + this.of_get_attribut(as_nom_objet,'edit.vscrollbar') + " edit.name='" + this.of_get_attribut(as_nom_objet,'edit.name') + "') "
end choose
case 'ellipse'
ls_ret = &
"create ellipse(band=Detail"  +  &
" moveable=0 resizeable=0 x='" + this.of_get_attribut(as_nom_objet,'x') + "' y='" + this.of_get_attribut(as_nom_objet,'y') + "' height='" + this.of_get_attribut(as_nom_objet,'height') + "' width='" + this.of_get_attribut(as_nom_objet,'width') + "' name=" + this.of_get_attribut(as_nom_objet,'name') + " visible='" + this.of_get_attribut(as_nom_objet,'visible') + "'" + &
" tag='" + this.of_get_attribut(as_nom_objet,'tag') + "' brush.hatch='" + this.of_get_attribut(as_nom_objet,'brush.hatch') + "'" + &
" brush.color='" + this.of_get_attribut(as_nom_objet,'brush.color') + "' pen.style='" + this.of_get_attribut(as_nom_objet,'pen.style') + "' pen.width='" + this.of_get_attribut(as_nom_objet,'pen.width') + "' pen.color='" + this.of_get_attribut(as_nom_objet,'pen.color') + "' background.mode='" + this.of_get_attribut(as_nom_objet,'background.mode') + "' background.color='" + this.of_get_attribut(as_nom_objet,'background.color') + "')"
end choose
end if

 

2 - Let's go with this code straight out of the Datawindow Syntax tool from the PB IDE


"create  column( id= tabsequence= accelerator='' moveable=<0 - False, 1 - True> resizeable=<0 - False, 1 - True> pointer='' band=, Summary, Trailer., Background, Foreground>"  +  &
" x='' y='' bitmapname= criteria.dialog= criteria.override_edit= format='' alignment='<0 - Left, 1 - Right, 2 - Center>' criteria.required= height.autosize= border='<0 - None, 1- Shadow, 2 - Box, 3 - Resize, 4 - Underline, 5 - 3D Lowered, 6 - 3D Raised>' color='
' height='' width='' name= tag=''"+&
" background.mode='<0 - Opaque, 1 - Transparent>' background.color='
' font.face='' font.height='' font.weight='<400 - Normal, 700 - Bold>' font.family='<0 - AnyFont, 1 - Roman, 2 - Swiss, 3 - Modern, 4 - Script, 5 - Decorative>' font.pitch='<0 - default, 1 - Fixed, 2 - Variable>' font.charset='<0 - Ansi, 1 - default, 2 - Symbol, 128 - Shift JIS, 255 - OEM>' font.italic='<0 - False, 1 - True>' font.strikethrough='<0 - False, 1 - True>' font.underline='<0 - False, 1 - True>' html.link='' html.linktarget='' html.linkargs='='' [=''] ...'"+&
"  edit.validatecode= edit.focusrectangle= edit.format= edit.nilisnull= edit.password= edit.required= edit.hscrollbar= edit.limit= edit.codetable= edit.displayonly= edit.autovscroll= edit.case= edit.autohscroll= edit.autoselect= edit.vscrollbar= edit.name='') ")

For my dynamic creation I had to remove the criteria. properties because it made the create failed. I wanted to know if there's some properties, even if correctly set (or I assume because the values came from a dw.describe) that will make the create fail.

Now is it the Datawindow Syntax Tool returning incorrect informations or is it a create bug or maybe just me doing something wrong ?

 

Comment
  1. Miguel Leeuwee
  2. Saturday, 24 February 2018 10:22 AM UTC
Hi François, 



" I wanted to know if there's some properties, even if correctly set (or I assume because the values came from a dw.describe) that will make the create fail."



Yes, absolutely! There are lots of attributes which are only available to certain dw objects and edit styles. Editmasks has different attributes, spin controls, etc. You only have to use an attribute in your Modify() string, if you create a column which has the corresponding edit style.



For example, the "criteria" property will be available only if you column has a dropdowndatawindow edit style, but not when it's a normal "edit". The nilisnull is also not always available (correct me if I'm wrong, I think it's not available for checkbox edit style).



So you cannot simply apply all possible attributes at the same time to a single column. First you have to decide what you want to create. The way to do that is easiest if you just create a datawindow with a single column which represents what you want to do, save it and then edit the source code or export it and open the exported file with an editor. That's the string you should use in the modify. (remember: to be able to create a column on a datawindow it has to be present in the "column=..." section. Also if the column is already visible on the datawindow, you cannot create it with the same name).



 



Regards,



MiguelL.

  1. Helpful
  1. Miguel Leeuwee
  2. Saturday, 24 February 2018 10:23 AM UTC
(was duplicate of previous answer)

  1. Helpful
There are no comments made yet.
Michael Kramer Accepted Answer Pending Moderation
  1. Wednesday, 21 February 2018 19:03 PM UTC
  2. PowerBuilder
  3. # 2

Hi François,

​Lots of good info in previous responses. My two cents worth of advice:

  1. ​Whenever you have computed expressions, you MUST have it prefixed by a "default" value followed by a tab character. That's required syntax.
    1. ​​Example (added spacing and parentheses for easier reading):
      DataColumn.Border  = " 5 ~t if( (GuestUser = 'Y'), 1, 0) + 5"
      DataColumn.Protect = " 0 ~t if( (GuestUser = 'Y'), 1, 0)"
      Default is 3D Lower border and data can be edited.
      Column gets protected and displays 3D Raised border when user is marked "Guest = Yes"
  2. ​Format your dw.Modify commands with "~r~n" between each sub-command. This makes error messages easier to comprehend
    1. BECAUSE:
      "Line 17 Column 26 incorrect syntax"
      is easier to debug than
      "Line 1 Column 2345 incorrect syntax"

Enjoy, /Michael

Sidebar: You can throw almost any size command string at Modify. I once saw dw.Modify be erratic for command string approx 2 MB. No issue for command in smaller chunks of 100-200kB each. And it was PB5.

Comment
There are no comments made yet.
Philippe PILAT Accepted Answer Pending Moderation
  1. Wednesday, 21 February 2018 16:19 PM UTC
  2. PowerBuilder
  3. # 3

Hi François,

I think the error comes from the x & width attributes : width='0 compute_x_ligne_verticale_2 - compute_x_ligne_verticale_1 - 18' x='0 compute_x_ligne_verticale_1 + 9'

I guess you have an expression in the template so you have to specify the value like this : width='0~tcompute_x_ligne_verticale_2 - compute_x_ligne_verticale_1 - 18'

HTH.

Regards,

Comment
There are no comments made yet.
Govinda Lopez @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 21 February 2018 15:54 PM UTC
  2. PowerBuilder
  3. # 4

Hi François Rossignol,

 

I believe Miguel's comment is very good and useful. However, if you'd like to obtain more technical knowledge of the DataWindows, I can suggest you looking into this two documents: 

 

  1. DataWindow Programmers Guide
  2. DataWindow Reference

 

I hope this is helpful.

 

Regards,

Comment
  1. Philippe PILAT
  2. Wednesday, 21 February 2018 16:18 PM UTC
Hi François,



I think the error comes from the x & width attributes : width='0 compute_x_ligne_verticale_2 - compute_x_ligne_verticale_1 - 18' x='0 compute_x_ligne_verticale_1 + 9'



I guess you have an expression in the template so you have to specify the value like this : width='0~tcompute_x_ligne_verticale_2 - compute_x_ligne_verticale_1 - 18'



HTH.



Regards,

  1. Helpful
There are no comments made yet.
Miguel Leeuwee Accepted Answer Pending Moderation
  1. Wednesday, 21 February 2018 13:56 PM UTC
  2. PowerBuilder
  3. # 5

Hi,

I'll try to add some info on your questions but don't have too much time right now:

1 - Are quotes important ?

-- yes, though you can change " with '

Now if that's important how can I know where I'm supposed to add quotes or not without going through all the attributes of all the objets with the datawindow syntax tool.

I'd like to keep things generic and not have to create/maintain such a list.

-- create a datawindow that has everything on it what you want to create

-- then do an "EDIT Source" of that datawindow (right-mouse click on the dw in the library painter).

-- That should give you all the information you need, you don't have to go through all of the attributes with the dw syntax tool.

-- Beware the dw syntax tool is far from complete, many attributes are missing, so best is to edit the source of a datawindow in combination with the use of that tool

 

2 - When I compare the list of attributes from the object_name.attributes to what I have from the datawindow syntax tool, there's a few extras in the attributes list.

-- some might be optional. others aren't 

3 - Is there a more efficient way to get all those attributes apart from getting the datawindow.syntax and parsing the lines with some kind of regular expression (I still want the key:value thing)

-- yes, as answered under 1 -

 

TIPS:

Also beware that if you want to create a column that columns has to be in the "list with colums": 

table(column=(type=char(250) updatewhereclause=yes name=col1 dbname="col1" )
 column=(type=char(250) updatewhereclause=yes name=col2 dbname="col2" )
 column=(type=char(250) updatewhereclause=yes name=col3 dbname="col3" )
etc.

The id that you have to specify for the creation of the column must correspond with the order of appearance in this column list, so for example my "col3" has an id=3

If then later you want to delete that column and use this syntax:

- dw_1.Modify("destroy column col3")

This will ALSO delete the column from the columns list, something you might not want if later you want to be able to re-create the column.

In that case use  - dw_1.Modify("destroy col3")

(without the column in the modify, that way the column will disappear from the front-end of the datawindow, but remain in the column list).

 

HIH,

MiguelL

 

Comment
There are no comments made yet.
Miguel Leeuwee Accepted Answer Pending Moderation
  1. Wednesday, 21 February 2018 13:55 PM UTC
  2. PowerBuilder
  3. # 6

Hi,

I'll try to add some info on your questions but don't have too much time right now:

1 - Are quotes important ?

-- yes, though you can change " with '

Now if that's important how can I know where I'm supposed to add quotes or not without going through all the attributes of all the objets with the datawindow syntax tool.

I'd like to keep things generic and not have to create/maintain such a list.

-- create a datawindow that has everything on it what you want to create

-- then do an "EDIT Source" of that datawindow (right-mouse click on the dw in the library painter).

-- That should give you all the information you need, you don't have to go through all of the attributes with the dw syntax tool.

-- Beware the dw syntax tool is far from complete, many attributes are missing, so best is to edit the source of a datawindow in combination with the use of that tool

 

2 - When I compare the list of attributes from the object_name.attributes to what I have from the datawindow syntax tool, there's a few extras in the attributes list.

-- some might be optional. others aren't 

3 - Is there a more efficient way to get all those attributes apart from getting the datawindow.syntax and parsing the lines with some kind of regular expression (I still want the key:value thing)

-- yes, as answered under 1 -

 

TIPS:

Also beware that if you want to create a column that columns has to be in the "list with colums": 

table(column=(type=char(250) updatewhereclause=yes name=col1 dbname="col1" )
 column=(type=char(250) updatewhereclause=yes name=col2 dbname="col2" )
 column=(type=char(250) updatewhereclause=yes name=col3 dbname="col3" )
etc.

The id that you have to specify for the creation of the column must correspond with the order of appearance in this column list, so for example my "col3" has an id=3

If then later you want to delete that column and use this syntax:

- dw_1.Modify("destroy column col3")

This will ALSO delete the column from the columns list, something you might not want if later you want to be able to re-create the column.

In that case use  - dw_1.Modify("destroy col3")

(without the column in the modify, that way the column will disappear from the front-end of the datawindow, but remain in the column list).

 

HIH,

MiguelL

 

Comment
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.