Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » BIRT : How to hide autotext
BIRT : How to hide autotext [message #482688] Thu, 27 August 2009 14:33 Go to next message
Eclipse UserFriend
Originally posted by: anwarrazas.gmail.com

Hi,

I want hide autotext i.e, page number conditionally on a birt report. I am
using a master page where in i am adding the pagenumber as autotext and
want to hide the page number conditionally for example at the introductory
page and start of a new section. Could you please help.

Regards,
Anwar
Re: BIRT : How to hide autotext [message #482725 is a reply to message #482688] Thu, 27 August 2009 17:02 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Anwar,

Are you using BIRT 2.5? You probably can use a page variable for this
if you are.

Jason

Anwar wrote:
> Hi,
>
> I want hide autotext i.e, page number conditionally on a birt report. I
> am using a master page where in i am adding the pagenumber as autotext
> and want to hide the page number conditionally for example at the
> introductory page and start of a new section. Could you please help.
>
> Regards,
> Anwar
>
Re: BIRT : How to hide autotext [message #483705 is a reply to message #482725] Wed, 02 September 2009 15:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: anwarrazas.gmail.com

Hi,

As advised I took a report variable Page_num and inserted a Autotext page
variable in the footer of the master page. On the "onPageStart" event of
masterpage I wrote the following line to increment the page number and
gave the default value for the Page_num as 0.

reportContext.setPageVariable("Page_num", Number("Page_num") + 1);

But after the first page, which shows as 0, I get NaN on the report as
page number.

Could you please advise how to remove this error.

Thanks for your kind help.

Reagrds,
Anwar
Re: BIRT : How to hide autotext [message #483910 is a reply to message #483705] Thu, 03 September 2009 14:56 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Try this:
var curr =reportContext.getPageVariable("Page_Num");
reportContext.setPageVariable("Page_Num", parseInt(curr)+1);

Jason

Anwar wrote:
> Hi,
>
> As advised I took a report variable Page_num and inserted a Autotext
> page variable in the footer of the master page. On the "onPageStart"
> event of masterpage I wrote the following line to increment the page
> number and gave the default value for the Page_num as 0.
>
> reportContext.setPageVariable("Page_num", Number("Page_num") + 1);
>
> But after the first page, which shows as 0, I get NaN on the report as
> page number.
>
> Could you please advise how to remove this error.
>
> Thanks for your kind help.
>
> Reagrds,
> Anwar
>
Re: BIRT : How to hide autotext [message #483938 is a reply to message #483910] Thu, 03 September 2009 16:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: anwarrazas.gmail.com

Hi Jason,

Many thanks for your help. I am able to display the page numbers on the
report. Can you tell me how do I hide page number conditionally now. I
want to hide page number 1 and 4 of my report. Is it possible to give page
numbers in the condition.

Thanks and Regards,
Anwar
Re: BIRT : How to hide autotext [message #483986 is a reply to message #483938] Thu, 03 September 2009 20:01 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Anwar,

Select the autotext element on the master page and hit the script tab.
Enter the following for the onRender script.

var curr =reportContext.getPageVariable("Page_Num");
if( curr == 1 || curr == 4 ){
this.text="";
}

See attached example.

Jason

<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.20"
id="1">
<property name="createdBy">Eclipse BIRT Designer Version
2.5.0.v20090603 Build &lt;2.5.0.v20090617-0630></property>
<property name="units">in</property>
<method name="onPageStart"><![CDATA[var curr
=reportContext.getPageVariable("Page_Num");
reportContext.setPageVariable("Page_Num", parseInt(curr)+1);
]]></method>
<property name="iconFile">/templates/blank_report.gif</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="8">
<list-property name="columnHints">
<structure>
<property name="columnName">ORDERNUMBER</property>
<property name="displayName">ORDERNUMBER</property>
</structure>
<structure>
<property name="columnName">PRODUCTCODE</property>
<property name="displayName">PRODUCTCODE</property>
</structure>
<structure>
<property name="columnName">QUANTITYORDERED</property>
<property name="displayName">QUANTITYORDERED</property>
</structure>
<structure>
<property name="columnName">PRICEEACH</property>
<property name="displayName">PRICEEACH</property>
</structure>
<structure>
<property name="columnName">ORDERLINENUMBER</property>
<property name="displayName">ORDERLINENUMBER</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">PRODUCTCODE</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">QUANTITYORDERED</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">PRICEEACH</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">ORDERLINENUMBER</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">PRODUCTCODE</property>
<property name="nativeName">PRODUCTCODE</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">QUANTITYORDERED</property>
<property name="nativeName">QUANTITYORDERED</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">PRICEEACH</property>
<property name="nativeName">PRICEEACH</property>
<property name="dataType">float</property>
<property name="nativeDataType">8</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">ORDERLINENUMBER</property>
<property name="nativeName">ORDERLINENUMBER</property>
<property name="dataType">integer</property>
<property name="nativeDataType">5</property>
</structure>
</list-property>
<xml-property name="queryText"><![CDATA[select *
from orderdetails]]></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>PRODUCTCODE</design:name>
<design:position>2</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>PRODUCTCODE</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>PRODUCTCODE</design:label>
<design:formattingHints>
<design:displaySize>15</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>QUANTITYORDERED</design:name>
<design:position>3</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>QUANTITYORDERED</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>QUANTITYORDERED</design:label>
<design:formattingHints>
<design:displaySize>11</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>PRICEEACH</design:name>
<design:position>4</design:position>
<design:nativeDataTypeCode>8</design:nativeDataTypeCode>
<design:precision>15</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>PRICEEACH</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>PRICEEACH</design:label>
<design:formattingHints>
<design:displaySize>22</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>ORDERLINENUMBER</design:name>
<design:position>5</design:position>
<design:nativeDataTypeCode>5</design:nativeDataTypeCode>
<design:precision>5</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>ORDERLINENUMBER</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>ORDERLINENUMBER</design:label>
<design:formattingHints>
<design:displaySize>6</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" 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-cell" 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>
</styles>
<page-setup>
<simple-master-page name="Simple MasterPage" id="2">
<page-footer>
<auto-text id="43">
<method name="onRender"><![CDATA[var curr
=reportContext.getPageVariable("Page_Num");
if( curr == 1 || curr == 4 ){
this.text="";
}]]></method>
<property name="type">page-variable</property>
<property name="pageVariable">Page_Num</property>
</auto-text>
</page-footer>
</simple-master-page>
</page-setup>
<body>
<table id="9">
<property name="dataSet">Data Set</property>
<list-property name="boundDataColumns">
<structure>
<property name="name">ORDERNUMBER</property>
<property name="displayName">ORDERNUMBER</property>
<expression
name="expression">dataSetRow["ORDERNUMBER"]</expression >
<property name="dataType">integer</property>
</structure>
<structure>
<property name="name">PRODUCTCODE</property>
<property name="displayName">PRODUCTCODE</property>
<expression
name="expression">dataSetRow["PRODUCTCODE"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">QUANTITYORDERED</property>
<property name="displayName">QUANTITYORDERED</property>
<expression
name="expression">dataSetRow["QUANTITYORDERED"]</expression >
<property name="dataType">integer</property>
</structure>
<structure>
<property name="name">PRICEEACH</property>
<property name="displayName">PRICEEACH</property>
<expression
name="expression">dataSetRow["PRICEEACH"]</expression>
<property name="dataType">float</property>
</structure>
<structure>
<property name="name">ORDERLINENUMBER</property>
<property name="displayName">ORDERLINENUMBER</property>
<expression
name="expression">dataSetRow["ORDERLINENUMBER"]</expression >
<property name="dataType">integer</property>
</structure>
</list-property>
<column id="38"/>
<column id="39"/>
<column id="40"/>
<column id="41"/>
<column id="42"/>
<header>
<row id="10">
<cell id="11">
<label id="12">
<text-property
name="text">ORDERNUMBER</text-property>
</label>
</cell>
<cell id="13">
<label id="14">
<text-property
name="text">PRODUCTCODE</text-property>
</label>
</cell>
<cell id="15">
<label id="16">
<text-property
name="text">QUANTITYORDERED</text-property>
</label>
</cell>
<cell id="17">
<label id="18">
<text-property
name="text">PRICEEACH</text-property>
</label>
</cell>
<cell id="19">
<label id="20">
<text-property
name="text">ORDERLINENUMBER</text-property>
</label>
</cell>
</row>
</header>
<detail>
<row id="21">
<cell id="22">
<data id="23">
<property
name="resultSetColumn">ORDERNUMBER</property>
</data>
</cell>
<cell id="24">
<data id="25">
<property
name="resultSetColumn">PRODUCTCODE</property>
</data>
</cell>
<cell id="26">
<data id="27">
<property
name="resultSetColumn">QUANTITYORDERED</property>
</data>
</cell>
<cell id="28">
<data id="29">
<property
name="resultSetColumn">PRICEEACH</property>
</data>
</cell>
<cell id="30">
<data id="31">
<property
name="resultSetColumn">ORDERLINENUMBER</property>
</data>
</cell>
</row>
</detail>
<footer>
<row id="32">
<cell id="33"/>
<cell id="34"/>
<cell id="35"/>
<cell id="36"/>
<cell id="37"/>
</row>
</footer>
</table>
</body>
<property name="pageVariables">
<variable-element name="Page_Num">
<expression name="value">0</expression>
<property name="type">page</property>
</variable-element>
</property>
</report>


Anwar wrote:
> Hi Jason,
>
> Many thanks for your help. I am able to display the page numbers on the
> report. Can you tell me how do I hide page number conditionally now. I
> want to hide page number 1 and 4 of my report. Is it possible to give
> page numbers in the condition.
>
> Thanks and Regards,
> Anwar
Re: BIRT : How to hide autotext [message #484228 is a reply to message #483986] Fri, 04 September 2009 16:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: anwarrazas.gmail.com

Many thanks Jason, It has worked.
Re: BIRT : How to hide autotext [message #505786 is a reply to message #482688] Mon, 04 January 2010 23:50 Go to previous messageGo to next message
Ryan  is currently offline Ryan Friend
Messages: 4
Registered: July 2009
Junior Member
I tried to run through this example, downloaded and used the XML/design file that you provided.

Unfortunately in my design file, I can't get BIRT to increment the page variable (or it is getting reset on every page).

Is there a setting that I may have accidentally set that may prevent the onPageStart method from being called on the report?

Here is what I did
1) In the designer I opened an existing report file.
2) In the data explorer under variables I created a "Page Variable" named "Page_Num" with a default value of 0.
3) Switching to outline view, I select AutoText->Variable I drag it to the report header. It prompts me for the variable to insert. I select the "Page_Num" that I just created. (Running the report at this time shows all zeros)
4) In the onPageStart of the report I add code to increment the variable:
var curr=reportContext.getPageVariable("Page_Num");
reportContext.setPageVariable("Page_Num", parseInt(curr)+1);

If I run the report now, the auto text variable that shows up is always zero.

Thanks

Ryan
Re: BIRT : How to hide autotext [message #505974 is a reply to message #505786] Tue, 05 January 2010 17:04 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Ryan,

Page variables need to now be set every time explicitly. So you in one
of your page scripts just set the page variable value. For example in
the page start you could do:

importPackage(Packages.java.lang);
if( reportContext.getPersistentGlobalVariable("PN") == null ){
reportContext.setPersistentGlobalVariable("PN",new Integer(1));
reportContext.setPageVariable("PageNum", 1);
}else{
var curr = parseInt(reportContext.getPersistentGlobalVariable("PN"));
reportContext.setPersistentGlobalVariable("PN", new
Integer(parseInt(curr)+1));
reportContext.setPageVariable("PageNum", curr+1);
}

In this example we store a counter as a persistent global variable that
we assign to the page variable. See attached example.

Jason


<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.20"
id="1">
<property name="createdBy">Eclipse BIRT Designer Version
2.5.1.v20090903 Build &lt;2.5.1.v20090917-1447></property>
<property name="units">in</property>
<method name="onPageStart"><![CDATA[importPackage(Packages.java.lang);
if( reportContext.getPersistentGlobalVariable("PN") == null ){
reportContext.setPersistentGlobalVariable("PN",new Integer(1));
reportContext.setPageVariable("PageNum", 1);
}else{
var curr = parseInt(reportContext.getPersistentGlobalVariable("PN"));
reportContext.setPersistentGlobalVariable("PN", new
Integer(parseInt(curr)+1));
reportContext.setPageVariable("PageNum", curr+1);
}
]]></method>
<property name="iconFile">/templates/blank_report.gif</property>
<property name="bidiLayoutOrientation">ltr</property>
<data-sources>
<oda-data-source
extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source"
id="7">
<text-property name="displayName"></text-property>
<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="8">
<list-property name="columnHints">
<structure>
<property name="columnName">ORDERNUMBER</property>
<text-property
name="displayName">ORDERNUMBER</text-property>
</structure>
<structure>
<property name="columnName">PRODUCTCODE</property>
<text-property
name="displayName">PRODUCTCODE</text-property>
</structure>
<structure>
<property name="columnName">QUANTITYORDERED</property>
<text-property
name="displayName">QUANTITYORDERED</text-property>
</structure>
<structure>
<property name="columnName">PRICEEACH</property>
<text-property
name="displayName">PRICEEACH</text-property>
</structure>
<structure>
<property name="columnName">ORDERLINENUMBER</property>
<text-property
name="displayName">ORDERLINENUMBER</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">PRODUCTCODE</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">QUANTITYORDERED</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">PRICEEACH</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">ORDERLINENUMBER</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">PRODUCTCODE</property>
<property name="nativeName">PRODUCTCODE</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">QUANTITYORDERED</property>
<property name="nativeName">QUANTITYORDERED</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">PRICEEACH</property>
<property name="nativeName">PRICEEACH</property>
<property name="dataType">float</property>
<property name="nativeDataType">8</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">ORDERLINENUMBER</property>
<property name="nativeName">ORDERLINENUMBER</property>
<property name="dataType">integer</property>
<property name="nativeDataType">5</property>
</structure>
</list-property>
<xml-property name="queryText"><![CDATA[select *
from orderdetails
]]></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">sans-serif</property>
<property name="fontSize">10pt</property>
</style>
<style name="crosstab" 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-cell" 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>
</styles>
<page-setup>
<simple-master-page name="Simple MasterPage" id="2">
<page-footer>
<auto-text id="89">
<property name="type">page-variable</property>
<property name="pageVariable">PageNum</property>
</auto-text>
</page-footer>
</simple-master-page>
</page-setup>
<body>
<table id="55">
<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">PRODUCTCODE</property>
<text-property
name="displayName">PRODUCTCODE</text-property>
<expression
name="expression">dataSetRow["PRODUCTCODE"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">QUANTITYORDERED</property>
<text-property
name="displayName">QUANTITYORDERED</text-property>
<expression
name="expression">dataSetRow["QUANTITYORDERED"]</expression >
<property name="dataType">integer</property>
</structure>
<structure>
<property name="name">PRICEEACH</property>
<text-property
name="displayName">PRICEEACH</text-property>
<expression
name="expression">dataSetRow["PRICEEACH"]</expression>
<property name="dataType">float</property>
</structure>
<structure>
<property name="name">ORDERLINENUMBER</property>
<text-property
name="displayName">ORDERLINENUMBER</text-property>
<expression
name="expression">dataSetRow["ORDERLINENUMBER"]</expression >
<property name="dataType">integer</property>
</structure>
</list-property>
<column id="84"/>
<column id="85"/>
<column id="86"/>
<column id="87"/>
<column id="88"/>
<header>
<row id="56">
<cell id="57">
<label id="58">
<text-property
name="text">ORDERNUMBER</text-property>
</label>
</cell>
<cell id="59">
<label id="60">
<text-property
name="text">PRODUCTCODE</text-property>
</label>
</cell>
<cell id="61">
<label id="62">
<text-property
name="text">QUANTITYORDERED</text-property>
</label>
</cell>
<cell id="63">
<label id="64">
<text-property
name="text">PRICEEACH</text-property>
</label>
</cell>
<cell id="65">
<label id="66">
<text-property
name="text">ORDERLINENUMBER</text-property>
</label>
</cell>
</row>
</header>
<detail>
<row id="67">
<cell id="68">
<data id="69">
<property
name="resultSetColumn">ORDERNUMBER</property>
</data>
</cell>
<cell id="70">
<data id="71">
<property
name="resultSetColumn">PRODUCTCODE</property>
</data>
</cell>
<cell id="72">
<data id="73">
<property
name="resultSetColumn">QUANTITYORDERED</property>
</data>
</cell>
<cell id="74">
<data id="75">
<property
name="resultSetColumn">PRICEEACH</property>
</data>
</cell>
<cell id="76">
<data id="77">
<property
name="resultSetColumn">ORDERLINENUMBER</property>
</data>
</cell>
</row>
</detail>
<footer>
<row id="78">
<cell id="79"/>
<cell id="80"/>
<cell id="81"/>
<cell id="82"/>
<cell id="83"/>
</row>
</footer>
</table>
</body>
<property name="pageVariables">
<variable-element name="PageNum">
<expression name="value" type="javascript">0;</expression>
<property name="type">page</property>
</variable-element>
</property>
</report>


Ryan wrote:
> I tried to run through this example, downloaded and used the XML/design
> file that you provided.
>
> Unfortunately in my design file, I can't get BIRT to increment the page
> variable (or it is getting reset on every page).
>
> Is there a setting that I may have accidentally set that may prevent the
> onPageStart method from being called on the report?
>
> Here is what I did
> 1) In the designer I opened an existing report file.
> 2) In the data explorer under variables I created a "Page Variable"
> named "Page_Num" with a default value of 0.
> 3) Switching to outline view, I select AutoText->Variable I drag it to
> the report header. It prompts me for the variable to insert. I select
> the "Page_Num" that I just created. (Running the report at this time
> shows all zeros)
> 4) In the onPageStart of the report I add code to increment the variable:
> var curr=reportContext.getPageVariable("Page_Num");
> reportContext.setPageVariable("Page_Num", parseInt(curr)+1);
>
> If I run the report now, the auto text variable that shows up is always
> zero.
>
> Thanks
>
> Ryan
Re: BIRT : How to hide autotext [message #505979 is a reply to message #505974] Tue, 05 January 2010 12:15 Go to previous messageGo to next message
Ryan  is currently offline Ryan Friend
Messages: 4
Registered: July 2009
Junior Member
Jason,

Thank you for the pointer, I will give that a try. What I don't quite understand is why it works for your example in the previous post, but when I try to do the same thing it did not work? The resetting of the page variable should have occurred as well for the post and design file above, but it seems to not be needed. Why is that?

Ryan
Re: BIRT : How to hide autotext [message #506000 is a reply to message #505979] Tue, 05 January 2010 13:16 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Ryan,

I believe this behavior was changed from BIRT 2.5.0 to 2.5.1. The old
example only works in 2.5.0.

Jason

Ryan wrote:
> Jason,
> Thank you for the pointer, I will give that a try. What I don't quite
> understand is why it works for your example in the previous post, but
> when I try to do the same thing it did not work? The resetting of the
> page variable should have occurred as well for the post and design file
> above, but it seems to not be needed. Why is that?
>
> Ryan
Re: BIRT : How to hide autotext [message #506004 is a reply to message #506000] Tue, 05 January 2010 18:22 Go to previous messageGo to next message
Ryan  is currently offline Ryan Friend
Messages: 4
Registered: July 2009
Junior Member
Thanks Jason. That is very good to know since were going to be moving to 2.5.1, but we are on 2.5.0 right now.
>> Eclipse BIRT Designer Version 2.5.0.v20090603 Build <2.5.0.v20090617-0630>

The example works properly, but the strange thing is that when I try to duplicate it, on a design file I have, it doesn't work. I'm going to try your recommendation and I'll let you know.

Thanks
Ryan
Re: BIRT : How to hide autotext [message #506628 is a reply to message #505974] Fri, 08 January 2010 12:32 Go to previous messageGo to next message
Sandra Martín is currently offline Sandra MartínFriend
Messages: 7
Registered: January 2010
Junior Member
I need use a Page Variable to personalize printing of page numbers.
The problem appears when a table in my report takes more than one page (without an explicit page break). When second page is needed, onPageStart event is not called, so the Page Variable isn't updated and, for example, "Page 1" is printed twice.

I have following code in onPageStart event:

<method name="onPageStart"><![CDATA[
importPackage(Packages.java.lang);
if(reportContext.getPersistentGlobalVariable("PN") == null ){
reportContext.setPersistentGlobalVariable("PN",new Integer(1));
reportContext.setPageVariable("PageNum", 1);
}else{
var curr = parseInt(reportContext.getPersistentGlobalVariable("PN"));
reportContext.setPersistentGlobalVariable("PN", new
Integer(parseInt(curr)+1));
reportContext.setPageVariable("PageNum", curr+1);
}]]></method>

I have tried without PersistentGlobalVariable too.

Note: I have reported a bug: "Bug 299107 - onPageStart event is not called when a table needs more than one page".

Thanks so much

[Updated on: Fri, 08 January 2010 12:33]

Report message to a moderator

Re: BIRT : How to hide autotext [message #506659 is a reply to message #506628] Fri, 08 January 2010 14:58 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Sandra,

The error you are getting is because the page break events are defined
for HTML and your print is in PDF. Try setting the page break interval
for the table to the same number of rows you are getting in the PDF and
it should work.

Jason

Sandra Mart wrote:
> I need use a Page Variable to personalize printing of page numbers.
> The problem appears when a table in my report takes more than one page
> (without
> an explicit page break). When second page is needed, onPageStart event
> is not
> called, so the Page Variable isn't updated and, for example, "Page 1" is
> printed twice.
>
> I have following code in onPageStart event:
>
> <method name="onPageStart"><![CDATA[
> importPackage(Packages.java.lang);
> if(reportContext.getPersistentGlobalVariable("PN") == null ){
> reportContext.setPersistentGlobalVariable("PN",new Integer(1));
> reportContext.setPageVariable("PageNum", 1);
> }else{
> var curr = parseInt(reportContext.getPersistentGlobalVariable("PN"));
> reportContext.setPersistentGlobalVariable("PN", new
> Integer(parseInt(curr)+1));
> reportContext.setPageVariable("PageNum", curr+1);
> }]]></method>
>
> I have tried without PersistentGlobalVariable too.
>
> Note: I have reported a bug: "Bug 299107 - onPageStart event is not
> called when a table needs more than one page".
>
> Thanks so much
Re: BIRT : How to hide autotext [message #506860 is a reply to message #506659] Mon, 11 January 2010 07:56 Go to previous messageGo to next message
Sandra Martín is currently offline Sandra MartínFriend
Messages: 7
Registered: January 2010
Junior Member
Thanks for your answer.
Yes, I'm printing in PDF. But this solution doesn't work. See following example:

A table with 15 rows.
- First page: the table starts printing at the end of the page and only 2 rows fit (and this number can be vary).
- Second page: 10 rows fit.
- Third page: 3 rows fit.

If I set page break interval to 15, the onPageStart event only is called in the third page, so in first and second page the page number is not updated.

Thanks again
Re: BIRT : How to hide autotext [message #506997 is a reply to message #506860] Mon, 11 January 2010 11:22 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Sandra,

When you bring this example up in the html viewer, how many page breaks
do you have?

Jason

Sandra Mart wrote:
> Thanks for your answer.
> Yes, I'm printing in PDF. But this solution doesn't work. See following
> example:
>
> A table with 15 rows.
> - First page: the table starts printing at the end of the page and only
> 2 rows fit (and this number can be vary).
> - Second page: 10 rows fit.
> - Third page: 3 rows fit.
>
> If I set page break interval to 15, the onPageStart event only is called
> in the third page, so in first and second page the page number is not
> updated.
>
> Thanks again
Re: BIRT : How to hide autotext [message #507132 is a reply to message #506997] Tue, 12 January 2010 09:41 Go to previous messageGo to next message
Sandra Martín is currently offline Sandra MartínFriend
Messages: 7
Registered: January 2010
Junior Member
I don't know if I have understood your question: I have added a log in "onPageBreak" event of the table and I have got the log once.
Re: BIRT : How to hide autotext [message #507163 is a reply to message #506997] Tue, 12 January 2010 11:06 Go to previous messageGo to next message
Sandra Martín is currently offline Sandra MartínFriend
Messages: 7
Registered: January 2010
Junior Member
I have designed two reports

In first report the page number is not printed correctly (always 0) because onPageStart event is not called to each new page.

In second report the page number is printed correctly because I set onPageBreakInterval to 1, so onPageStart event is called to each new page.


I do not have allowed to attach files, sorry:


REPORT 1:


<?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.5.2.v20091210 Build &lt;2.6.0.v20091215-0800></property>
<property name="units">in</property>
<method name="onPageStart"><![CDATA[importPackage(Packages.java.lang);

if(reportContext.getPersistentGlobalVariable("PN") == null ){

reportContext.setPersistentGlobalVariable("PN",new Integer(1));

reportContext.setPageVariable("PageNum", 1);

}else{

var curr = parseInt(reportContext.getPersistentGlobalVariable("PN"));

reportContext.setPersistentGlobalVariable("PN", new

Integer(parseInt(curr)+1));

reportContext.setPageVariable("PageNum", curr+1);

}]]></method>
<property name="iconFile">/templates/blank_report.gif</property>
<property name="bidiLayoutOrientation">ltr</property>
<property name="imageDPI">96</property>
<data-sources>
<oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source" id="16">
<text-property name="displayName"></text-property>
<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="17">
<list-property name="columnHints">
<structure>
<property name="columnName">EMPLOYEENUMBER</property>
<text-property name="displayName">EMPLOYEENUMBER</text-property>
</structure>
<structure>
<property name="columnName">LASTNAME</property>
<text-property name="displayName">LASTNAME</text-property>
</structure>
<structure>
<property name="columnName">FIRSTNAME</property>
<text-property name="displayName">FIRSTNAME</text-property>
</structure>
<structure>
<property name="columnName">EXTENSION</property>
<text-property name="displayName">EXTENSION</text-property>
</structure>
<structure>
<property name="columnName">EMAIL</property>
<text-property name="displayName">EMAIL</text-property>
</structure>
<structure>
<property name="columnName">OFFICECODE</property>
<text-property name="displayName">OFFICECODE</text-property>
</structure>
<structure>
<property name="columnName">REPORTSTO</property>
<text-property name="displayName">REPORTSTO</text-property>
</structure>
<structure>
<property name="columnName">JOBTITLE</property>
<text-property name="displayName">JOBTITLE</text-property>
</structure>
</list-property>
<structure name="cachedMetaData">
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">EMPLOYEENUMBER</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">LASTNAME</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">FIRSTNAME</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">EXTENSION</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">EMAIL</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">6</property>
<property name="name">OFFICECODE</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">7</property>
<property name="name">REPORTSTO</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">8</property>
<property name="name">JOBTITLE</property>
<property name="dataType">string</property>
</structure>
</list-property>
</structure>
<property name="dataSource">Data Source</property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">EMPLOYEENUMBER</property>
<property name="nativeName">EMPLOYEENUMBER</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">LASTNAME</property>
<property name="nativeName">LASTNAME</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">FIRSTNAME</property>
<property name="nativeName">FIRSTNAME</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">EXTENSION</property>
<property name="nativeName">EXTENSION</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">EMAIL</property>
<property name="nativeName">EMAIL</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">6</property>
<property name="name">OFFICECODE</property>
<property name="nativeName">OFFICECODE</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">7</property>
<property name="name">REPORTSTO</property>
<property name="nativeName">REPORTSTO</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
<structure>
<property name="position">8</property>
<property name="name">JOBTITLE</property>
<property name="nativeName">JOBTITLE</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
</list-property>
<xml-property name="queryText"><![CDATA[Select * from CLASSICMODELS.EMPLOYEES]]></xml-property>
</oda-data-set>
</data-sets>
<styles>
<style name="report" id="4">
<property name="fontFamily">sans-serif</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>
</styles>
<page-setup>
<simple-master-page name="Simple MasterPage" id="2">
<page-footer>
<grid id="19">
<column id="20"/>
<row id="21">
<cell id="22">
<auto-text name="NewAutoText" id="81423">
<property name="fontStyle">italic</property>
<property name="type">page-variable</property>
<property name="pageVariable">PageNum</property>
</auto-text>
</cell>
</row>
</grid>
</page-footer>
</simple-master-page>
</page-setup>
<body>
<table id="7">
<property name="dataSet">Data Set</property>
<list-property name="boundDataColumns">
<structure>
<property name="name">EMPLOYEENUMBER</property>
<text-property name="displayName">EMPLOYEENUMBER</text-property>
<expression name="expression" type="javascript">dataSetRow["EMPLOYEENUMBER"]</expression >
<property name="dataType">integer</property>
</structure>
</list-property>
<column id="14"/>
<header>
<row id="8">
<property name="height">0.3333333333333333in</property>
<cell id="9">
<text id="15">
<property name="contentType">auto</property>
<text-property name="content"><![CDATA[Employee Number]]></text-property>
</text>
</cell>
</row>
</header>
<detail>
<row id="10">
<property name="height">1.2291666666666667in</property>
<cell id="11">
<property name="borderBottomColor">#000000</property>
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">medium</property>
<property name="borderLeftColor">#000000</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">medium</property>
<property name="borderRightColor">#000000</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">medium</property>
<property name="borderTopColor">#000000</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">medium</property>
<data id="18">
<property name="resultSetColumn">EMPLOYEENUMBER</property>
</data>
</cell>
</row>
</detail>
</table>
</body>
<property name="pageVariables">
<variable-element name="PageNum">
<expression name="value" type="javascript">0</expression>
<property name="type">page</property>
</variable-element>
</property>
</report>



REPORT 2:


<?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.5.2.v20091210 Build &lt;2.6.0.v20091215-0800></property>
<property name="units">in</property>
<method name="onPageStart"><![CDATA[importPackage(Packages.java.lang);
if(reportContext.getPersistentGlobalVariable("PN") == null ){
reportContext.setPersistentGlobalVariable("PN",new Integer(1));
reportContext.setPageVariable("PageNum", 1);
}else{
var curr = parseInt(reportContext.getPersistentGlobalVariable("PN"));
reportContext.setPersistentGlobalVariable("PN", new
Integer(parseInt(curr)+1));
reportContext.setPageVariable("PageNum", curr+1);
}]]></method>
<property name="iconFile">/templates/blank_report.gif</property>
<property name="bidiLayoutOrientation">ltr</property>
<property name="imageDPI">96</property>
<data-sources>
<oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source" id="16">
<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="17">
<list-property name="columnHints">
<structure>
<property name="columnName">EMPLOYEENUMBER</property>
<text-property name="displayName">EMPLOYEENUMBER</text-property>
</structure>
<structure>
<property name="columnName">LASTNAME</property>
<text-property name="displayName">LASTNAME</text-property>
</structure>
<structure>
<property name="columnName">FIRSTNAME</property>
<text-property name="displayName">FIRSTNAME</text-property>
</structure>
<structure>
<property name="columnName">EXTENSION</property>
<text-property name="displayName">EXTENSION</text-property>
</structure>
<structure>
<property name="columnName">EMAIL</property>
<text-property name="displayName">EMAIL</text-property>
</structure>
<structure>
<property name="columnName">OFFICECODE</property>
<text-property name="displayName">OFFICECODE</text-property>
</structure>
<structure>
<property name="columnName">REPORTSTO</property>
<text-property name="displayName">REPORTSTO</text-property>
</structure>
<structure>
<property name="columnName">JOBTITLE</property>
<text-property name="displayName">JOBTITLE</text-property>
</structure>
</list-property>
<structure name="cachedMetaData">
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">EMPLOYEENUMBER</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">LASTNAME</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">FIRSTNAME</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">EXTENSION</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">EMAIL</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">6</property>
<property name="name">OFFICECODE</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">7</property>
<property name="name">REPORTSTO</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">8</property>
<property name="name">JOBTITLE</property>
<property name="dataType">string</property>
</structure>
</list-property>
</structure>
<property name="dataSource">Data Source</property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">EMPLOYEENUMBER</property>
<property name="nativeName">EMPLOYEENUMBER</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">LASTNAME</property>
<property name="nativeName">LASTNAME</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">FIRSTNAME</property>
<property name="nativeName">FIRSTNAME</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">EXTENSION</property>
<property name="nativeName">EXTENSION</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">EMAIL</property>
<property name="nativeName">EMAIL</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">6</property>
<property name="name">OFFICECODE</property>
<property name="nativeName">OFFICECODE</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">7</property>
<property name="name">REPORTSTO</property>
<property name="nativeName">REPORTSTO</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
<structure>
<property name="position">8</property>
<property name="name">JOBTITLE</property>
<property name="nativeName">JOBTITLE</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
</list-property>
<xml-property name="queryText"><![CDATA[Select * from CLASSICMODELS.EMPLOYEES]]></xml-property>
</oda-data-set>
</data-sets>
<styles>
<style name="report" id="4">
<property name="fontFamily">sans-serif</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>
</styles>
<page-setup>
<simple-master-page name="Simple MasterPage" id="2">
<page-footer>
<grid id="19">
<column id="20"/>
<row id="21">
<cell id="22">
<auto-text name="NewAutoText" id="81423">
<property name="fontStyle">italic</property>
<property name="type">page-variable</property>
<property name="pageVariable">PageNum</property>
</auto-text>
</cell>
</row>
</grid>
</page-footer>
</simple-master-page>
</page-setup>
<body>
<table id="7">
<property name="dataSet">Data Set</property>
<list-property name="boundDataColumns">
<structure>
<property name="name">EMPLOYEENUMBER</property>
<text-property name="displayName">EMPLOYEENUMBER</text-property>
<expression name="expression" type="javascript">dataSetRow["EMPLOYEENUMBER"]</expression >
<property name="dataType">integer</property>
</structure>
</list-property>
<property name="pageBreakInterval">1</property>
<column id="14"/>
<header>
<row id="8">
<property name="height">0.3333333333333333in</property>
<cell id="9">
<text id="15">
<property name="contentType">auto</property>
<text-property name="content"><![CDATA[Employee Number]]></text-property>
</text>
</cell>
</row>
</header>
<detail>
<row id="10">
<property name="height">1.2291666666666667in</property>
<cell id="11">
<property name="borderBottomColor">#000000</property>
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">medium</property>
<property name="borderLeftColor">#000000</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">medium</property>
<property name="borderRightColor">#000000</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">medium</property>
<property name="borderTopColor">#000000</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">medium</property>
<data id="18">
<property name="resultSetColumn">EMPLOYEENUMBER</property>
</data>
</cell>
</row>
</detail>
</table>
</body>
<property name="pageVariables">
<variable-element name="PageNum">
<expression name="value" type="javascript">0</expression>
<property name="type">page</property>
</variable-element>
</property>
</report>

Re: BIRT : How to hide autotext [message #507251 is a reply to message #507163] Tue, 12 January 2010 16:07 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Sandra,

What I was saying is that page break events are based on the html page
breaks not the pdf. So if you open your report up in the Viewer using
the /frameset url you will see how many pages the event is fired for.
When you run (not export) it in PDF it will still fire for the number of
HTML pages.

Jason

Sandra Mart wrote:
> I have designed two reports
>
> In first report the page number is not printed correctly (always 0)
> because onPageStart event is not called to each new page.
>
> In second report the page number is printed correctly because I set
> onPageBreakInterval to 1, so onPageStart event is called to each new page.
>
>
> I do not have allowed to attach files, sorry:
>
>
> REPORT 1:
>
>
> <?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.5.2.v20091210 Build <2.6.0.v20091215-0800></property>
> <property name="units">in</property>
> <method name="onPageStart"><![CDATA[importPackage(Packages.java.lang);
>
> if(reportContext.getPersistentGlobalVariable("PN") == null ){
>
> reportContext.setPersistentGlobalVariable("PN",new Integer(1));
>
> reportContext.setPageVariable("PageNum", 1);
>
> }else{
>
> var curr = parseInt(reportContext.getPersistentGlobalVariable("PN"));
>
> reportContext.setPersistentGlobalVariable("PN", new
> Integer(parseInt(curr)+1));
>
> reportContext.setPageVariable("PageNum", curr+1);
>
> }]]></method>
> <property name="iconFile">/templates/blank_report.gif</property>
> <property name="bidiLayoutOrientation">ltr</property>
> <property name="imageDPI">96</property>
> <data-sources>
> <oda-data-source
> extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source"
> id="16">
> <text-property name="displayName"></text-property>
> <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="17">
> <list-property name="columnHints">
> <structure>
> <property name="columnName">EMPLOYEENUMBER</property>
> <text-property
> name="displayName">EMPLOYEENUMBER</text-property>
> </structure>
> <structure>
> <property name="columnName">LASTNAME</property>
> <text-property
> name="displayName">LASTNAME</text-property>
> </structure>
> <structure>
> <property name="columnName">FIRSTNAME</property>
> <text-property
> name="displayName">FIRSTNAME</text-property>
> </structure>
> <structure>
> <property name="columnName">EXTENSION</property>
> <text-property
> name="displayName">EXTENSION</text-property>
> </structure>
> <structure>
> <property name="columnName">EMAIL</property>
> <text-property name="displayName">EMAIL</text-property>
> </structure>
> <structure>
> <property name="columnName">OFFICECODE</property>
> <text-property
> name="displayName">OFFICECODE</text-property>
> </structure>
> <structure>
> <property name="columnName">REPORTSTO</property>
> <text-property
> name="displayName">REPORTSTO</text-property>
> </structure>
> <structure>
> <property name="columnName">JOBTITLE</property>
> <text-property
> name="displayName">JOBTITLE</text-property>
> </structure>
> </list-property>
> <structure name="cachedMetaData">
> <list-property name="resultSet">
> <structure>
> <property name="position">1</property>
> <property name="name">EMPLOYEENUMBER</property>
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="position">2</property>
> <property name="name">LASTNAME</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">3</property>
> <property name="name">FIRSTNAME</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">4</property>
> <property name="name">EXTENSION</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">5</property>
> <property name="name">EMAIL</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">6</property>
> <property name="name">OFFICECODE</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">7</property>
> <property name="name">REPORTSTO</property>
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="position">8</property>
> <property name="name">JOBTITLE</property>
> <property name="dataType">string</property>
> </structure>
> </list-property>
> </structure>
> <property name="dataSource">Data Source</property>
> <list-property name="resultSet">
> <structure>
> <property name="position">1</property>
> <property name="name">EMPLOYEENUMBER</property>
> <property name="nativeName">EMPLOYEENUMBER</property>
> <property name="dataType">integer</property>
> <property name="nativeDataType">4</property>
> </structure>
> <structure>
> <property name="position">2</property>
> <property name="name">LASTNAME</property>
> <property name="nativeName">LASTNAME</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> <structure>
> <property name="position">3</property>
> <property name="name">FIRSTNAME</property>
> <property name="nativeName">FIRSTNAME</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> <structure>
> <property name="position">4</property>
> <property name="name">EXTENSION</property>
> <property name="nativeName">EXTENSION</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> <structure>
> <property name="position">5</property>
> <property name="name">EMAIL</property>
> <property name="nativeName">EMAIL</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> <structure>
> <property name="position">6</property>
> <property name="name">OFFICECODE</property>
> <property name="nativeName">OFFICECODE</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> <structure>
> <property name="position">7</property>
> <property name="name">REPORTSTO</property>
> <property name="nativeName">REPORTSTO</property>
> <property name="dataType">integer</property>
> <property name="nativeDataType">4</property>
> </structure>
> <structure>
> <property name="position">8</property>
> <property name="name">JOBTITLE</property>
> <property name="nativeName">JOBTITLE</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> </list-property>
> <xml-property name="queryText"><![CDATA[Select * from
> CLASSICMODELS.EMPLOYEES]]></xml-property>
> </oda-data-set>
> </data-sets>
> <styles>
> <style name="report" id="4">
> <property name="fontFamily">sans-serif</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>
> </styles>
> <page-setup>
> <simple-master-page name="Simple MasterPage" id="2">
> <page-footer>
> <grid id="19">
> <column id="20"/>
> <row id="21">
> <cell id="22">
> <auto-text name="NewAutoText" id="81423">
> <property name="fontStyle">italic</property>
> <property
> name="type">page-variable</property>
> <property
> name="pageVariable">PageNum</property>
> </auto-text>
> </cell>
> </row>
> </grid>
> </page-footer>
> </simple-master-page>
> </page-setup>
> <body>
> <table id="7">
> <property name="dataSet">Data Set</property>
> <list-property name="boundDataColumns">
> <structure>
> <property name="name">EMPLOYEENUMBER</property>
> <text-property
> name="displayName">EMPLOYEENUMBER</text-property>
> <expression name="expression"
> type="javascript">dataSetRow["EMPLOYEENUMBER"]</expression >
> <property name="dataType">integer</property>
> </structure>
> </list-property>
> <column id="14"/>
> <header>
> <row id="8">
> <property name="height">0.3333333333333333in</property>
> <cell id="9">
> <text id="15">
> <property name="contentType">auto</property>
> <text-property
> name="content"><![CDATA[Employee Number]]></text-property>
> </text>
> </cell>
> </row>
> </header>
> <detail>
> <row id="10">
> <property name="height">1.2291666666666667in</property>
> <cell id="11">
> <property
> name="borderBottomColor">#000000</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">medium</property>
> <property name="borderLeftColor">#000000</property>
> <property name="borderLeftStyle">solid</property>
> <property name="borderLeftWidth">medium</property>
> <property name="borderRightColor">#000000</property>
> <property name="borderRightStyle">solid</property>
> <property name="borderRightWidth">medium</property>
> <property name="borderTopColor">#000000</property>
> <property name="borderTopStyle">solid</property>
> <property name="borderTopWidth">medium</property>
> <data id="18">
> <property
> name="resultSetColumn">EMPLOYEENUMBER</property>
> </data>
> </cell>
> </row>
> </detail>
> </table>
> </body>
> <property name="pageVariables">
> <variable-element name="PageNum">
> <expression name="value" type="javascript">0</expression>
> <property name="type">page</property>
> </variable-element>
> </property>
> </report>
>
>
>
> REPORT 2:
>
>
> <?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.5.2.v20091210 Build <2.6.0.v20091215-0800></property>
> <property name="units">in</property>
> <method name="onPageStart"><![CDATA[importPackage(Packages.java.lang);
> if(reportContext.getPersistentGlobalVariable("PN") == null ){
> reportContext.setPersistentGlobalVariable("PN",new Integer(1));
> reportContext.setPageVariable("PageNum", 1);
> }else{
> var curr = parseInt(reportContext.getPersistentGlobalVariable("PN"));
> reportContext.setPersistentGlobalVariable("PN", new
> Integer(parseInt(curr)+1));
> reportContext.setPageVariable("PageNum", curr+1);
> }]]></method>
> <property name="iconFile">/templates/blank_report.gif</property>
> <property name="bidiLayoutOrientation">ltr</property>
> <property name="imageDPI">96</property>
> <data-sources>
> <oda-data-source
> extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source"
> id="16">
> <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="17">
> <list-property name="columnHints">
> <structure>
> <property name="columnName">EMPLOYEENUMBER</property>
> <text-property
> name="displayName">EMPLOYEENUMBER</text-property>
> </structure>
> <structure>
> <property name="columnName">LASTNAME</property>
> <text-property
> name="displayName">LASTNAME</text-property>
> </structure>
> <structure>
> <property name="columnName">FIRSTNAME</property>
> <text-property
> name="displayName">FIRSTNAME</text-property>
> </structure>
> <structure>
> <property name="columnName">EXTENSION</property>
> <text-property
> name="displayName">EXTENSION</text-property>
> </structure>
> <structure>
> <property name="columnName">EMAIL</property>
> <text-property name="displayName">EMAIL</text-property>
> </structure>
> <structure>
> <property name="columnName">OFFICECODE</property>
> <text-property
> name="displayName">OFFICECODE</text-property>
> </structure>
> <structure>
> <property name="columnName">REPORTSTO</property>
> <text-property
> name="displayName">REPORTSTO</text-property>
> </structure>
> <structure>
> <property name="columnName">JOBTITLE</property>
> <text-property
> name="displayName">JOBTITLE</text-property>
> </structure>
> </list-property>
> <structure name="cachedMetaData">
> <list-property name="resultSet">
> <structure>
> <property name="position">1</property>
> <property name="name">EMPLOYEENUMBER</property>
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="position">2</property>
> <property name="name">LASTNAME</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">3</property>
> <property name="name">FIRSTNAME</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">4</property>
> <property name="name">EXTENSION</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">5</property>
> <property name="name">EMAIL</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">6</property>
> <property name="name">OFFICECODE</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">7</property>
> <property name="name">REPORTSTO</property>
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="position">8</property>
> <property name="name">JOBTITLE</property>
> <property name="dataType">string</property>
> </structure>
> </list-property>
> </structure>
> <property name="dataSource">Data Source</property>
> <list-property name="resultSet">
> <structure>
> <property name="position">1</property>
> <property name="name">EMPLOYEENUMBER</property>
> <property name="nativeName">EMPLOYEENUMBER</property>
> <property name="dataType">integer</property>
> <property name="nativeDataType">4</property>
> </structure>
> <structure>
> <property name="position">2</property>
> <property name="name">LASTNAME</property>
> <property name="nativeName">LASTNAME</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> <structure>
> <property name="position">3</property>
> <property name="name">FIRSTNAME</property>
> <property name="nativeName">FIRSTNAME</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> <structure>
> <property name="position">4</property>
> <property name="name">EXTENSION</property>
> <property name="nativeName">EXTENSION</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> <structure>
> <property name="position">5</property>
> <property name="name">EMAIL</property>
> <property name="nativeName">EMAIL</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> <structure>
> <property name="position">6</property>
> <property name="name">OFFICECODE</property>
> <property name="nativeName">OFFICECODE</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> <structure>
> <property name="position">7</property>
> <property name="name">REPORTSTO</property>
> <property name="nativeName">REPORTSTO</property>
> <property name="dataType">integer</property>
> <property name="nativeDataType">4</property>
> </structure>
> <structure>
> <property name="position">8</property>
> <property name="name">JOBTITLE</property>
> <property name="nativeName">JOBTITLE</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> </list-property>
> <xml-property name="queryText"><![CDATA[Select * from
> CLASSICMODELS.EMPLOYEES]]></xml-property>
> </oda-data-set>
> </data-sets>
> <styles>
> <style name="report" id="4">
> <property name="fontFamily">sans-serif</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>
> </styles>
> <page-setup>
> <simple-master-page name="Simple MasterPage" id="2">
> <page-footer>
> <grid id="19">
> <column id="20"/>
> <row id="21">
> <cell id="22">
> <auto-text name="NewAutoText" id="81423">
> <property name="fontStyle">italic</property>
> <property
> name="type">page-variable</property>
> <property
> name="pageVariable">PageNum</property>
> </auto-text>
> </cell>
> </row>
> </grid>
> </page-footer>
> </simple-master-page>
> </page-setup>
> <body>
> <table id="7">
> <property name="dataSet">Data Set</property>
> <list-property name="boundDataColumns">
> <structure>
> <property name="name">EMPLOYEENUMBER</property>
> <text-property
> name="displayName">EMPLOYEENUMBER</text-property>
> <expression name="expression"
> type="javascript">dataSetRow["EMPLOYEENUMBER"]</expression >
> <property name="dataType">integer</property>
> </structure>
> </list-property>
> <property name="pageBreakInterval">1</property>
> <column id="14"/>
> <header>
> <row id="8">
> <property name="height">0.3333333333333333in</property>
> <cell id="9">
> <text id="15">
> <property name="contentType">auto</property>
> <text-property
> name="content"><![CDATA[Employee Number]]></text-property>
> </text>
> </cell>
> </row>
> </header>
> <detail>
> <row id="10">
> <property name="height">1.2291666666666667in</property>
> <cell id="11">
> <property
> name="borderBottomColor">#000000</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">medium</property>
> <property name="borderLeftColor">#000000</property>
> <property name="borderLeftStyle">solid</property>
> <property name="borderLeftWidth">medium</property>
> <property name="borderRightColor">#000000</property>
> <property name="borderRightStyle">solid</property>
> <property name="borderRightWidth">medium</property>
> <property name="borderTopColor">#000000</property>
> <property name="borderTopStyle">solid</property>
> <property name="borderTopWidth">medium</property>
> <data id="18">
> <property
> name="resultSetColumn">EMPLOYEENUMBER</property>
> </data>
> </cell>
> </row>
> </detail>
> </table>
> </body>
> <property name="pageVariables">
> <variable-element name="PageNum">
> <expression name="value" type="javascript">0</expression>
> <property name="type">page</property>
> </variable-element>
> </property>
> </report>
>
>
Re: BIRT : How to hide autotext [message #507367 is a reply to message #507251] Wed, 13 January 2010 07:57 Go to previous messageGo to next message
Sandra Martín is currently offline Sandra MartínFriend
Messages: 7
Registered: January 2010
Junior Member
Jason Weathersby wrote on Tue, 12 January 2010 11:07
Sandra,

What I was saying is that page break events are based on the html page
breaks not the pdf. So if you open your report up in the Viewer using
the /frameset url you will see how many pages the event is fired for.
When you run (not export) it in PDF it will still fire for the number of
HTML pages.

Jason
>


Can you run the first report that I put in last message?
When I do following in Birt Report Designer: Run > View report > As Pdf, I obtain 4 pages but always Page Num is 0.
Re: BIRT : How to hide autotext [message #507503 is a reply to message #507367] Wed, 13 January 2010 16:56 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Sandra,

I can run it. If you set its page break to 4 or 5 it should still work
as well. By default the table has a 40 page break interval which means
it will never happen in this case and you will get no page break events.

Jason

Sandra Martín wrote:
> Jason Weathersby wrote on Tue, 12 January 2010 11:07
>> Sandra,
>>
>> What I was saying is that page break events are based on the html page
>> breaks not the pdf. So if you open your report up in the Viewer using
>> the /frameset url you will see how many pages the event is fired for.
>> When you run (not export) it in PDF it will still fire for the number
>> of HTML pages.
>>
>> Jason
>> >
>
>
> Can you run the first report that I put in last message?
> When I do following in Birt Report Designer: Run > View report > As Pdf,
> I obtain 4 pages but always Page Num is 0.
Re: BIRT : How to hide autotext [message #507628 is a reply to message #507503] Thu, 14 January 2010 07:46 Go to previous messageGo to next message
Sandra Martín is currently offline Sandra MartínFriend
Messages: 7
Registered: January 2010
Junior Member
Yes, in this report this solution works. But in my real scenario, my table starts at the end of a page, and continue to following pages. So, pageBreakInterval is variable in each page.

Do you consider that can't exist a solution without to use an explicit pageBreak?

I have received an answer in the bug I reported, but it don't work:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=299107
Re: BIRT : How to hide autotext [message #507794 is a reply to message #507628] Thu, 14 January 2010 17:13 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Sandra,

This appears to be a bug. I posted an example with the problem to the bug.

Jason

Sandra Martín wrote:
> Yes, in this report this solution works. But in my real scenario, my
> table starts at the end of a page, and continue to following pages. So,
> pageBreakInterval is variable in each page.
>
> Do you consider that can't exist a solution without to use an explicit
> pageBreak?
>
> I have received an answer in the bug I reported, but it don't work:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=299107
Re: BIRT : How to hide autotext [message #507910 is a reply to message #507794] Fri, 15 January 2010 07:26 Go to previous message
Sandra Martín is currently offline Sandra MartínFriend
Messages: 7
Registered: January 2010
Junior Member
Ok. Thank you very much for your help
Previous Topic:Unable to load report design in BIRT 2.5.x
Next Topic:Question on formatting a table footer
Goto Forum:
  


Current Time: Fri Apr 19 06:56:30 GMT 2024

Powered by FUDForum. Page generated in 0.03744 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top