Page number expression not updated in dynamic text in header
Options
<p>Hi,</p><p> </p><p> I'm using the latest birt and trying to write a custom page number expression for my master page header with a dynamic text expression 'Page ' + pageNumber + ' (' + totalPage + ')' but for some reason it shows Page 1 (1) on all pages. Any suggestions or workarounds? I'd prefer not to have a grid with multiple autotext-items etc.</p><p> </p><p>Thanks in advance,</p><p> Nik</p>
0
Comments
-
<p>Pardon my noobishness but how can I tell? I just dropped the dynamic text from the palette into the header of the master page. But yes, it looks like it is only evaluated once or something. Need to read up on the topic, I recall seeing (after my initial post) one thread with those phases mentioned in the context of page numbers...</p>0
-
<p>In your master page, click on your dynamic text element, then click the script tab at the bottom. At the top you should see a drop down with different methods. You can choose onPrepare, onCreate, or onRender. You might want to take a look at <a data-ipb='nomediaparse' href='http://www.eclipse.org/birt/phoenix/deploy/reportScripting.php'>this page</a>, it has a pretty good explanation of when the methods are called.</p>Warning No formatter is installed for the format ipb0
-
<p>Hi,</p><p> </p><p> Thanks for the pointers, I tried to assign the string to this.text in the onRender but I still see the 1 (1) on all pages. If I do a this.text='foo'; it works so I guess the code works but it's still not being called when it should.</p><p> </p><p>--Nik</p>0
-
<p>Strange. I noticed that it works for the web viewer but not when I render a PDF directly. It's starting to look like </p><p> </p><p><a data-ipb='nomediaparse' href='http://www.birt-exchange.org/forum/index.php?/topic/21679-pagenumber-and-totalpage-in-layout-conditional-text-depending-on-pagenumber-in-pdf/'>http://www.birt-exchange.org/forum/index.php?/topic/21679-pagenumber-and-totalpage-in-layout-conditional-text-depending-on-pagenumber-in-pdf/</a></p><p> </p><p>but that discussion goes into page breaks and I'm not sure I could distill information related to a simple solution from there.</p>0
-
<p>I used your code</p><pre class="_prettyXprint">this.text = 'Page ' + pageNumber + ' (' + totalPage + ')'</pre><p>In the onRender() of a dynamic text item in the header of my master page from 4.3. And it works in the WebViewer and if I export the report to PDF from the WebViewer it works fine. When getting the current and total pages the PDF needs to be ran with separate run and render tasks.</p><p> </p><p>Can you walk me through how you are rendering the PDF? Also can you recreate this with the sample db and post your rptdesign so I can test it on my side?</p>Warning No formatter is installed for the format ipb0
Categories
- All Categories
- 109 Developer Announcements
- 49 Articles
- 100 General Questions
- 122 IM Services
- 40 OpenText Hackathon
- 31 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 897 Cloud Fax and Notifications
- 77 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 122 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management