Qlik Community

Qlik NPrinting Discussions

Discussion Board for collaboration on Qlik NPrinting.

cancel
Showing results for 
Search instead for 
Did you mean: 
Marijn
Contributor III
Contributor III

Creating XML with 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

Labels (2)
1 Solution

Accepted Solutions
Marijn
Contributor III
Contributor III
Author

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)

View solution in original post

7 Replies
Frank_S
Support
Support

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

 

We are just 'like' you and like to be liked when providing a helpful answer. You may also press the 'Solution Accepted' button if an answer provided resolves your question or issue... Cheers!
Marijn
Contributor III
Contributor III
Author

Hi @Frank_S ,

Thanks for your reply, I'll try to find another solution then.

Kind regards,

Marijn

Ruggero_Piccoli
Support
Support

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



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
Frank_S
Support
Support

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

We are just 'like' you and like to be liked when providing a helpful answer. You may also press the 'Solution Accepted' button if an answer provided resolves your question or issue... Cheers!
Marijn
Contributor III
Contributor III
Author

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)

Frank_S
Support
Support

Thank you for sharing your solution!

We are just 'like' you and like to be liked when providing a helpful answer. You may also press the 'Solution Accepted' button if an answer provided resolves your question or issue... Cheers!
Ruggero_Piccoli
Support
Support

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



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.