Jump to content

BIRT Developer Center Download


Photo
- - - - -

Pagenumber variable is not updating with dynamic page change


  • Please log in to reply
2 replies to this topic

#1 anitaV

anitaV

    Member

  • Members
  • PipPip
  • 15 posts

Posted 10 August 2017 - 02:54 AM

On page footer, I need to display a image with a set of data on the basis of data that I received from data set. But the data in the image will change on different pages. For example I got 8 number of data from data set (rest API data set) and I need to display 6 data in image on 1st page and rest 2 data on 2nd page. I have written script on image render event on the basis of page number to pass the data and on layout I have taken a table at the last of all content with page break interval=1. This script is working if page content is coming in one page. But the issue is coming when the page content is displaying in more that one page. Because I can not add page break in between of my content so page number variable is not being updated. So the first two pages are displaying the same data in image and then data changes on the third page. Script on image render: ----------------------- var b_params = ""; var LBL_STRING = reportContext.getPersistentGlobalVariable("LABELS"); var sp_count = parseInt(pageNumber - 1) * 6 + 0; var labels_array = LBL_STRING.split("~"); var nLABEL = reportContext.getPersistentGlobalVariable("NLABELS"); if (nLABEL > 0 ) { var spc =(labels_array[sp_count] && labels_array[sp_count] != null) ? labels_array[sp_count] : ""; b_params += '&sp1='+ encodeURI(spc.split('&').join('amp;')); sp_count++; var spc =(labels_array[sp_count] && labels_array[sp_count] != null) ? labels_array[sp_count] : ""; b_params += '&sp2='+ encodeURI(spc.split('&').join('amp;')); sp_count++; var spc =(labels_array[sp_count] && labels_array[sp_count] != null) ? labels_array[sp_count] : ""; b_params += '&sp3='+ encodeURI(spc.split('&').join('amp;')); sp_count++; var spc =(labels_array[sp_count] && labels_array[sp_count] != null) ? labels_array[sp_count] : ""; b_params += '&sp4='+ encodeURI(spc.split('&').join('amp;')); sp_count++; var spc =(labels_array[sp_count] && labels_array[sp_count] != null) ? labels_array[sp_count] : ""; b_params += '&sp5='+ encodeURI(spc.split('&').join('amp;')); sp_count++; var spc =(labels_array[sp_count] && labels_array[sp_count] != null) ? labels_array[sp_count] : ""; b_params += '&sp6='+ encodeURI(spc.split('&').join('amp;')); sp_count++; } var host_url = params["host"].value; var img_url = ""; var img ="/reqprn/frm/birt/label/birt_ucmc_label.php?" + b_params; img_url= "http://"+vars["ServerPath"]+ img; this.URI = img_url;

#2 anitaV

anitaV

    Member

  • Members
  • PipPip
  • 15 posts

Posted 10 August 2017 - 08:53 PM

I had integrated the BIRT reports in my PHP web application using the birt report URL. For example:

 

http://<server address>/birt-viewer/preview?__report=order/frm/reqprn/uimc/frm.rptdesign&__showtitle=false&__format=pdf&<my params>

 

If I use frameset (like below URL) in place of preview in my call then the page number issue is being fixed.

 

http://<server address>/birt-viewer/frameset?__report=order/frm/reqprn/ucmc/frm.rptdesign&__showtitle=false&__format=pdf&<my params>

 

Can someone please tell me what is the difference between preview and frameset. Is it wrong if I use frameset in place of preview? OR is there any performance degradation in this?

 

Any help will be appreciable.



#3 anitaV

anitaV

    Member

  • Members
  • PipPip
  • 15 posts

Posted 11 August 2017 - 12:54 AM

Not Fixed :(

 

Extra pages are coming now because I have added a table at the end of the page to add page break if images are more than 1.