Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Center body between header&footer of mp
germobirt
Hi,<br />
<br />
I'm using Birt 2.6.2 with Javascript.<br />
<br />
I've a report with fixed layout, using a masterpage with header and footer,<br />
I try to center the content of the body (a grid) between header and footer.<br />
<br />
But in the pdf the grid of the body is always close under the header and leaves much empty space to the footer.<br />
<br />
Like this example left. The example right is what I need :<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
############### ###############
HEADER HEADER
############### ###############
a grid with
rows and cells
>> a grid with
>> rows and cells
############### ###############
FOORTER FOORTER
############### ###############</pre>
<br />
How can i reach that the empty space between header/grid & grid/footer is the same?<br />
<br />
<br />
regards<br />
germobirt
Find more posts tagged with
Comments
bricombs
Good Day
Could you please upload your sample report that has the centering issue.
germobirt
Hi,
don't know why, but upload failed with 'Error This upload failed'.
I've made a small demo report, so copy&paste of source code in this post is maybe acceptable in this case.
regards germobirt
<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="
http://www.eclipse.org/birt/2005/design"
; version="3.2.22" id="1">
<property name="author">germobirt</property>
<property name="createdBy">Eclipse BIRT Designer Version 2.6.2.r262_v20110209 Build <2.6.2.v20110214-1523></property>
<html-property name="description">Grid in Body is not centered between header and footer</html-property>
<property name="units">cm</property>
<property name="iconFile">/templates/blank_report.gif</property>
<property name="bidiLayoutOrientation">ltr</property>
<property name="imageDPI">96</property>
<styles>
<style name="report" id="4">
<property name="fontFamily">sans-serif</property>
<property name="fontSize">10pt</property>
</style>
<style name="crosstab-cell" id="5">
<property name="borderBottomColor">#CCCCCC</property>
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">1pt</property>
<property name="borderLeftColor">#CCCCCC</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">1pt</property>
<property name="borderRightColor">#CCCCCC</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">1pt</property>
<property name="borderTopColor">#CCCCCC</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">1pt</property>
</style>
<style name="crosstab" id="6">
<property name="borderBottomColor">#CCCCCC</property>
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">1pt</property>
<property name="borderLeftColor">#CCCCCC</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">1pt</property>
<property name="borderRightColor">#CCCCCC</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">1pt</property>
<property name="borderTopColor">#CCCCCC</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">1pt</property>
</style>
</styles>
<page-setup>
<simple-master-page name="Simple MasterPage" id="2">
<page-header>
<grid id="7">
<property name="borderBottomColor">#000000</property>
<property name="borderBottomStyle">solid</property>
<property name="borderLeftColor">#000000</property>
<property name="borderLeftStyle">solid</property>
<property name="borderRightColor">#000000</property>
<property name="borderRightStyle">solid</property>
<property name="borderTopColor">#000000</property>
<property name="borderTopStyle">solid</property>
<column id="8"/>
<row id="9">
<cell id="10">
<label id="11">
<property name="textAlign">center</property>
<text-property name="text">HEADER</text-property>
</label>
</cell>
</row>
</grid>
</page-header>
<page-footer>
<grid id="12">
<property name="borderBottomColor">#000000</property>
<property name="borderBottomStyle">solid</property>
<property name="borderLeftColor">#000000</property>
<property name="borderLeftStyle">solid</property>
<property name="borderRightColor">#000000</property>
<property name="borderRightStyle">solid</property>
<property name="borderTopColor">#000000</property>
<property name="borderTopStyle">solid</property>
<column id="13"/>
<row id="14">
<cell id="15">
<label id="16">
<property name="textAlign">center</property>
<text-property name="text">FOOTER</text-property>
</label>
</cell>
</row>
</grid>
</page-footer>
</simple-master-page>
</page-setup>
<body>
<grid id="17">
<property name="borderBottomColor">#FF0000</property>
<property name="borderBottomStyle">solid</property>
<property name="borderLeftColor">#FF0000</property>
<property name="borderLeftStyle">solid</property>
<property name="borderRightColor">#FF0000</property>
<property name="borderRightStyle">solid</property>
<property name="borderTopColor">#FF0000</property>
<property name="borderTopStyle">solid</property>
<property name="height">7.3289583333333335cm</property>
<column id="18"/>
<row id="19">
<property name="height">7.3289583333333335cm</property>
<property name="verticalAlign">middle</property>
<cell id="20">
<label id="22">
<property name="color">#FF0000</property>
<property name="textAlign">center</property>
<text-property name="text">BODY</text-property>
</label>
</cell>
</row>
</grid>
</body>
</report>
bricombs
Good Day
Thanks for the sample. After testing I found the following bug reports:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=289702
https://bugs.eclipse.org/bugs/show_bug.cgi?id=271984
If I leave the row height fixed then PDF looks correct but HTML does not. If I change the row height to 100% then the HTML looks correct but the PDF does not.
Looks like the bug is not fully fixed.
germobirt
Hi,
I tried it again with the latest version 4.2.2. But same result.
Yes, the output differs between pdf and html.
In html there is no space at all between header/body/footer.
So you can say its better, but that is no page size like A4 or US Letter.
Nevertheless I need pdf and I don't think that pdf is correct with fixed height.
Don't know why, pdf upload is possible, report file not.
As you can see the red frame is still clutched under the header and far away of beeing in the middle of the page. The red frame shall not touch the header & the footer frame.
It shall, with ist current dimensions, just be in the middle of the page.
No matter how tall footer or header is.
If this is really a bug, shall I open a bug call somehow.
Or is there a workaround possible to get the body in the middle of a pdf?
regards
germobirt
bricombs
Good Day
Ok I think I understand. For PDF output I was able to get it working. I used a grid in a grid. For HTML output it does not work compleatly due to the bug from my previous post.
I have attached my sample.
You can always go to Bugzilla to create or search for bug reports.
https://bugs.eclipse.org/bugs/
germobirt
Hi,
and thanks for the example.
So, the conclusion is, you always need a full size grid (with 1 col) in your layout?
Only in a row/cell you can do positioning?
It's not possible to align the 'main grid', right?
best regards
germobirt
bricombs
Good Day
That is my understanding.