11-25-2016 05:27 AM
HI, I am using this add on https://addons.alfresco.com/addons/generate-reports-jasper-reports to generate reports by giving xmlDataSourceString as input to a jrxml template and generating a PDF/docx as an output file. Now I am able to pupulate the sub tags from the string. But not able to populate sub sub tags in the jrxml file.
<items>
<item>
<name>workflowTitle</name>
<creator>workflowTitle</creator>
<created>workflowTitle</created>
<description>workflowTitle</description>
<docs>
<id>workflowDesc</id>
<id1>workflowDesc</id1>
<id2>workflowDesc</id2>
</docs>
</item>
</items>
I want to populate the report dynamically with sub sub tags of the above xml string.
For example
<field name="description" class="java.lang.String">
<fieldDescription><![CDATA[description]]></fieldDescription>
</field> is populating the value with 'docs' tag.
Now I want to populate similarly with the sub sub tag. I have tried as below. But no luck.
<field name="docs.id1" class="java.lang.String">
<fieldDescription><![CDATA[docs.id1]]></fieldDescription>
</field>
Attached the files jasper.js when triggered will call the jasper.ftl to generate the xmlDataSourceString which in turn passed as input to report_itemsInDataDictionary.jrxml and generates a PDF.
Kindly provide me any inputs
11-25-2016 09:40 AM
I'm not sure whether I understand your question clearly.
It seems your question has nothing to do with alfresco javascrip api or alfresco template api. You have combined javascrip api and template api successfully.All you want to do is to use the xml documents generated as jasperreport data source. all you want to ask is how to select document node set for report field,am I right?
In jasperreport ,An XPath expression is use to select the data source record list. and For every field an XPath expression is used to select the field value for each record from record list.
So I tink you can just try docs/id or absolute XPath expression /itme/docs/id
11-25-2016 05:40 AM
It is unclear to me what kind of functionality or addon you are using. Could you please provide more information so people are aware of the context of your question?
11-25-2016 05:53 AM
Thank you Axel, I have updated my question.
11-25-2016 09:40 AM
I'm not sure whether I understand your question clearly.
It seems your question has nothing to do with alfresco javascrip api or alfresco template api. You have combined javascrip api and template api successfully.All you want to do is to use the xml documents generated as jasperreport data source. all you want to ask is how to select document node set for report field,am I right?
In jasperreport ,An XPath expression is use to select the data source record list. and For every field an XPath expression is used to select the field value for each record from record list.
So I tink you can just try docs/id or absolute XPath expression /itme/docs/id
11-28-2016 04:41 AM
Thanks a lot kayne. Your inputs worked for me
"docs/id" is working. Thanq again
11-28-2016 05:49 AM
Glad I could help
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.