PDA

View Full Version : Page Break Problem



Anonymous
09-10-2002, 01:56 AM
Hi,
I have used two groups in my XML file for jfreeReport (Version 0.7.5b) but I dosn;t works properly and both of the groups are shown in the same page here is the XML code:

<groups>

<group name="Group1">

<fields>
<field>FIELD1</field>
</fields>

<groupheader height="30" fontname="SansSerif" fontstyle="bold" fontsize="14" pagebreak="true">

<rectangle name="rect2" x="0" y="0" width="100%" height="100%" color="#CCCCFF" weight="0"/>

<line name="line4" x1="0" y1="0" x2="0" y2="0" weight="0.5"/>

<line name="line5" x1="0" y1="30" x2="0" y2="30" weight="0.5"/>
<string-field name="sf1" x="160" y="5" width="76" height="10" alignment="center" fieldname="FIELD1"/>
<label x="258" y="5" width="76" height="9" alignment="left">-</label>
<string-field name="sf1" x="260" y="5" width="76" height="10" alignment="center" fieldname="FIELD1"/>


</groupheader>

<groupfooter height="30" fontname="SansSerif" fontstyle="bold" fontsize="11">


</groupfooter>

</group>




<group name="Group2">
<groupheader height="30" fontname="SansSerif" fontstyle="bold" fontsize="14" pagebreak="true">
<label x="0" y="100" width="70" height="12" alignment="left">My Label 1:</label>
<string-field name="PERFORMANCE_INDICATOR" x="250" y="100" width="76" height="10" alignment="left" fieldname="FIELD2"/>
</groupheader>

<fields>
<field>FIELD2</field>
</fields>

<groupfooter height="30" fontname="SansSerif" fontstyle="bold" fontsize="11">


</groupfooter>

</group>


</groups>


Thanks in advance,
Payam

Anonymous
09-10-2002, 02:45 AM
If I recall correctly, in the subgroup you need to list the fields from the parent group:

<fields>
<field>FIELD1</field>
<field>FIELD2</field>
</fields>

Regards,

DG.

Anonymous
09-10-2002, 01:42 PM
Hi Payam,

yes, you discovered a bug:
In ReportState.java in the inner class PreGroupHeader, the function advance is wrong, it ignores the pagebreak property if the group is printed on the first line. I'm working on that ...

David, and you are right too, the correct group definition will require this declaration for the second group. In some cases Payam's declaration could also work, but it depends on luck (and the fieldnames declared in the group, but mostly luck) ...

So Payam, this is one thing that you should correct. It will not fix your current problem, but may prevent the occurence of other problems. And for the PageBreak problem: I'm working on that ...

Have more fun,
said Thomas

Anonymous
09-11-2002, 10:33 AM
Hi,

the bug is now fixed in the CVS.

Have more fun,
said Thomas

Anonymous
09-12-2002, 01:32 AM
Thanks for yor reply and help,
I downloaded the new version but when I try to use it , the report show nothing (I'm working in XP Env. with j2sdkee1.3.1).
Any Idea?

Thanks again,
Payam

Anonymous
09-13-2002, 06:19 AM
Hi,

any exceptions? Try start the programm from the command line, and have a look at the report-tag itself. Are the width and the height attributes valid? Previous versions ignored these, but now they are parsed and a PageFormat is formed using these values. And if they are too small, you'll get a ReportProcessingException ("Report does not advance").

You can define the paper by defining a valid width and height or by using a prefedined paper name (as defined in the DTD). The papers borders can be defined using the *margin attributes defining the size in points (and assuming 72 points per inch).

Example:
<report name="..." pageformat="A4" topmargin="70" leftmargin="70" bottommargin="70" rightmargin="70">

Have more fun,
said Thomas