|
Re: Page headers depending upon the page number [message #714498 is a reply to message #714349] |
Wed, 10 August 2011 16:32 |
|
Currently you can not change the master page while a table is
processing. You should be able to use page variables and scripts to
alter the values that appear on a master page or use row count filtering
to add two or more tables that are the same and put them on different
master pages. For example table1 could list the first 20 customers and
table2 could list the rest. Then assign each table to a different
master page.
Jason
On 8/10/2011 7:48 AM, sam wrote:
> Hi All
>
> I have a report where the first page has a header and all other
> subsequent pages have a different header. I know we can specify master
> page per table. But how do we specify by page ?
>
> Thanks everyone in advance
|
|
|
|
Re: Page headers depending upon the page number [message #714911 is a reply to message #714879] |
Thu, 11 August 2011 18:07 |
|
If you are using 3.7 you can add a grid to the master page header with
two rows. Put two new grids in each of the rows and set an onRender
script like:
//first nested grid
if( pageNumber > 1 ){
this.getStyle().display = "none";
}
//second nested grid
if( pageNumber == 1 ){
this.getStyle().display = "none";
}else{
this.getStyle().display = "block";
}
See attached example
Jason
On 8/11/2011 12:40 PM, sam wrote:
> Is there a way to manipulate the visibility of the page headers.
> What I mean is, I will have two grids in the header of the master page.
> One for the first page and second for the rest of the pages. Can I code
> in the visibility script of the grids such that each one will be shown
> appropriately. Something like below
> if (pageNumber == 1)
> true;
> else
> false;
>
> I tried the above but doesnt seem to work.
>
> I tried another way.
>
> In the pageStart / pageEnd scripts of the master page, I tried the
> following code.
> importPackage
> (Packages.org.eclipse.birt.report.engine.api.script.instance);
>
> var pageHeaderGridNo;
> if (pageNumber == 1) {
> pageHeaderGridNo = "partialHeader";
> }
> else {
> pageHeaderGridNo = "fullHeader";
> }
> var reportItem = null;
> for (i = 0; i < this.getInstancesByElementName(pageHeaderGridNo).length;
> i++) {
> reportItem = this.getInstancesByElementName(pageHeaderGridNo)[i];
> reportItem.setWidth("0in");
> reportItem.setHeight("0in");
> }
>
> But both of them didnt work. Basically I need one header for the first
> page and another header for the rest of the pages
>
> Thanks
>
|
|
|
Re: Page headers depending upon the page number [message #715020 is a reply to message #714911] |
Fri, 12 August 2011 05:53 |
sam va Messages: 121 Registered: July 2011 |
Senior Member |
|
|
thanks a lot. It does work with 2.6.2. But there is one issue here in PDF. HTML is fine.
Lets say the first grid takes 10 inches and second grid 5 inches, the total space occupied in the output is 15 inches. But on page 1 I need the header to occupy only 10 inches and on the second page 5 inches. Is there anyway we can change the header height dynamically ?
Thanks
[Updated on: Fri, 12 August 2011 07:11] Report message to a moderator
|
|
|
|
|
Re: Page headers depending upon the page number [message #720362 is a reply to message #720249] |
Tue, 30 August 2011 13:09 |
|
Which code? This one?
if( pageNumber > 1 ){
this.getStyle().display = "none";
}
Jason
On 8/30/2011 4:25 AM, sam wrote:
> I have 2 master pages (one for portrait and one for landscape).
> This code (not the attachment in this forums, but the one I coded) works
> in portrait but doesnt work in landscape
> Any clues
>
> Thanks
> Swamy
|
|
|
|
|
|
Re: Page headers depending upon the page number [message #721162 is a reply to message #721024] |
Thu, 01 September 2011 04:12 |
|
This does indeed appear to be a bug in 2.6.2. It appears to be fixed in
3.7. The events are not being fired correctly for landscape. This has
to do with pagebreak interval as set on the table. When you are in
landscape you have less room for vertical rooms so the pagebreakinterval
is never hit and the events do not fire. Set your page break interval
lower and it should work. In 3.7 this works with a pagebreakinterval of 0.
Jason
On 8/31/2011 2:04 PM, vavesw wrote:
> Pl see the attached zip file.
> Run the following reports
> /ccer/resources/templates/OfflineLandscape.rpttemplate
> /ccer/resources/templates/OfflinePortrait.rpttemplate
>
> Run it in Web Viewer. HTML is fine for both the reports. But for PDF landscape, it doesnt work. Both headers show up for page numbers greater than 1.
>
> Thanks
|
|
|
|
|
|
|
Re: Page headers depending upon the page number [message #721401 is a reply to message #721392] |
Thu, 01 September 2011 16:21 |
|
In 3.7 it should be fine, but if you can not upgrade:
Does the dynamic content appear on page 1?
Jason
On 9/1/2011 12:17 PM, vavesw wrote:
> Apologize. I did see that this is in the table property.
> There is one issue using this property. I have some dynamic text
> controls and I do not know how many rows each page will occupy. Is there
> any other way out of this?
>
> Thanks
|
|
|
|
|
Re: Page headers depending upon the page number [message #721431 is a reply to message #721421] |
Thu, 01 September 2011 18:15 |
|
You can insert page breaks dynamically but the issue is we have no way
to get the currently generated vertical space. If you could figure out
how may lines the dynamic content is going to take, you could implement
your own page break which would fire the appropriate events.
Jason
On 9/1/2011 1:49 PM, vavesw wrote:
> Tried another option
>
> Moved all the controls into one grid.
> In the OnRender method, set the display style to none/block
> appropriately. Looks like the same issue is there for landscape pdf.
> Thanks
>
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06028 seconds