Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I wonder whether it's possible to create an XML file from NPrinting. A client expects us to deliver data in an XML, so we made a pivot table with a single cell that has the whole XML text in it. Now I'd like to export this into an XML file, but I see that there's no option to export an XML in NPrinting. Does anyone have an idea for an approach?
Thanks in advance!
Marijn
Hi @Frank_S and @Ruggero_Piccoli
We've solved it by creating a single set expression that concatenates all values with the XML format. In this way, there is one field that contains the entire string that needs to become the XML file. I export this as a CSV, then use a .bat file with the command line to convert the file into an XML. The set expression looks something like this:
=chr(10)&
'xmlstatement'&chr(10)&
'<XMLfile>'&chr(10)&
concat(distinct {$<Flag={'xxx'}>}
'<A>' & chr(10)&
' <A1>' & FIELD1 & ' </A1>' & chr(10)&
' <A2>' & FIELD2 & '</A2>' & chr(10) &
' <A3>' & FIELD3 & '</A3>' & chr(10) &
'</A>' & chr(10)
)&
'</XMLfile>' & chr(10)
HI @Marijn
Unfortunately, there is no XML output format available.
Below you will find a list of available formats to export your table information.
Kind regards...
Hi,
As per @Frank_S 's answer, none of the available types of templates has .xml as a native output format. This could be added as a new feature request on the ideation page Suggest an Idea!
What you could try as a workaround is to create an HTML template, remove all pre-filled HTML code and insert one, or more, Qlik variables created in QlikView or in Qlik Sense that contain the XML code you need. The output will always be a .zip file with the HTML inside so you have to manage the unzip and file extension change outside Qlik NPrinting. I understand that it is not a good and linear solution, I did some tests but I was not able to find a better workaround.
Best Regards,
Ruggero
Hi @Marijn
If you use the csv export in the entity report/publish task, you can use an external source such as the link below to convert the csv output to xml. (use this external link at your discretion.)
https://www.zamzar.com/convert/csv-to-xml/
Otherwise you may consider as Ruggero suggested to insert an 'idea' on our feature request site at the link he shared.
Kind regards..
Hi @Frank_S and @Ruggero_Piccoli
We've solved it by creating a single set expression that concatenates all values with the XML format. In this way, there is one field that contains the entire string that needs to become the XML file. I export this as a CSV, then use a .bat file with the command line to convert the file into an XML. The set expression looks something like this:
=chr(10)&
'xmlstatement'&chr(10)&
'<XMLfile>'&chr(10)&
concat(distinct {$<Flag={'xxx'}>}
'<A>' & chr(10)&
' <A1>' & FIELD1 & ' </A1>' & chr(10)&
' <A2>' & FIELD2 & '</A2>' & chr(10) &
' <A3>' & FIELD3 & '</A3>' & chr(10) &
'</A>' & chr(10)
)&
'</XMLfile>' & chr(10)
Thank you for sharing your solution!
Hi @Marijn ,
Thanks a lot for sharing the solution: it can be useful for other readers.
I have not tested but, maybe, you can do something similar by creating an html template and starting by removing the pre-filled html tags. Then use a .bat to change the generated files extension.
Best Regards,
Ruggero