Hi
I'm trying to export an external datawindows in master detail XML.
THE CODE:
for i = 1 to dw_stampa1.rowcount()
| ll_riga = ds_xml.insertrow(0) |
| ds_xml.setitem(ll_riga, 'tkdistpa', 'Distinta XML: ' + string( id_DaDistinta, '0' ) ) | |
| ds_xml.setitem(ll_riga, 'dtdist', datetime(ldt_pfdpre) ) | |
| ds_xml.setitem(ll_riga, 'nrdettagli', string(dw_stampa1.rowcount()) ) | |
| ds_xml.setitem(ll_riga, 'totdistinta', dw_stampa1.getitemnumber(1, 'tot_imp') ) | |
| ds_xml.setitem(ll_riga, 'azienda', left(RAGIONESOCIALE, 70)) | |
| ds_xml.setitem(ll_riga, 'dtvalu', dw_stampa1.getitemdatetime(i, 'dtvalu') ) | |
| ds_xml.setitem(ll_riga, 'Ibanaz', 'cod iban az' ) | |
| ds_xml.setitem(ll_riga, 'abiaz', ls_abi) | |
| ds_xml.setitem(ll_riga, 'importo', dw_stampa1.getitemnumber(i, 'import') ) | |
| ds_xml.setitem(ll_riga, 'desfornitore', left(dw_stampa1.getitemstring(i, 'ragcog'), 35) ) | |
| ds_xml.setitem(ll_riga, 'Ibanfr', 'cod iban fr' ) | |
ds_xml.setitem(ll_riga, 'desc', 'Fattura: ' + trim(dw_stampa1.getitemstring(i, 'nrdocext')) + ' del ' + string(dw_stampa1.getitemdatetime(i, 'dtdocext'), 'DD/MM/YY') + ' Cig/Cup ' + trim(dw_stampa1.getitemstring(i, 'cigcup')) ) |
Next
ds_xml.saveas('c:\temp\xxx.xml', xml!, true)
In dw_stampa_1 i have 2 rows.
i need one header and 2 details like dw_stampa1.
The detail are about the last 4 fields.
The ds_xml ( see attached ) the export give me only 1 detail. Why ?
ty all
G.
Request clarification before answering.
Hi Gimmy;
The DWO is of a Freeform type - thus, no header - no headings. If you change the "dw_distpaga_xml" DWO into a tabular format - the the headings will be produced.
HTH
Regards ... Chris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I need to save the contents of DW in XML format.
Banks, here in Europe, will exchange data in XML format (which contains the structure and data).
Is there something wrong with my reasoning? You can not do with DW?
See attached file ( it is a PDF ) for example at point
4. Examples from internet
4.1 Domestic Payment Estonia, 2 payments:
No, you're doing fine. Just that some of the suggestions you were getting were taking you down the wrong path.
Here's a trivial example of a master detail XML export.
The first thing you have to do is create a nested datawindow. For this example, I created the detail using the EMP table from the EAServer Demo database, taking dept_id as an argument. Note the XML template for the detail info.
Then I created the master using the DEPT table from that same database and included the d_dept datawindow in it as a report, linking them with the dept_id column from the master. Also note the XML template for the master, and how I've defined d_dept (the reference to the nested datawindow) as the start of the detail (the grey bar).
Retrieve the master datawindow (it will retrieve the nested datawindow), export the master, and viola: nested XML.
What you get in the export is all in a single line (no whitespace). I've cleaned it up with NotePad++ so the master/detail shows.
There might be something wrong with the syntax of your datawindow that is causing the painter to choke when saving it. All that happens when you mark an element as starting the detail is that it adds an __pbband=~"detail~" attribute to that element. You can open the datawindow up in source mode and add that manually. It seems to have remained after I did that.
Done!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think the export template doesn't have the any indication of where the break in header and detail is.
Is there a horizontal grey line in the export template the design mode?
Exported dw should have something this: <MyDetail __pbband=~"group~">
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.