| Page N of M [message #662999] |
Fri, 01 April 2011 17:24  |
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   |
|
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
Regards,
Michael Williams
BIRT Exchange
Michael's BIRT Blog
|
|
|
|
|
|
| Re: Page N of M [message #663519 is a reply to message #663439] |
Tue, 05 April 2011 09:26   |
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  |
Anthony Ku Ong Messages: 3 Registered: July 2009 |
Junior Member |
|
|
JulioC wrote on Tue, 05 April 2011 09:26Jani wrote on Tue, 05 April 2011 01:14JulioC wrote on Fri, 01 April 2011 17:24I'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);
}
|
|
|
Powered by
FUDForum. Page generated in 0.01870 seconds