Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Page N of M
Page N of M [message #662999] Fri, 01 April 2011 17:24 Go to next message
JulioC Missing name is currently offline JulioC Missing name
Messages: 33
Registered: March 2011
Location: Ottawa, Canada
Member
Hi All

I'm trying to put in the footer of my master page the variables Page and TotalPageCount
So for that I add a grid with just one column one row, then I aligned it to the left..I was able to do that, but it shows like this
1
of
1

I want this instead 1/1

If I use Page n of m i got something like this
1 of 1

I couldn't get rid of the spaces ....

Thanks in advance for your help.


JulioC.
Re: Page N of M [message #663356 is a reply to message #662999] Mon, 04 April 2011 14:44 Go to previous messageGo to next message
Michael Williams is currently offline Michael Williams
Messages: 1560
Registered: July 2009
Senior Member

For the grid where you have one column and one row, select each item and go to the general tab in the property editor and change the "display" setting from "block" to "inline". This should get them on the same row. Let me know.

Regards,

Michael
www.birt-exchange.org


Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Re: Page N of M [message #663364 is a reply to message #663356] Mon, 04 April 2011 15:19 Go to previous messageGo to next message
JulioC Missing name is currently offline JulioC Missing name
Messages: 33
Registered: March 2011
Location: Ottawa, Canada
Member
Michael wrote on Mon, 04 April 2011 14:44
For the grid where you have one column and one row, select each item and go to the general tab in the property editor and change the "display" setting from "block" to "inline". This should get them on the same row. Let me know.

Regards,

Michael
www.birt-exchange.org



Hi Michael

That worked......you know little things that I'm just learning...


Thanks a lot......

Re: Page N of M [message #663366 is a reply to message #663364] Mon, 04 April 2011 15:23 Go to previous messageGo to next message
Michael Williams is currently offline Michael Williams
Messages: 1560
Registered: July 2009
Senior Member

You're very welcome! Smile

Michael
http://www.birt-exchange.org - (forums, examples, getting started guides)


Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Re: Page N of M [message #663439 is a reply to message #662999] Tue, 05 April 2011 01:14 Go to previous messageGo to next message
Jani  is currently offline Jani
Messages: 14
Registered: April 2011
Junior Member
JulioC wrote on Fri, 01 April 2011 17:24
I'm trying to put in the footer of my master page the variables Page and TotalPageCount



Where do you find those Page and TotalPageCount variables ? I tried to search BIRT Report Designer help without success.

I also found following code snippet:

<page-footer>
  <text id="403">
    <property name="textAlign">right</property>
    <method name="onRender">
      this.text = "Page " + pageNumber + " of " + totalPage;
    </method>
    <property name="contentType">html</property>
  </text>
</page-footer>


No idea where those pageNumber and totalPage comes from or how to build such footer with Report Designer thought.
Re: Page N of M [message #663519 is a reply to message #663439] Tue, 05 April 2011 09:26 Go to previous messageGo to next message
JulioC Missing name is currently offline JulioC Missing name
Messages: 33
Registered: March 2011
Location: Ottawa, Canada
Member
Jani wrote on Tue, 05 April 2011 01:14
JulioC wrote on Fri, 01 April 2011 17:24
I'm trying to put in the footer of my master page the variables Page and TotalPageCount



Where do you find those Page and TotalPageCount variables ? I tried to search BIRT Report Designer help without success.

I also found following code snippet:

<page-footer>
  <text id="403">
    <property name="textAlign">right</property>
    <method name="onRender">
      this.text = "Page " + pageNumber + " of " + totalPage;
    </method>
    <property name="contentType">html</property>
  </text>
</page-footer>


No idea where those pageNumber and totalPage comes from or how to build such footer with Report Designer thought.


Hi
First of all I'm using BIRT 2.6.2
In your report go to the master page
Then choose the palette tab tools, there you will see the autotext variables, under it you have a bunch of variables that you can use in your master page only.

Thanks for the code, I believe it will work when is used in the layout of the report.
Regards
JulioC.

[Updated on: Tue, 05 April 2011 09:27]

Report message to a moderator

Re: Page N of M [message #670446 is a reply to message #663519] Sat, 14 May 2011 01:05 Go to previous message
Anthony Ku Ong is currently offline Anthony Ku Ong
Messages: 3
Registered: July 2009
Junior Member
JulioC wrote on Tue, 05 April 2011 09:26
Jani wrote on Tue, 05 April 2011 01:14
JulioC wrote on Fri, 01 April 2011 17:24
I'm trying to put in the footer of my master page the variables Page and TotalPageCount


Where do you find those Page and TotalPageCount variables ? I tried to search BIRT Report Designer help without success.

I also found following code snippet:

<page-footer>
  <text id="403">
    <property name="textAlign">right</property>
    <method name="onRender">
      this.text = "Page " + pageNumber + " of " + totalPage;
    </method>
    <property name="contentType">html</property>
  </text>
</page-footer>


No idea where those pageNumber and totalPage comes from or how to build such footer with Report Designer thought.





Yes the top fragment will work when you attach this on the footer of
the master page, under scripting , and onRender event. Equivalently this code
is similar to something I wrote here

public void createPageFooterUsingScripting() throws SemanticException{
		SimpleMasterPageHandle masterPageHandle = design.getElementFactory().newSimpleMasterPage(null);
		GridHandle footerGrid = design.getElementFactory().newGridItem(null/* name */,1 , 1 );
		ColumnHandle colHandle = (ColumnHandle) footerGrid.getColumns().get(0);
		RowHandle row01 = (RowHandle) footerGrid.getRows().get(0);
		CellHandle cell1 = (CellHandle) row01.getCells().get(0);
		TextItemHandle textItem = design.getElementFactory().newTextItem(null);
		textItem.setProperty(DesignChoiceConstants.CHOICE_TEXT_ALIGN, DesignChoiceConstants.TEXT_ALIGN_RIGHT);
		textItem.setContentType(DesignChoiceConstants.TEXT_CONTENT_TYPE_HTML);
		String pageFooterExpression = "this.text = \"Page \" + pageNumber  +  \" of \" + totalPage ";
		textItem.setOnRender(pageFooterExpression);
		cell1.getContent().add(textItem);
		masterPageHandle.getSlot(ISimpleMasterPageModel.PAGE_FOOTER_SLOT).add(footerGrid);
		design.getMasterPages().add(masterPageHandle);
	}

Previous Topic:how to use the validate event of parameter
Next Topic:BIRT Report Viewer
Goto Forum:
  


Current Time: Wed Aug 27 07:21:26 EDT 2014

Powered by FUDForum. Page generated in 0.03539 seconds