1. kevin kevin rowe
  2. PowerBuilder
  3. Thursday, 10 August 2023 14:19 PM UTC

 

We have a piece of code that exports XML from datawindows to make an extract between our system and another.

This has not been tried in development as it was a link only available in one site's production environment.

Other XML extracts do work on the system. this one produces a blank extract.

The code in the window is as follows

[code]

string ls_xmli

...

// this produces a blank string, when the datawindow has 11 rows in it.

ls_xmli = dw_1.Describe ("DataWindow.Data.XML")

[/code]

 

There is no error message.

We have tried to explicitly set the XML template with modify statements, but this does not help. The modify statements did not return messages. 

 

 

I've included the source of the datawindow below.

 

What could be going on here? 

The online help shows these  suggestions

  • ls_xmlstring = dw1.Object.DataWindow.Data.XML
    ls_xmlstring = dw1.Describe(DataWindow.Data.XML)

The first does not work either, and the second does not compile so i'm assuming it is a typo in the help. 

Any ideas about what might be happening, or how to check for faults in the datawindow design?

Regards,

 

Kevin.

dw source

[code]

$PBExportHeader$xr_s0004_gra.srd
release 17;
datawindow(units=0 timer_interval=0 color=1073741824 brushmode=0 transparency=0 gradient.angle=0 gradient.color=8421504 gradient.focus=0 gradient.repetition.count=0 gradient.repetition.length=100 gradient.repetition.mode=0 gradient.scale=100 gradient.spread=100 gradient.transparency=0 picture.blur=0 picture.clip.bottom=0 picture.clip.left=0 picture.clip.right=0 picture.clip.top=0 picture.mode=0 picture.scale.x=100 picture.scale.y=100 picture.transparency=0 processing=0 HTMLDW=no print.printername="" print.documentname="" print.orientation = 0 print.margin.left = 110 print.margin.right = 110 print.margin.top = 96 print.margin.bottom = 96 print.paper.source = 0 print.paper.size = 0 print.canusedefaultprinter=yes print.prompt=no print.buttons=no print.preview.buttons=no print.cliptext=no print.overrideprintjob=no print.collate=yes print.background=no print.preview.background=no print.preview.outline=yes hidegrayline=no showbackcoloronxp=no picture.file="" )
header(height=572 color="536870912" transparency="0" gradient.color="8421504" gradient.transparency="0" gradient.angle="0" brushmode="0" gradient.repetition.mode="0" gradient.repetition.count="0" gradient.repetition.length="100" gradient.focus="0" gradient.scale="100" gradient.spread="100" )
summary(height=0 color="536870912" transparency="0" gradient.color="8421504" gradient.transparency="0" gradient.angle="0" brushmode="0" gradient.repetition.mode="0" gradient.repetition.count="0" gradient.repetition.length="100" gradient.focus="0" gradient.scale="100" gradient.spread="100" )
footer(height=0 color="536870912" transparency="0" gradient.color="8421504" gradient.transparency="0" gradient.angle="0" brushmode="0" gradient.repetition.mode="0" gradient.repetition.count="0" gradient.repetition.length="100" gradient.focus="0" gradient.scale="100" gradient.spread="100" )
detail(height=84 color="536870912" transparency="0" gradient.color="8421504" gradient.transparency="0" gradient.angle="0" brushmode="0" gradient.repetition.mode="0" gradient.repetition.count="0" gradient.repetition.length="100" gradient.focus="0" gradient.scale="100" gradient.spread="100" )
table(column=(type=char(8190) updatewhereclause=no name=fddummygrp dbname="fddummygrp" )
column=(type=long updatewhereclause=yes name=fdpseluser dbname="tbprodsel.fdpseluser" dbalias=".fdpseluser" )
column=(type=char(10) updatewhereclause=yes name=fdstkid dbname="tbprodsel.fdstkid" dbalias=".fdstkid" )
column=(type=char(1) updatewhereclause=yes name=fdstkitype dbname="tbstockitem.fdstkitype" dbalias=".fdstkitype" )
column=(type=char(50) updatewhereclause=yes name=fdstkidesc dbname="tbstockitem.fdstkidesc" dbalias=".fdstkidesc" )
column=(type=long updatewhereclause=yes name=fdingtype dbname="fdingtype" values="Ingredient 0/Base Mix 1/Product 4/" )
column=(type=decimal(4) updatewhereclause=yes name=fdpseldecfld dbname="tbprodsel.fdpseldecfld" dbalias=".fdpseldecfld" )
column=(type=char(1) updatewhereclause=yes name=fdstkiingtype dbname="tbstockitem.fdstkiingtype" dbalias=".fdstkiingtype" values="Ingredient N/Base Mix B/" )
column=(type=char(8190) updatewhereclause=no name=fdstockunit dbname="fdstockunit" )
column=(type=char(1) updatewhereclause=yes name=fdstkipacktype dbname="tbstockitem.fdstkipacktype" dbalias=".fdstkipacktype" )
column=(type=decimal(6) updatewhereclause=yes name=fdpseldecfld2 dbname="tbprodsel.fdpseldecfld2" dbalias=".fdpseldecfld2" )
column=(type=long updatewhereclause=yes name=fdpselintfld1 dbname="tbprodsel.fdpselintfld1" dbalias=".fdpselintfld1" )
column=(type=date updatewhereclause=yes name=fdpseldate1 dbname="tbprodsel.fdpseldate1" dbalias=".fdpseldate1" )
column=(type=long updatewhereclause=yes name=cf_suppress dbname="cf_suppress" )
column=(type=long updatewhereclause=yes name=fdsyscdefbagwgt dbname="tbsysconfig.fdsyscdefbagwgt" dbalias=".fdsyscdefbagwgt" )
retrieve=" SELECT 'G1' as fddummygrp,
public.tbprodsel.fdpseluser,
public.tbprodsel.fdstkid,
public.tbstockitem.fdstkitype,
public.tbstockitem.fdstkidesc,
case when fdstkiingtype = 'B' then 1 else 0 end as fdingtype,
public.tbprodsel.fdpseldecfld,
public.tbstockitem.fdstkiingtype,
case fdstkipacktype when 'W' then 'kg' when 'L' then 'litre' else 'each' end as fdstockunit,
public.tbstockitem.fdstkipacktype,
public.tbprodsel.fdpseldecfld2,
public.tbprodsel.fdpselintfld1,
public.tbprodsel.fdpseldate1,
0 as cf_suppress,
fdsyscdefbagwgt
FROM public.tbprodsel,
public.tbstockitem,
public.tbsysconfig
WHERE ( public.tbprodsel.fdstkid = public.tbstockitem.fdstkid ) and
( ( public.tbprodsel.fdpseluser = :al_user1 ) AND
( public.tbstockitem.fdstkitype = :as_type1 ) AND
( coalesce (public.tbstockitem.fdstkinottrueingr, 0) = 0 ) AND
( public.tbstockitem.fdstkipacktype <> 'T' ) ) AND
public.tbsysconfig.fdsyscid = 1
UNION
SELECT 'G1' as fddummygrp,
public.tbprodsel.fdpseluser,
public.tbprodsel.fdstkid,
public.tbstockitem.fdstkitype,
public.tbstockitem.fdstkidesc,
1 as fdingtype,
public.tbprodsel.fdpseldecfld,
public.tbstockitem.fdstkiingtype,
case fdstkipacktype when 'W' then 'kg' when 'L' then 'litre' else 'each' end as fdstockunit,
public.tbstockitem.fdstkipacktype,
public.tbprodsel.fdpseldecfld2,
public.tbprodsel.fdpselintfld1,
public.tbprodsel.fdpseldate1,
0 as cf_suppress,
fdsyscdefbagwgt
FROM public.tbprodsel,
public.tbstockitem,
public.tbsysconfig
WHERE ( public.tbprodsel.fdstkid = public.tbstockitem.fdstkid ) and
( ( public.tbprodsel.fdpseluser = :al_user2 ) AND
( public.tbstockitem.fdstkitype = :as_type2 ) ) AND
public.tbsysconfig.fdsyscid = 1" arguments=(("al_user1", number),("as_type1", string),("al_user2", number),("as_type2", string)) sort="fddummygrp A fdingtype A fdstkitype A fdstkid A " )
group(level=1 header.height=0 trailer.height=0 by=("fddummygrp" ) header.color="536870912" header.transparency="0" header.gradient.color="8421504" header.gradient.transparency="0" header.gradient.angle="0" header.brushmode="0" header.gradient.repetition.mode="0" header.gradient.repetition.count="0" header.gradient.repetition.length="100" header.gradient.focus="0" header.gradient.scale="100" header.gradient.spread="100" trailer.color="536870912" trailer.transparency="0" trailer.gradient.color="8421504" trailer.gradient.transparency="0" trailer.gradient.angle="0" trailer.brushmode="0" trailer.gradient.repetition.mode="0" trailer.gradient.repetition.count="0" trailer.gradient.repetition.length="100" trailer.gradient.focus="0" trailer.gradient.scale="100" trailer.gradient.spread="100" )
text(band=header alignment="0" text="Commodity List" border="0" color="33554432" x="50" y="32" height="92" width="663" html.valueishtml="0" name=t_1 visible="1" font.face="Arial" font.height="-14" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" 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" transparency="0" )
compute(band=header alignment="1" expression="'Page ' + page() + ' of ' + pageCount()"border="0" color="33554432" x="2830" y="48" height="64" width="439" format="[general]" html.valueishtml="0" name=page_1 visible="1" font.face="Arial" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" 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" transparency="0" )
text(band=header alignment="1" text="Export Date :" border="0" color="33554432" x="1074" y="48" height="64" width="379" html.valueishtml="0" name=fdphdrdatefm_t visible="1" font.face="Arial" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" 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" transparency="0" )
text(band=header alignment="0" text="" border="0" color="33554432" x="1481" y="48" height="64" width="773" html.valueishtml="0" name=t_date visible="1" font.face="Arial" font.height="-10" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" 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" transparency="0" )
text(band=header alignment="0" text="Code" border="0" color="33554432" x="192" y="460" height="64" width="178" html.valueishtml="0" name=fdstkid_t visible="1" font.face="Arial" font.height="-10" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" 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" transparency="0" )
line(band=header x1="183" y1="544" x2="3054" y2="544" name=l_2 visible="1" pen.style="0" pen.width="5" pen.color="33554432" background.mode="2" background.color="1073741824" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" 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" )
line(band=header x1="183" y1="428" x2="3054" y2="428" name=l_1 visible="1" pen.style="0" pen.width="5" pen.color="33554432" background.mode="2" background.color="1073741824" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" 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" )
text(band=header alignment="1" text="Products Selected By :" border="0" color="33554432" x="1678" y="172" height="64" width="631" html.valueishtml="0" name=t_7 visible="1" font.face="Arial" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" 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" transparency="0" )
text(band=header alignment="0" text="" border="0" color="33554432" x="2331" y="172" height="64" width="859" html.valueishtml="0" name=t_pby visible="1" font.face="Arial" font.height="-10" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" 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" transparency="0" )
text(band=header alignment="1" text="From :" border="0" color="33554432" x="2089" y="252" height="64" width="219" html.valueishtml="0" name=t_8 visible="1" font.face="Arial" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" 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" transparency="0" )
text(band=header alignment="0" text="" border="0" color="33554432" x="2331" y="252" height="64" width="859" html.valueishtml="0" name=t_pfrom visible="1" font.face="Arial" font.height="-10" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" 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" transparency="0" )
text(band=header alignment="1" text="To :" border="0" color="33554432" x="2089" y="324" height="64" width="219" html.valueishtml="0" name=t_9 visible="1" font.face="Arial" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" 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" transparency="0" )
text(band=header alignment="0" text="" border="0" color="33554432" x="2331" y="324" height="64" width="859" html.valueishtml="0" name=t_pto visible="1" font.face="Arial" font.height="-10" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" 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" transparency="0" )
text(band=header alignment="0" text="Name" border="0" color="33554432" x="626" y="460" height="64" width="178" html.valueishtml="0" name=t_2 visible="1" font.face="Arial" font.height="-10" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" 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" transparency="0" )
text(band=header alignment="1" text="Unit Cost" border="0" color="33554432" x="2487" y="460" height="64" width="279" html.valueishtml="0" name=fdpseldecfld_t visible="1" font.face="Arial" font.height="-10" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" 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" transparency="0" )
text(band=header alignment="2" text="Units" border="0" color="33554432" x="2811" y="460" height="64" width="197" html.valueishtml="0" name=fdstockunit_t visible="1" font.face="Arial" font.height="-10" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" 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" transparency="0" )
text(band=header alignment="1" text="Ingredients Selected By :" border="0" color="33554432" x="50" y="172" height="64" width="667" html.valueishtml="0" name=t_4 visible="0" font.face="Arial" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" 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" transparency="0" )
text(band=header alignment="0" text="" border="0" color="33554432" x="741" y="172" height="64" width="859" html.valueishtml="0" name=t_by visible="0" font.face="Arial" font.height="-10" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" 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" transparency="0" )
text(band=header alignment="0" text="" border="0" color="33554432" x="741" y="252" height="64" width="859" html.valueishtml="0" name=t_from visible="0" font.face="Arial" font.height="-10" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" 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" transparency="0" )
text(band=header alignment="1" text="From :" border="0" color="33554432" x="498" y="252" height="64" width="219" html.valueishtml="0" name=t_5 visible="0" font.face="Arial" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" 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" transparency="0" )
text(band=header alignment="1" text="To :" border="0" color="33554432" x="498" y="324" height="64" width="219" html.valueishtml="0" name=t_6 visible="0" font.face="Arial" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" 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" transparency="0" )
text(band=header alignment="0" text="" border="0" color="33554432" x="741" y="324" height="64" width="859" html.valueishtml="0" name=t_to visible="0" font.face="Arial" font.height="-10" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" 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" transparency="0" )
text(band=header alignment="0" text="Type" border="0" color="33554432" x="2025" y="460" height="64" width="178" html.valueishtml="0" name=t_3 visible="0" font.face="Arial" font.height="-10" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" 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" transparency="0" )
column(band=detail id=3 alignment="0" tabsequence=32766 border="0" color="33554432" x="192" y="4" height="76" width="407" format="[general]" html.valueishtml="0" name=fdstkid visible="1" edit.limit=10 edit.case=any edit.autoselect=yes edit.autohscroll=yes font.face="Arial" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" 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" transparency="0" )
column(band=detail id=5 alignment="0" tabsequence=32766 border="0" color="33554432" x="626" y="4" height="76" width="1339" format="[general]" html.valueishtml="0" name=fdstkidesc visible="1" edit.limit=0 edit.case=any edit.focusrectangle=no edit.autoselect=no font.face="Arial" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" 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" transparency="0" )
column(band=detail id=7 alignment="1" tabsequence=32766 border="0" color="33554432" x="2437" y="4" height="76" width="329" format="[general]" html.valueishtml="0" name=fdpseldecfld visible="1" edit.limit=0 edit.case=any edit.autoselect=yes edit.autohscroll=yes font.face="Arial" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" 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" transparency="0" )
column(band=detail id=9 alignment="2" tabsequence=32766 border="0" color="33554432" x="2811" y="4" height="76" width="206" format="[general]" html.valueishtml="0" name=fdstockunit visible="1" edit.limit=0 edit.case=any edit.focusrectangle=no edit.autoselect=no font.face="Arial" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" 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" transparency="0" )
column(band=detail id=6 alignment="0" tabsequence=32766 border="0" color="33554432" x="1998" y="4" height="76" width="411" format="[general]" html.valueishtml="0" name=fdingtype visible="0" edit.limit=0 edit.case=any edit.focusrectangle=no edit.autoselect=no edit.codetable=yes font.face="Arial" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" 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" transparency="0" )
htmltable(border="1" )
htmlgen(clientevents="1" clientvalidation="1" clientcomputedfields="1" clientformatting="0" clientscriptable="0" generatejavascript="1" encodeselflinkargs="1" netscapelayers="0" pagingmethod=0 generatedddwframes="1" )
xhtmlgen() cssgen(sessionspecific="0" )
xmlgen(inline="0" )
xsltgen()
jsgen()
export.xml(usetemplate="t_is2" headgroups="1" includewhitespace="1" metadatatype=0 savemetadata=0 template=(comment="" name="t_is2" xml="<stevens><commodities><commodity __pbband=~"detail~"><code>fdstkid</code><name><![CDATA[~~tfdstkidesc ]]></name><type>fdingtype</type><costPerUnit>fdpseldecfld</costPerUnit><stockUnit>fdstockunit</stockUnit><defaultBagWeight>if (fdsyscdefbagwgt = 1, 0, if( fdingtype = 0 and fdstkipacktype &lt;&gt; &apos;U&apos; , fdpseldecfld2 , 0 ))</defaultBagWeight><bagMode> if( fdingtype = 0 and fdstkipacktype &lt;&gt; &apos;U&apos; , 1, 0 )</bagMode></commodity></commodities></stevens>"))
import.xml()
export.pdf(method=0 distill.custompostscript="0" xslfop.print="0" nativepdf.customsize=0 nativepdf.customorientation=0 nativepdf.pdfstandard=0 nativepdf.useprintspec=no )
export.xhtml()
[/code]

 

 

Miguel Leeuwe Accepted Answer Pending Moderation
  1. Friday, 11 August 2023 21:30 PM UTC
  2. PowerBuilder
  3. # 1

Dear Kevin Kevin,

It would make everone's lives so much easier if you would read the first post on this Q&A: https://community.appeon.com/index.php/qna/q-a/q-a-forum-tip-including-source-code-in-your-question

Please include any code using the "{:} Insert/Edit code sample" from the toolbar when you create / answer a post.

thank you, glad you solved the problem and thanks for sharing!

MiguelL

Comment
There are no comments made yet.
kevin kevin rowe Accepted Answer Pending Moderation
  1. Friday, 11 August 2023 16:10 PM UTC
  2. PowerBuilder
  3. # 2

Hello,

 

I have identified the problem.

 

The Datawindow editor allows you to save a template that does not include an XML definition tag.

 

Some of our datawindows had been stored without this tag in the template as they were only a temporary store and would be spliced into another XML document for output. This worked in PB 2017, but not any more.

 

If the compiler will (especially *silently* ) fail this when it is used, I feel this needs to be addressed by Appeon.

 

For now, the issue is resolved by us correctly formatting the XML for the template.  

 

Thank you for your help Chris.

 

Kevin 

Comment
  1. Chris Pollach @Appeon
  2. Friday, 11 August 2023 18:05 PM UTC
Hi Kevin ... I am super glad that you found the issue! Thanks for the feedback.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 10 August 2023 18:35 PM UTC
  2. PowerBuilder
  3. # 3

Hi Kevin;

  If you can build a simple test case PB App that uses...

ls_xmlstring = dw1.Object.DataWindow.Data.XML // OR
ls_xmlstring = dw1.Describe(DataWindow.Data.XML)

  If these don't not work in the simple test case, please open a Support Ticket.

Regards ... Chris 

Comment
There are no comments made yet.
kevin kevin rowe Accepted Answer Pending Moderation
  1. Thursday, 10 August 2023 18:22 PM UTC
  2. PowerBuilder
  3. # 4

Chris,

 

I suppose they could at a pinch.

We need to merge two data sets in the code and produce one XML stream from it.

 

Here is the code calling the XML export

[code]

string ls_fname, ls_path, ls_xmli, ls_xmlr, ls_xmlp
int li_rtn, li_fnum
long ll_pos1, ll_pos2, ll_len
long ll_xmlr_cnt, ll_xmlp_cnt
long ll_row, ll_fdrcphid, ll_procid
date ld_fdrcphdatefrom, ld_cdate
int li_suppress
string ls_filter, ls_header, ls_foot
decimal lf_yield, lf_targqty, lf_qty
string ls_stkid, ls_stktype, ls_linetype, ls_packtype, ls_qty
long ll_xmlpLen

ls_path = ProfileString (gs_inifile, "Scale Link", &
"LinkPath", GetCurrentDirectory())

if not gb_batchmode then
li_rtn = GetFolder ("Select Folder for RFS Export ", ls_path)
if li_rtn <> 1 then return
end if

ids_2.Object.DataWindow.Export.XML.UseTemplate = "t_is2_s0002"

for ll_row = 1 to ids_1.RowCount()
ls_stkid = ids_1.GetItemString (ll_row, "line_fdstkid")
if Left(ls_stkid, 1) = "." then
ids_1.SetItem (ll_row, "line_fdstkid", ".")
end if
next

// Don't export recs that have the suppress export to stevens checkbox ticked.
//ll_row = dw_1.RowCount( )
for ll_row = 1 to dw_1.RowCount( )
ls_stkid = dw_1.GetItemString (ll_row, "fdstkid")
ls_stktype = dw_1.GetItemString (ll_row, "fdstkitype")
if Left(ls_stkid, 1) = "." then
dw_1.SetItem (ll_row, "fdstkid", ".")
end if
ll_fdrcphid = dw_1.GetItemNumber(ll_row, "fdpselintfld1")
ld_fdrcphdatefrom = dw_1.GetItemDate(ll_row, "fdpseldate1")
if ll_fdrcphid > 0 then
li_suppress = iuo_dbrecipe.of_getStevExpSuppress(ll_fdrcphid, ld_fdrcphdatefrom, 0)
if li_suppress = 1 then
dw_1.SetItem(ll_row, "cf_suppress", li_suppress)
end if
end if
next
ls_filter = "cf_suppress <> 1"
dw_1.SetFilter(ls_filter)
dw_1.Filter()
//ll_row = dw_1.RowCount( )

// Divide Target Quantity by Yield
for ll_row = 1 to ids_2.RowCount()
ls_packtype = ids_2.GetItemString (ll_row, "fdrcplpacktype")
ls_stkid = ids_2.GetItemString (ll_row, "header_fdstkid")
ls_stktype = ids_2.GetItemString (ll_row, "header_fdstkitype")
ll_procid = iuo_dbrecipe.of_findRecipe (ls_stkid, ls_stktype, ref ld_cdate)
lf_yield = iuo_dbrecipe.of_getProcessYield (ll_procid, ld_cdate)
if isNull (lf_yield) or lf_yield = 0 then lf_yield = 1
lf_targqty = ids_2.GetItemDecimal (ll_row, "fdtargqty")

if ls_packtype <> "T" then
lf_qty = Round (lf_targqty / lf_yield, 4)
else
lf_qty = Round (lf_targqty, 4)
end if

ids_2.SetItem (ll_row, "cf_targqty", string(lf_qty))
next

// Get the 3 datawindows xml
ls_xmli = dw_1.Describe ("DataWindow.Data.XML")                <--- *** does not work in PB2022 *** 

// trim off the unwanted start and ends
ll_pos1 = Pos (ls_xmli, "<stevens>")
if ll_pos1 <= 0 then return
ll_pos2 = Pos (ls_xmli, "</stevens>")
ll_pos1 += 10
ll_len = ll_pos2 - ll_pos1 - 1
ls_xmli = Mid(ls_xmli, ll_pos1, ll_len)

if ids_1.RowCount() > 0 then
ls_xmlr = ids_1.Describe ("DataWindow.Data.XML")
ll_pos1 = Pos (ls_xmlr, "<stevens>")
ll_pos2 = Pos (ls_xmlr, "</stevens>")
ll_pos1 += 10
ll_len = ll_pos2 - ll_pos1
ls_xmlr = Mid(ls_xmlr, ll_pos1, ll_len)
// Remove empty <productionLocationCode/> tags
ls_xmlr = f_Replace(ls_xmlr, "<productionLocationCode/>", "")
else
ls_xmlr = ""
end if

if ids_2.RowCount() > 0 then
ls_xmlp = ids_2.Describe ("DataWindow.Data.XML")
ll_pos1 = Pos (ls_xmlp, "<stevens>")
ll_pos2 = Pos (ls_xmlp, "</stevens>")
ll_pos1 += 10
ll_len = ll_pos2 - ll_pos1
ls_xmlp = Mid(ls_xmlp, ll_pos1, ll_len)
if ls_xmlr <> "" then
ll_pos1 = Pos (ls_xmlr, "</recipes>")
ls_xmlr = Mid(ls_xmlr, 1, ll_pos1 - 1)
ls_xmlr = RightTrim (ls_xmlr, true)
ll_pos1 = Pos (ls_xmlp, "<recipes>")
ls_xmlp = Mid(ls_xmlp, ll_pos1 + 9)
end if
// Remove empty <productionLocationCode/> tags
ls_xmlp = f_Replace(ls_xmlp, "<productionLocationCode/>", "")
else
ls_xmlp = ""
end if

ls_header = "<?xml version=~"1.0~" encoding=~"UTF-8~"?>~r~n"
ls_header += "<stevens>"
ls_foot = "</stevens>~r~n"

ls_fname = "rfsimport" + &
String(Today(), "yyyymmdd") + &
String(Now(), "hhmmss") + ".xml"
ls_fname = ls_path + "/" + ls_fname

li_fnum = FileOpen (ls_fname, TextMode!, Write!, &
LockReadWrite!, Replace!, EncodingUTF8!)
if li_fnum > 0 then
li_rtn = FileWriteEx (li_fnum, ls_header)
li_rtn = FileWriteEx (li_fnum, ls_xmli)
// li_rtn = FileWriteEx (li_fnum, "~t")
if ls_xmlr <> "" then li_rtn = FileWriteEx (li_fnum, ls_xmlr)
// if ib_prodreq then
// li_rtn = FileWriteEx (li_fnum, "~t")
if ls_xmlp <> "" then li_rtn = FileWriteEx (li_fnum, ls_xmlp)
// end if
li_rtn = FileWriteEx (li_fnum, ls_foot)

li_rtn = FileClose (li_fnum)
if not gb_batchmode then
MessageBox (is_pickdesc, "Export Complete!")
end if
else
if gb_batchmode then
ii_success = 2
f_batchLogEntry ("Could not open file.", is_pickdesc)
else
MessageBox (is_pickdesc, &
f_getCustomError (900, ls_fname, ""), &
Exclamation!)
end if
end if

[/code]

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 10 August 2023 17:19 PM UTC
  2. PowerBuilder
  3. # 5

Hi Kevin;

  Why not just use the SaveAs() method? For example...

<DC/DS>.SaveAs("C:\TEMP\Temp.xml", Xml!, true)

Regards ... Chris 

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.