Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Reset Pagenumber on Group
Peter P.
Hi!
We make heavy use of grouping in Birt.
Is there a possibility to reset the pagenumber (from the autotext) after each group?
I tried to work around the problem using page-variables, but I can't display the page-variable, because the onrender-function is called only after every html-page and not after every pdf-page.
I can't set a pagebreakinterval, because the rowheigt can't be predicted.
Configuration:
Birt 2.6.0
Seperate Run and Render
PDF-Output
We can't give our reports to our customers as long as this bug is present.
Peter
Find more posts tagged with
Comments
thuston
Here is an example of how this can be done for the HTML pages.
You need to work on how to dynamically cause pages breaks so your HTML pages match your PDF pages.
scowsailor
Does this work for anyone else? The total page count for each group is always 0. Also there are errors when viewed through with Preview...
The following items have errors:
Data (id = 252):
+ There are errors evaluating script "var map = reportContext.getPersistentGlobalVariable( "pageNumMap" );
this.setDisplayValue( map.get( 'Table1' ) );":
TypeError: Cannot call method "get" of null (/report/body/table[
@id="
;9"]/detail/row[
@id="
;203"]/cell[
@id="
;204"]/grid[
@id="
;213"]/row[
@id="
;218"]/cell[
@id="
;222"]/data[
@id="
;252"]/method[
@name="
;onRender"]#2
Data (id = 253):
+ There are errors evaluating script "var map = reportContext.getPersistentGlobalVariable( "pageNumMap" );
this.setDisplayValue( map.get( 'Table2' ) );":
TypeError: Cannot call method "get" of null (/report/body/table[
@id="
;67"]/detail/row[
@id="
;193"]/cell[
@id="
;194"]/grid[
@id="
;225"]/row[
@id="
;230"]/cell[
@id="
;236"]/data[
@id="
;253"]/method[
@name="
;onRender"]#2)
Data (id = 254):
+ There are errors evaluating script "var map = reportContext.getPersistentGlobalVariable( "pageNumMap" );
this.setDisplayValue( map.get( 'Table3' ) );":
TypeError: Cannot call method "get" of null (/report/body/table[
@id="
;125"]/detail/row[
@id="
;183"]/cell[
@id="
;184"]/grid[
@id="
;237"]/row[
@id="
;242"]/cell[
@id="
;248"]/data[
@id="
;254"]/method[
@name="
;onRender"]#2)
scowsailor
Just noticed the setPersistenGlobalVariable("pageNumMap") is called in the report's afterFactory event which from what I can tell is nearly the last possible event. In an earlier event i.e. Table1.DetailRow... onRender, it's calling getPersistentGlobalVarible("pageNumMap"). This is one of the offending lines of javascript which makes sense since pageNumMap (it seems to me) is undfined at this point.<br />
<br />
Where should the <strong class='bbc'>set</strong>PersistentGlobalVariable method be called?
thuston
afterFactory occurs before OnRender for separate runtask and rendertask.
runandrendertask does not seem to work with my example.
scowsailor
Thurston,
thanks for taking time to reply.
I based my earlier observations on a suggestion for "Determining method execution sequence" from this site:
http://www.linuxtopia.org/online_books/eclipse_documentation/eclipse_birt_report_guide/topic/org.eclipse.birt.doc/birt/eclipse_birt_report_ScriptingWithJavaScript.22.2.html
I made these observations while running the report via the Preview and also the Run As PDF features from Eclipse. Is there different behavior when the report is deployed through a webapp?
Regards,
Bruce Hansen
thuston
Try Web Viewer and it should work. The different options in the designer seem to use one or the other. The WebApp would be your choice since you wrote it.
Peter P.
Thurston,
In your example you are setting the page-break-interval
I can't use this property (I set it to 0), because the heights of the rows in my report are variable (some rows display extra information while other rows hide this info).
Peter