Access Footer Master Page
Options
Hi,
I recently had need to access the footer (Masterpage) programatically using API...
I tried for this method :
SimpleMasterPageHandle master = (SimpleMasterPageHandle) design.getMasterPages().getElementHandle();
Iterator<SlotHandle> itSlot = master.getPageFooter().getContents().iterator();
while (itSlot.hasNext()){
Object object = itSlot.next();
if (object instanceof GridHandle){
< MY CODE>
}
}
...but without success =(
Can you help me access the footer programatically? At my ".rtpdesign" i'm using only one MasterPage.
Thanks!
I recently had need to access the footer (Masterpage) programatically using API...
I tried for this method :
SimpleMasterPageHandle master = (SimpleMasterPageHandle) design.getMasterPages().getElementHandle();
Iterator<SlotHandle> itSlot = master.getPageFooter().getContents().iterator();
while (itSlot.hasNext()){
Object object = itSlot.next();
if (object instanceof GridHandle){
< MY CODE>
}
}
...but without success =(
Can you help me access the footer programatically? At my ".rtpdesign" i'm using only one MasterPage.
Thanks!
Warning
No formatter is installed for the format ipb
0
Comments
-
From script inside the report, it's something like:
reportContext.getDesignHandle().getMasterPages().get(0).getSlot(1);
This grabs the footer slot. Then, say if you wanted to drop the default date element that is in the footer, you'd do:
reportContext.getDesignHandle().getMasterPages().get(0).getSlot(1).drop(0);
What are you trying to do?Warning No formatter is installed for the format ipb0 -
Hi,<br />
<br />
thanks for the reply, it helped me a lot !<br />
<br />
I need to do by using the JAVA API, and used this method :<br />
<br />
Iterator<SlotHandle> iteratorObject = design.getMasterPages().get(0).getSlot(1).getContents().iterator();<br />
<p class='bbc_indent' style='margin-left: 40px;'>while (iteratorObject.hasNext()){</p>
<p class='bbc_indent' style='margin-left: 40px;'><p class='bbc_indent' style='margin-left: 40px;'>Object shContents = iteratorObject.next();</p></p>
<p class='bbc_indent' style='margin-left: 40px;'><p class='bbc_indent' style='margin-left: 40px;'>if (shContents instanceof GridHandle){</p></p>
<p class='bbc_indent' style='margin-left: 40px;'><p class='bbc_indent' style='margin-left: 40px;'><p class='bbc_indent' style='margin-left: 40px;'>GridHandle grid = (GridHandle) shContents;</p></p></p>
<p class='bbc_indent' style='margin-left: 40px;'><p class='bbc_indent' style='margin-left: 40px;'><p class='bbc_indent' style='margin-left: 40px;'>SlotHandle grRows = grid.getRows();</p></p></p>
<p class='bbc_indent' style='margin-left: 40px;'><p class='bbc_indent' style='margin-left: 40px;'><p class='bbc_indent' style='margin-left: 40px;'><MYCODE: Iterate over the Grid Cells></p></p></p>
<p class='bbc_indent' style='margin-left: 40px;'><p class='bbc_indent' style='margin-left: 40px;'><p class='bbc_indent' style='margin-left: 40px;'><strong class='bbc'>if (cellContents instanceof DataItemHandle)</strong>{</p></p></p>
<p class='bbc_indent' style='margin-left: 40px;'><p class='bbc_indent' style='margin-left: 40px;'><p class='bbc_indent' style='margin-left: 40px;'><p class='bbc_indent' style='margin-left: 40px;'>MYCODE: To verify if exists</p></p></p></p>
<br />
My goal is to make sure the bottom of all the templates (placed on the clients) there is a specific DataItemHandle. <br />
<br />
There is an easier way to find out whether a particular DataItemHandle exists in the template? Anything like : design.getBody().getAllDataItems()...<br />
<br />
Iterate the tables one by one cell and the cell search is a very complicated, even more complicated when we have a table inside another table ...<br />
<br />
Thanks.Warning No formatter is installed for the format ipb0 -
Thanks for the reply.
I knew this function... The problem is my element has no name :S I never used this feature in BIRT...
There is a function that return me all the elements of a given type ? (GridHandle, TableHandle, DataItemHandle)... help me greatly if there ...
ThanksWarning No formatter is installed for the format ipb0 -
If your element doesn't have a name, how are you going to determine that the element is indeed in the report?
This might allow you to grab all the elements:
reportContext.getDesignHandle().getDesign().getAllElements();Warning No formatter is installed for the format ipb0 -
Hi, <br />
<br />
I do not have this function , i'm using BIRT 3.7.1.<br />
<br />
<img src='https://lh4.googleusercontent.com/-QIy5D7PnkBY/T00bFpUwxbI/AAAAAAAAB18/G-AXBgoXMMY/s800/All3.jpeg' alt='Posted Image' class='bbc_img' /><br />
<br />
I tried using it but without success :<br />
<br />
Iterator<VariableElementHandle> itVariable = design.getAllVariables().iterator();<br />
while (itVariable.hasNext()){<br />
VariableElementHandle varElement = itVariable.next();<br />
System.out.println("VALUE : " + varElement.getValue());<br />
}<br />
<br />
ThanksWarning No formatter is installed for the format ipb0 -
Hi,
if I can have access to the element can test through the expression, anything like :
if (dataItem.getResultSetColumn() == "<myCode>" ) {
...
}
but do not have access to this function through the Java API :
reportContext.getDesignHandle().getDesign().getAllElements();
really need for a solution to this
ThanksWarning No formatter is installed for the format ipb0 -
<blockquote class='ipsBlockquote' data-author="'smgomes'" data-cid="96998" data-time="1330516930" data-date="29 February 2012 - 05:02 AM"><p>
Hi, <br />
<br />
if I can have access to the element can test through the expression, anything like : <br />
<br />
if (dataItem.getResultSetColumn() == "<myCode>" ) {<br />
...<br />
}<br />
<br />
but do not have access to this function through the Java API : <br />
reportContext.getDesignHandle().getDesign().getAllElements();<br />
<br />
really need for a solution to this <br />
<br />
Thanks<br /></p></blockquote>
<br />
I found this funtion : <strong class='bbc'>design.getModuleHandle().getModule().getAllElements();</strong><br />
<br />
and tried this:<br />
<br />
Iterator iterator = design.getModuleHandle().getModule().getAllElements().iterator();<br />
while (iterator.hasNext()){<br />
<p class='bbc_indent' style='margin-left: 40px;'>Object object = iterator.next();<br />
if (object instanceof DataItemHandle){</p>
<br />
<p class='bbc_indent' style='margin-left: 40px;'><p class='bbc_indent' style='margin-left: 40px;'>System.out.println("DataItem Founded!!");<br />
<br />
DataItemHandle dataItem = (DataItemHandle) object;<br />
System.out.println("Nome : " + dataItem.getName());<br />
System.out.println("Display Name : " + dataItem.getDisplayName());<br />
System.out.println("Display Label : " + dataItem.getDisplayLabel());<br />
System.out.println("Expression : " + dataItem.getResultSetColumn());</p></p>
<br />
<br />
But still doesn't work The message "DataItem Founded" never appears, it fails in "if condition"<br />
<br />
Can you help me?ThanksWarning No formatter is installed for the format ipb0 -
How deeply embedded can this element possibly be? Will it sometimes be the only element within the footer? Or will it always be embedded in a grid cell? Will it ever go further than that? Embedded within a grid, within the main grid? This can all be done by stepping through the grid cells after grabbing the masterpage footer, but it'd definitely be easier if you knew it would always be on the first level inside the main grid. I'll look at the AllElements() some more, too.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