Discussion Board for collaboration on Qlik NPrinting.
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. By 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 native output format. This could be add as new feature request in the ideation page https://community.qlik.com/t5/Labels-page/bd-p/Category_Labels?categoryId=qlik-ideas&corenode=boards...
What you could try as workaround it 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 contains 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 test but I was not able to fin 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. By 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