|
Re: reset pagenumber on group without interval [message #557038 is a reply to message #556936] |
Fri, 03 September 2010 17:00 |
|
Have you tried using page scripts?
Take a look at the following example in BIRT 2.6.
Jason
<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.21"
id="1">
<property name="createdBy">Eclipse BIRT Designer Version
2.6.0.v20100531 Build <2.6.0.v20100609-1613></property>
<property name="units">in</property>
<method name="beforeFactory"><![CDATA[prevGroupKey = "";
groupPageNumber = 1;
reportContext.setGlobalVariable("gGROUP_NAME", "");
reportContext.setGlobalVariable("gGROUP_PAGE", 1);
]]></method>
<method name="onPageEnd"><![CDATA[ //var groups =
this.getInstancesByElementName("GROUP_STATUS");
var groups = this.getInstancesByElementId(73);
var group;
if( groups != null ){
group = groups[0];
var groupKey = group.value;
//var prevGroupKey = reportContext.getPageVariable("GROUP_NAME");
//var groupPageNumber = reportContext.getPageVariable("GROUP_PAGE");
var prevGroupKey = reportContext.getGlobalVariable("gGROUP_NAME");
var groupPageNumber = reportContext.getGlobalVariable("gGROUP_PAGE");
if( prevGroupKey == null ){
prevGroupKey = "";
}
//prevGroupKey = reportContext.getPageVariable("GROUP_NAME");
//groupPageNumber = reportContext.getPageVariable("GROUP_PAGE");
if (prevGroupKey == groupKey)
{
if (groupPageNumber != null)
{
groupPageNumber = parseInt(groupPageNumber) + 1;
}
else {
groupPageNumber = 1;
}
}
else {
groupPageNumber = 1;
prevGroupKey = groupKey;
}
reportContext.setPageVariable("GROUP_NAME", groupKey);
reportContext.setPageVariable("GROUP_PAGE", groupPageNumber);
reportContext.setGlobalVariable("gGROUP_NAME", groupKey);
reportContext.setGlobalVariable("gGROUP_PAGE", groupPageNumber);
var groupTotalPage = reportContext.getPageVariable("GROUP_TOTAL_PAGE");
if (groupTotalPage == null)
{
groupTotalPage = new java.util.HashMap();
reportContext.setPageVariable("GROUP_TOTAL_PAGE", groupTotalPage);
}
groupTotalPage.put(groupKey, groupPageNumber);
} ]]></method>
<property name="iconFile">/templates/blank_report.gif</property>
<property name="layoutPreference">fixed layout</property>
<property name="bidiLayoutOrientation">ltr</property>
<data-sources>
<oda-data-source
extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source"
id="7">
<property
name="odaDriverClass">org.eclipse.birt.report.data.oda.sampledb.Driver </property>
<property name="odaURL">jdbc:classicmodels:sampledb</property>
<property name="odaUser">ClassicModels</property>
</oda-data-source>
</data-sources>
<data-sets>
<oda-data-set
extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
name="Data Set" id="9">
<list-property name="columnHints">
<structure>
<property name="columnName">ORDERNUMBER</property>
<text-property
name="displayName">ORDERNUMBER</text-property>
</structure>
<structure>
<property name="columnName">ORDERDATE</property>
<text-property
name="displayName">ORDERDATE</text-property>
</structure>
<structure>
<property name="columnName">REQUIREDDATE</property>
<text-property
name="displayName">REQUIREDDATE</text-property>
</structure>
<structure>
<property name="columnName">SHIPPEDDATE</property>
<text-property
name="displayName">SHIPPEDDATE</text-property>
</structure>
<structure>
<property name="columnName">STATUS</property>
<text-property
name="displayName">STATUS</text-property>
</structure>
<structure>
<property name="columnName">COMMENTS</property>
<text-property
name="displayName">COMMENTS</text-property>
</structure>
<structure>
<property name="columnName">CUSTOMERNUMBER</property>
<text-property
name="displayName">CUSTOMERNUMBER</text-property>
</structure>
</list-property>
<structure name="cachedMetaData">
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">ORDERNUMBER</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">ORDERDATE</property>
<property name="dataType">date</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">REQUIREDDATE</property>
<property name="dataType">date</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">SHIPPEDDATE</property>
<property name="dataType">date</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">STATUS</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">6</property>
<property name="name">COMMENTS</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">7</property>
<property name="name">CUSTOMERNUMBER</property>
<property name="dataType">integer</property>
</structure>
</list-property>
</structure>
<property name="dataSource">Data Source</property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">ORDERNUMBER</property>
<property name="nativeName">ORDERNUMBER</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">ORDERDATE</property>
<property name="nativeName">ORDERDATE</property>
<property name="dataType">date</property>
<property name="nativeDataType">91</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">REQUIREDDATE</property>
<property name="nativeName">REQUIREDDATE</property>
<property name="dataType">date</property>
<property name="nativeDataType">91</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">SHIPPEDDATE</property>
<property name="nativeName">SHIPPEDDATE</property>
<property name="dataType">date</property>
<property name="nativeDataType">91</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">STATUS</property>
<property name="nativeName">STATUS</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">6</property>
<property name="name">COMMENTS</property>
<property name="nativeName">COMMENTS</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">7</property>
<property name="name">CUSTOMERNUMBER</property>
<property name="nativeName">CUSTOMERNUMBER</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
</list-property>
<xml-property name="queryText"><![CDATA[select *
from CLASSICMODELS.ORDERS]]></xml-property>
<xml-property name="designerValues"><![CDATA[<?xml
version="1.0" encoding="UTF-8"?>
<model:DesignValues
xmlns:design="http://www.eclipse.org/datatools/connectivity/oda/design"
xmlns:model="http://www.eclipse.org/birt/report/model/adapter/odaModel">
<Version>1.0</Version>
<design:ResultSets derivedMetaData="true">
<design:resultSetDefinitions>
<design:resultSetColumns>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>ORDERNUMBER</design:name>
<design:position>1</design:position>
<design:nativeDataTypeCode>4</design:nativeDataTypeCode>
<design:precision>10</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>ORDERNUMBER</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>ORDERNUMBER</design:label>
<design:formattingHints>
<design:displaySize>11</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>ORDERDATE</design:name>
<design:position>2</design:position>
<design:nativeDataTypeCode>91</design:nativeDataTypeCode>
<design:precision>10</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>ORDERDATE</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>ORDERDATE</design:label>
<design:formattingHints>
<design:displaySize>10</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>REQUIREDDATE</design:name>
<design:position>3</design:position>
<design:nativeDataTypeCode>91</design:nativeDataTypeCode>
<design:precision>10</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>REQUIREDDATE</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>REQUIREDDATE</design:label>
<design:formattingHints>
<design:displaySize>10</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>SHIPPEDDATE</design:name>
<design:position>4</design:position>
<design:nativeDataTypeCode>91</design:nativeDataTypeCode>
<design:precision>10</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>SHIPPEDDATE</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>SHIPPEDDATE</design:label>
<design:formattingHints>
<design:displaySize>10</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>STATUS</design:name>
<design:position>5</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>15</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>STATUS</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>STATUS</design:label>
<design:formattingHints>
<design:displaySize>15</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>COMMENTS</design:name>
<design:position>6</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>32700</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>COMMENTS</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>COMMENTS</design:label>
<design:formattingHints>
<design:displaySize>32700</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>CUSTOMERNUMBER</design:name>
<design:position>7</design:position>
<design:nativeDataTypeCode>4</design:nativeDataTypeCode>
<design:precision>10</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>CUSTOMERNUMBER</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>CUSTOMERNUMBER</design:label>
<design:formattingHints>
<design:displaySize>11</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
</design:resultSetColumns>
</design:resultSetDefinitions>
</design:ResultSets>
</model:DesignValues>]]></xml-property>
</oda-data-set>
</data-sets>
<styles>
<style name="report" id="4">
<property name="fontFamily">"Verdana"</property>
<property name="fontSize">10pt</property>
</style>
<style name="crosstab-cell" id="5">
<property name="borderBottomColor">#CCCCCC</property>
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">1pt</property>
<property name="borderLeftColor">#CCCCCC</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">1pt</property>
<property name="borderRightColor">#CCCCCC</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">1pt</property>
<property name="borderTopColor">#CCCCCC</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">1pt</property>
</style>
<style name="crosstab" id="6">
<property name="borderBottomColor">#CCCCCC</property>
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">1pt</property>
<property name="borderLeftColor">#CCCCCC</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">1pt</property>
<property name="borderRightColor">#CCCCCC</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">1pt</property>
<property name="borderTopColor">#CCCCCC</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">1pt</property>
</style>
<style name="table-header" id="97">
<property name="backgroundColor">#6078BF</property>
<property name="fontFamily">"Arial"</property>
<property name="fontSize">small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFFF</property>
<property name="paddingTop">0px</property>
<property name="paddingLeft">0px</property>
<property name="paddingBottom">0px</property>
<property name="paddingRight">0px</property>
</style>
<style name="table-footer" id="98">
<property name="backgroundColor">#6078BF</property>
<property name="fontFamily">"Arial"</property>
<property name="fontSize">small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFFF</property>
<property name="paddingTop">0px</property>
<property name="paddingLeft">0px</property>
<property name="paddingBottom">0px</property>
<property name="paddingRight">0px</property>
</style>
<style name="table-detail" id="99">
<property name="backgroundColor">#E6ECFF</property>
<property name="fontFamily">"Arial"</property>
<property name="fontSize">x-small</property>
<property name="fontWeight">bold</property>
<property name="color">#000080</property>
<property name="paddingTop">0px</property>
<property name="paddingLeft">0px</property>
<property name="paddingBottom">0px</property>
<property name="paddingRight">0px</property>
</style>
<style name="table-group-header-1" id="100">
<property name="backgroundColor">#809FFF</property>
<property name="fontFamily">"Arial"</property>
<property name="fontSize">small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFFF</property>
<property name="paddingTop">0px</property>
<property name="paddingLeft">0px</property>
<property name="paddingBottom">0px</property>
<property name="paddingRight">0px</property>
</style>
<style name="table-group-footer-1" id="101">
<property name="backgroundColor">#809FFF</property>
<property name="fontFamily">"Arial"</property>
<property name="fontSize">small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFFF</property>
<property name="paddingTop">0px</property>
<property name="paddingLeft">0px</property>
<property name="paddingBottom">0px</property>
<property name="paddingRight">0px</property>
</style>
<style name="special-header" id="102">
<property name="backgroundColor">#6078BF</property>
<property name="fontFamily">"Arial"</property>
<property name="fontSize">medium</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFFF</property>
<property name="paddingTop">0px</property>
<property name="paddingLeft">0px</property>
<property name="paddingBottom">0px</property>
<property name="paddingRight">0px</property>
</style>
<style name="crosstab-detail" id="103">
<property name="backgroundColor">#E6ECFF</property>
<property name="fontFamily">"Arial"</property>
<property name="fontSize">x-small</property>
<property name="fontWeight">bold</property>
<property name="color">#000080</property>
<property name="paddingTop">0px</property>
<property name="paddingLeft">0px</property>
<property name="paddingBottom">0px</property>
<property name="paddingRight">0px</property>
</style>
<style name="crosstab-header" id="104">
<property name="backgroundColor">#6078BF</property>
<property name="fontFamily">"Arial"</property>
<property name="fontSize">small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFFF</property>
<property name="paddingTop">0px</property>
<property name="paddingLeft">0px</property>
<property name="paddingBottom">0px</property>
<property name="paddingRight">0px</property>
</style>
<style name="mydata" id="105">
<property name="color">orange</property>
</style>
</styles>
<page-setup>
<simple-master-page name="Simple MasterPage" id="2">
<page-header>
<grid id="74">
<column id="75"/>
<column id="76"/>
<row id="78">
<property name="style">special-header</property>
<cell id="79">
<auto-text id="83">
<property
name="textUnderline">underline</property>
<property
name="type">page-variable</property>
<property
name="pageVariable">GROUP_NAME</property>
</auto-text>
</cell>
<cell id="80">
<grid id="88">
<property name="width">2.125in</property>
<column id="89">
<property
name="width">0.25in</property>
</column>
<column id="95">
<property name="width">0.1in</property>
</column>
<column id="90">
<property
name="width">0.25in</property>
</column>
<row id="91">
<cell id="92">
<auto-text id="84">
<property
name="textUnderline">none</property>
<property
name="type">page-variable</property>
<property
name="pageVariable">GROUP_PAGE</property>
</auto-text>
</cell>
<cell id="94">
<label id="96">
<text-property name="text">
of</text-property>
</label>
</cell>
<cell id="93">
<auto-text id="87">
<method
name="onRender"><![CDATA[
var totalPage = reportContext.getPageVariable("GROUP_TOTAL_PAGE");
var groupName = reportContext.getPageVariable("GROUP_NAME");
if (totalPage != null)
{
this.text = java.lang.Integer.toString(totalPage.get(groupName));
}
]]></method>
<property
name="type">page-variable</property>
<property
name="pageVariable">GROUP_TOTAL_PAGE</property>
</auto-text>
</cell>
</row>
</grid>
</cell>
</row>
</grid>
</page-header>
<page-footer>
<text id="3">
<property name="contentType">html</property>
<text-property
name="content"><![CDATA[<value-of>new Date()</value-of>]]></text-property>
</text>
</page-footer>
</simple-master-page>
</page-setup>
<body>
<table id="10">
<property name="masterPage">Simple MasterPage</property>
<property name="dataSet">Data Set</property>
<list-property name="boundDataColumns">
<structure>
<property name="name">ORDERNUMBER</property>
<text-property
name="displayName">ORDERNUMBER</text-property>
<expression
name="expression">dataSetRow["ORDERNUMBER"]</expression >
<property name="dataType">integer</property>
</structure>
<structure>
<property name="name">ORDERDATE</property>
<text-property
name="displayName">ORDERDATE</text-property>
<expression
name="expression">dataSetRow["ORDERDATE"]</expression>
<property name="dataType">date</property>
</structure>
<structure>
<property name="name">REQUIREDDATE</property>
<text-property
name="displayName">REQUIREDDATE</text-property>
<expression
name="expression">dataSetRow["REQUIREDDATE"]</expression >
<property name="dataType">date</property>
</structure>
<structure>
<property name="name">SHIPPEDDATE</property>
<text-property
name="displayName">SHIPPEDDATE</text-property>
<expression
name="expression">dataSetRow["SHIPPEDDATE"]</expression >
<property name="dataType">date</property>
</structure>
<structure>
<property name="name">STATUS</property>
<text-property
name="displayName">STATUS</text-property>
<expression
name="expression">dataSetRow["STATUS"]</expression>
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">COMMENTS</property>
<text-property
name="displayName">COMMENTS</text-property>
<expression
name="expression">dataSetRow["COMMENTS"]</expression>
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">CUSTOMERNUMBER</property>
<text-property
name="displayName">CUSTOMERNUMBER</text-property>
<expression
name="expression">dataSetRow["CUSTOMERNUMBER"]</expression >
<property name="dataType">integer</property>
</structure>
</list-property>
<property name="pageBreakInterval">0</property>
<column id="49"/>
<column id="50"/>
<column id="51"/>
<column id="52"/>
<column id="53"/>
<column id="54"/>
<column id="55"/>
<header>
<row id="11">
<cell id="12">
<label id="13">
<text-property
name="text">ORDERNUMBER</text-property>
</label>
</cell>
<cell id="14">
<label id="15">
<text-property
name="text">ORDERDATE</text-property>
</label>
</cell>
<cell id="16">
<label id="17">
<text-property
name="text">REQUIREDDATE</text-property>
</label>
</cell>
<cell id="18">
<label id="19">
<text-property
name="text">SHIPPEDDATE</text-property>
</label>
</cell>
<cell id="20">
<label id="21">
<text-property
name="text">STATUS</text-property>
</label>
</cell>
<cell id="22">
<label id="23">
<text-property
name="text">COMMENTS</text-property>
</label>
</cell>
<cell id="24">
<label id="25">
<text-property
name="text">CUSTOMERNUMBER</text-property>
</label>
</cell>
</row>
</header>
<group id="56">
<property name="groupName">STATUS</property>
<property name="interval">none</property>
<property name="sortDirection">asc</property>
<expression name="keyExpr"
type="javascript">row["STATUS"]</expression>
<structure name="toc">
<expression name="expressionValue"
type="javascript">row["STATUS"]</expression>
</structure>
<property name="repeatHeader">true</property>
<property name="hideDetail">false</property>
<property name="pageBreakAfter">auto</property>
<property
name="pageBreakBefore">always-excluding-first</property>
<property name="pageBreakInside">auto</property>
<header>
<row id="57">
<cell id="58">
<data name="GROUP_STATUS" id="73">
<property
name="resultSetColumn">STATUS</property>
</data>
</cell>
<cell id="59">
<text id="106">
<property
name="contentType">html</property>
<text-property
name="content"><![CDATA[<viewtime-value-of>
vars["GROUP_PAGE"]
</viewtime-value-of>
]]></text-property>
</text>
</cell>
<cell id="60"/>
<cell id="61"/>
<cell id="62"/>
<cell id="63"/>
<cell id="64"/>
</row>
</header>
<footer>
<row id="65">
<cell id="66"/>
<cell id="67"/>
<cell id="68"/>
<cell id="69"/>
<cell id="70"/>
<cell id="71"/>
<cell id="72"/>
</row>
</footer>
</group>
<detail>
<row id="26">
<cell id="27">
<data id="28">
<property
name="resultSetColumn">ORDERNUMBER</property>
</data>
</cell>
<cell id="29">
<data id="30">
<property
name="resultSetColumn">ORDERDATE</property>
</data>
</cell>
<cell id="31">
<data id="32">
<property
name="resultSetColumn">REQUIREDDATE</property>
</data>
</cell>
<cell id="33">
<data id="34">
<property
name="resultSetColumn">SHIPPEDDATE</property>
</data>
</cell>
<cell id="35">
<data id="36">
<property
name="resultSetColumn">STATUS</property>
</data>
</cell>
<cell id="37">
<data id="38">
<property
name="resultSetColumn">COMMENTS</property>
</data>
</cell>
<cell id="39">
<data id="40">
<property
name="resultSetColumn">CUSTOMERNUMBER</property>
</data>
</cell>
</row>
</detail>
<footer>
<row id="41">
<cell id="42"/>
<cell id="43"/>
<cell id="44"/>
<cell id="45"/>
<cell id="46"/>
<cell id="47"/>
<cell id="48"/>
</row>
</footer>
</table>
</body>
<property name="pageVariables">
<variable-element name="GROUP_NAME">
<property name="type">page</property>
</variable-element>
<variable-element name="GROUP_PAGE">
<property name="type">page</property>
</variable-element>
<variable-element name="GROUP_TOTAL_PAGE">
<property name="type">report</property>
</variable-element>
</property>
</report>
On 9/3/2010 5:02 AM, pigargo wrote:
> Hello,
>
> I have a report with a group and many detailrows with different hights,
> so I can not define an interval for the pagebreak. The bug 233755
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=233755 describes my
> problem. It is fixed, but in comment 3 was written, that in version
> 2.5.1 the same problem is still there.
> I am using birt 2.5.2 and tested the report also in 2.6.0 with the same
> result. The pagebreak event was not called for dynamic pagebreaks in the
> render methode. The print methode is pdf. The run and render task is
> seperated.
>
> Why the bug 233755 is not reopened? Or is there an other solution for
> this problem in a newer version?
>
> pigargo
|
|
|
|
Re: reset pagenumber on group without interval [message #557461 is a reply to message #557223] |
Tue, 07 September 2010 13:55 |
|
How are you running the report? Have you tried with the viewer?
Jason
On 9/6/2010 3:54 AM, pigargo wrote:
> Hello Jason,
>
> I have used the onPageBreak Event of the table.
>
> Now I have tried your example and I got the same problem. The total page
> is correct but the page number is always set to 1. I think it is a
> problem of the pdf-output. With html it seems to work.
>
> pigargo
|
|
|
|
Re: reset pagenumber on group without interval [message #558865 is a reply to message #558739] |
Tue, 14 September 2010 15:53 |
|
Do you have a page break interval set on the table? Can you put one on
to test it? I think this is a bug. I experienced the same issue when
using tables with no pagebreak interval. I have already logged the issue.
Jason
On 9/14/2010 5:15 AM, pigargo wrote:
> Hello Jason,
>
> I tried it with the viewer (View Report -> In Web Viewer) and in the Web
> Viewer the pagenumber was correct.
>
> But if I try "export to pdf" in the Web Viewer the pagenumber always
> will be 1 of 12, for all 12 pages.
>
> I also have tried it with a small java application which a seperat run
> and render task and pdf-output. In the output file will be printed the
> pagenumber 1 of 12 for all 12 pages.
>
> This was the java application for testing.
> import org.eclipse.birt.core.framework.Platform;
> import org.eclipse.birt.report.engine.api.EngineConfig;
> import org.eclipse.birt.report.engine.api.EngineException;
> import org.eclipse.birt.report.engine.api.IPDFRenderOption;
> import org.eclipse.birt.report.engine.api.IRenderOption;
> import org.eclipse.birt.report.engine.api.IRenderTask;
> import org.eclipse.birt.report.engine.api.IReportDocument;
> import org.eclipse.birt.report.engine.api.IReportEngine;
> import org.eclipse.birt.report.engine.api.IReportEngineFactory;
> import org.eclipse.birt.report.engine.api.IReportRunnable;
> import org.eclipse.birt.report.engine.api.IRunTask;
> import org.eclipse.birt.report.engine.api.PDFRenderOption;
> import org.eclipse.birt.report.engine.api.RenderOption;
>
> public class MainClass {
>
> /**
> * @param args
> */
> public static void main(String[] args) {
> IReportEngine engine = null;
> try{
> final EngineConfig config = new EngineConfig( );
> config.setEngineHome("C:\\Birt_2_6_0\\runtime\\ReportEngine ");
>
> Platform.startup( config ); //If using RE API in Eclipse/RCP application
> this is not needed.
> IReportEngineFactory factory = (IReportEngineFactory) Platform
> .createFactoryObject(
> IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
> engine = factory.createReportEngine( config );
>
> }catch( Exception ex){
> ex.printStackTrace();
> }
>
> // Run reports, etc.
> try {
> run(engine);
> render(engine);
> } catch (EngineException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
>
> // destroy the engine.
> engine.destroy();
> Platform.shutdown();
> }
>
> public static void run(IReportEngine engine) throws EngineException{
> //Open a report design IReportRunnable design =
> engine.openReportDesign("H:\\birt_report\\version260proj\\pagenumber in
> 2_6.rptdesign");
> //Create task to run the report - use the task to execute the report and
> save to disk.
> IRunTask task = engine.createRunTask(design); //run the report and
> destroy the engine
> task.run("H:\\birt_report\\version260proj\\pagenumber in 2_6.rptdocument");
>
> task.close();
> }
>
> public static void render(IReportEngine engine) throws EngineException{
> //Open a report document IReportDocument document =
> engine.openReportDocument("H:\\birt_report\\version260proj\\pagenumber
> in 2_6.rptdocument");
>
> IRenderOption options = new RenderOption();
> options.setOutputFormat("pdf");
> options.setOutputFileName("H:\\birt_report\\version260proj\\pagenumber
> in 2_6.pdf");
>
> PDFRenderOption pdfOptions = new PDFRenderOption( options );
> pdfOptions.setOption( IPDFRenderOption.PAGE_OVERFLOW,
> IPDFRenderOption.OUTPUT_TO_MULTIPLE_PAGES);
> //pdfOptions.setOption(IPDFRenderOption.PAGEBREAK_PAGINATION _ONLY, new
> Boolean(false));
>
> //Create Render Task
> IRenderTask task = engine.createRenderTask(document);
> task.setRenderOption(pdfOptions);
> task.render();
> document.close();
> }
>
> }
>
> pigargo
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04006 seconds