Question
How to export to excel with multiple tabs from different pagelists dynamically
Hi,
I have to export data in multiple tabs from pagelists dynamically. I was trying to follow below solution:https://mesh.pega.com/docs/DOC-89784
But It is giving error like problems during loading: Workbook settings.
Please find my below auto generated XML mapping.
please see attachment1
auto generated XML of the above XML:
<ns1:Workbook xmlns:ns1="urn:schemas-microsoft-com:office:spreadsheet">
<pega:withPage name="ExportToExcelPage.NodeNames"><ns1:WorkSheet Name="<pega:reference name=".pyNodeName" mode="normal"/>">
<ns1:Table>
<pega:withPage name="ExportToExcelPage.NodeNames.ApplicationNames.AgentList"><ns1:Row>
<pega:when java="<%= tools.findPage("ExportToExcelPage.NodeNames.ApplicationNames.AgentList") != null %>"><pega:withPage name="ExportToExcelPage.NodeNames.ApplicationNames.AgentList"><ns1:Cell>
<ns1:Data><pega:reference name=".LastExceptionData" mode="normal"/></ns1:Data>
</ns1:Cell></pega:withPage></pega:when>
</ns1:Row></pega:withPage>
</ns1:Table>
</ns1:WorkSheet></pega:withPage>
</ns1:Workbook>
As per the article, I have included above XML in another customised XML like below.
Please see attachment2.
Lastly I have done Property-set-XML and calling ExportToExcel activity.
Where is the problem? Please reply also if we have any other way to do this.
Thanks,
Kousik
Hi Md,
I saved your XML output you provided to a file 'test.xml' and added in the following header (to make it double-clickable in Windows):
And then double-clicked to open in Excel; I also receive the error you reported:
So, I navigated to the path above and opened up the 'xxxx.log' (the number changes each time you open a file), and see this error:
The 'undefined namespace' indicated can be found in your original document; in the line below the 'Workbook' line (note: the namespace prefix in your original document 'ns1' has apparently been substituted for 'ss' by Excel).
This is the offending line:
Your XML document doesn't associate the prefix 'pega' with any namespace; hence the XML parser error.
However: I think this is probably a side-effect of another issue: it seems that the <pega:withPage> element should have been picked up and re-written by the server (that is: you are attempting to use server-side Pega 'JSP TAGS' here).
Before you launch this 'raw' XML in EXCEL, you will need to make sure you first render the 'pega' tags.
Did you miss out the 'Property-Set-XML' in your Activity by any chance ?
Thanks,
John