cancel
Showing results for 
Search instead for 
Did you mean: 

how to populate sub sub tags into a jrxml reports from xmlDataSourceString

manikanta031
Champ in-the-making
Champ in-the-making

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. 

xmlDataSourceString is :

<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

1 ACCEPTED ANSWER

kaynezhang
World-Class Innovator
World-Class Innovator

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

View answer in original post

5 REPLIES 5

afaust
Legendary Innovator
Legendary Innovator

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?

manikanta031
Champ in-the-making
Champ in-the-making

Thank you Axel, I have updated my question.

kaynezhang
World-Class Innovator
World-Class Innovator

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

Thanks a lot kayne. Your inputs worked for me Smiley Happy "docs/id" is working. Thanq again

kaynezhang
World-Class Innovator
World-Class Innovator

Glad I could help

Getting started

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.