![](http://content.invisioncic.com/i328763/set_resources_3/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
jpp74
-
Posts
7 -
Joined
-
Last visited
Content Type
Forum
Downloads
Featured Visualizations
Knowledge Base
Documentation (PDF Downloads)
Blog
Documentation (Test Area)
Documentation
Dr. Jaspersoft Webinar Series
Security Advisories
Events
Profiles
Posts posted by jpp74
-
-
Hi Teodor,
Sorry for the late response (I was on holidays)
I send you the piece of jasper template for the sub report where I try to display the page number in the title section.
Thanks for help.
Jean-Paul
Code: <title> <band height="89" isSplitAllowed="true" > ... <textField isStretchWithOverflow="true" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="43" y="60" width="82" height="25" key="textField-1"/> <box></box> <textElement> <font/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["page" + $P{pageOffset}.toString()]]></textFieldExpression> </textField> </band></title>
-
Thanks for your quickly response Teodord.
For "page x" I added this information in page footer of my master report, it was ok.
In fact I tried to generate a table of content with page number, like in tableofcontents sample.
I also tried to pass PAGE_NUMBER in parameter of a subreport, in the subreport I retrieve the value 1, but this report appear at page 10 in the final report (it is precede by 2 sub reports).
Below a piece of master report template, when I print the parameter pageOffset in the title section of the subreport, the value is 1.
What's wrong, I don't understand.
Thanks for helpCode: <subreport isUsingCache="false"> <reportElement x="0" y="151" width="535" height="71" key="subreport-2" positionType="Float"/> <parametersMapExpression><![CDATA[$P{sousRapportsParamMap}.get("PRES_GENE_INVEST_REPORT")]]></parametersMapExpression> <subreportParameter name="pageOffset"> <subreportParameterExpression><![CDATA[$V{PAGE_NUMBER}]]></subreportParameterExpression> </subreportParameter> <dataSourceExpression><![CDATA[$P{sousRapportsDsMap}.get("PRES_GENE_INVEST_REPORT")]]></dataSourceExpression> <subreportExpression class="net.sf.jasperreports.engine.JasperReport"><![CDATA[$P{sousRapportsMap}.get("PRES_GENE_INVEST_REPORT")]]></subreportExpression></subreport>
-
Hi all
I try to obtain the page number in a subreport, but when I evaluate variable PAGE_NUMBER I obtain the page in the current sub report and not in the global report, is there a solution to obtain the good page number value?
Thanks for help
-
I found my error, it’s a classic error for new user of Jasper, I reused the same datasource in different reports (I defined a static variable for JREmptyDatasource).
-
You can put a List object in your parameter map. Then you have just to declare a parameter like this in your jrxml file:
<parameter name="imageDir" isForPrompting="false" class="java.util.List"/>
To use it in an expression you can write for example:
$P{imageDir}.get(0) -
Hi All,
I have to generate a big pdf document with jasper. I cut the content in subreports.
In my master report, I defined two subreports in detail section: subreport1 and subreport2.
In subreport1 I defined two sub reports: sub1subreport1, sub1subreport2.
In subreport2 I defined two sub reports: sub2subreport1, sub2subreport2.
My problem is that only subreport1 (the first sub report of my master report) is displayed, If I delete the first subreport the second subreport is displayed.
When I use subreports in a main report, I set the positionType of the first report to FixeRelativeToTop and the second one to Float.
I join jrxml files to my post.
Master: M14.jrxml
SubReport1:PresGeneFctChapitre.jrxml
Sub1subReport1: PresGeneBudgetDepFct.jrxml
Sub1subReport2: PresGeneBudgetRecFct.jrxml
SubReport2:PresGeneInvestChapitre.jrxml
Sub2subReport1: PresGeneBudgetDepInvest.jrxml
Sub2subReport2: PresGeneBudgetRecInvest.jrxml
Thanks for help.
Page number in subreport
in Products
Posted
Hi,
I haven't joined all the jrxml files because there is a lot, I have just joined all reports before the report who display PAGE_NUMBER variable.
In my example that I sent to you, to do a test I print the page number in the sub report PresGeneInvestChapitre.jrxml (PRES_GENE_INVEST_REPORT).
In fact I would like to store the page number of chapters in my document, I do this by a call to the scriptlet in sub report PresGeneBudgetDepInvest.jrxml (PRES_GENE_INVEST_DEP_REPORT),
when I test the parameter value receive in "marqueEntree" method, I have the value 1.
Then in the sub report Sommaire.jrxml (SOMMAIRE_REPORT), I would like to retrieve the value stored by scriptlet, to display the page number of the differents chapters.
Below the sub reports tree
M14.jrxml is the master report
VueEnsemble.jrxml (PRES_GENE_VUE_ENS_REPORT sub report)
PresGeneFctChapitre.jrxml (PRES_GENE_FCT_REPORT)
PresGeneBudgetDepFct.jrxml (PRES_GENE_FCT_DEP_REPORT)
PresGeneBalanceRecFct.jrxml (PRES_GENE_FCT_REC_REPORT)
PresGeneInvestChapitre.jrxml (PRES_GENE_INVEST_REPORT)
PresGeneBudgetDepInvest.jrxml (PRES_GENE_INVEST_DEP_REPORT)
PresGeneBudgetRecInvest.jrxml(PRES_GENE_INVEST_REC_REPORT)
....
Sommaire.jrxml (SOMMAIRE_REPORT)
Thanks for help
Jean-Paul