ZEN.report and page number format

105 views
Skip to first unread message

wesselch

unread,
Dec 1, 2008, 11:11:35 AM12/1/08
to InterSystems: Zen Community
Hello,

I tried to format a special item by common display attributes, I guess
it doesn't work.

<pageheader>
<item special="page-number-/" style="text-align:center;font-size:11;">
<caption value="Page " style="text-align:center;"/>
</item>
</pageheader>

What's wrong?


Trying to renew a report now with ZEN, christian

Jonathan Levinson

unread,
Dec 1, 2008, 5:16:49 PM12/1/08
to InterSys...@googlegroups.com
What doesn't work? Can you describe the problem in more detail?

Is this for PDF?

From the documentation:

<pageheader>
The <pageheader> element, if present in the <report>, must occur before
the <body> element.
<pageheader> can contain the same layout and display elements as <body>,
but everything contained within the <pageheader> is rendered in the
blank space provided by the <document> element headerHeight attribute.
If you want your report to display a page header in the PDF report
output, you must provide all of the following in your XData
ReportDisplay block:
A <document> element with a headerHeight value
A <pageheader> element
XHTML reports do not support page-by-page headers, so in XHTML reports
the contents of <pageheader> are simply rendered at the beginning of the
report.

Did you specify a document element?

From the documentation:

headerHeight HTML length value that specifies a block of empty space to
be reserved beneath the top margin, but above the main body of the
report. headerHeight should be specified if this report has a
<pageheader> element indicating a header to appear on every page

Best Regards,
Jonathan S. Levinson
Senior Software Developer
Object Group
InterSystems
617-621-0600

Christian Wessel

unread,
Dec 2, 2008, 3:56:32 AM12/2/08
to InterSys...@googlegroups.com
Hello,

yes, I specify the document element:
...
XData ReportDisplay [ XMLNamespace = "http://www.intersystems.com/zen/report/display" ]
{
<report xmlns="http://www.intersystems.com/zen/report/display"
name="MyReport" title="Title">
<document width="29.7cm"
height="21.0cm"
marginLeft="1.5cm"
marginRight="1.5cm"
marginTop="1.0cm"
marginBottom="1.0cm"
headerHeight="1.5cm">
</document>
<pageheader>
<p style="text-align:center;text-decoration:underline;font-size:18;font-weight:bold">
Text1
</p>
<p style="text-align:center;text-decoration:underline;font-size:11;font-weight:bold">
Text2
</p>
<item special="page-number-/" style="text-align:right;font-size:11;">
<caption value="Page " style="text-align:center;"/>
</item>
</pageheader>
<body>
<group name="SalesRep" pagebreak="1">
<table orient="row" width="10cm">
<item field="@name" width="5cm">
<caption value="Sales Rep:"/>
</item>
<item field="@date" width="5cm">
<caption value="Abrechnung per: "/>
</item>
<item field="total" formatNumber="##0">
<caption value="Total Value of Sales:"/>
</item>
<item field="average" formatNumber="##0.00">
<caption value="Average Individual Sale:"/>
</item>
<item field="clients">
<caption value="Number of Clients:"/>
</item>
</table>
<line></line>
<table orient="col" group="SalesTo" altcolor="#FFDFDF" width="13cm">
<item field="customer" width="6cm">
<caption value="Customers:"/>
</item>
<line></line>
<item field="@date" width="4cm" style="text-align:center;">
<caption value="Date of Sale:" style="text-align:center;"/>
</item>
<item field="@amount" width="3cm" style="text-align:right;">
<caption value="Nb of Sales:" style="text-align:right;"/>
</item>
</table>
<table orient="row" width="13cm">
<item field="total" style="text-align:right;" width="3cm">
<caption value="Total" style="text-align:right;" width="10cm"/>
</item>
</table>
<line></line>
</group>
</body>
</report>
}
...

I call the report by browser with $MODE=pdf.
I want to create the report with a header contained the report title, subtitle (both centered) and a page number. I get the page number but without defined style (I get it in default style) and missing caption value. Each other items are well printed.

News for Newbies, christian

>>> "Jonathan Levinson" <Jonathan...@intersystems.com> 01.12.2008 23:16 >>>

Jonathan Levinson

unread,
Dec 2, 2008, 9:01:45 AM12/2/08
to InterSys...@googlegroups.com
Did you construct this example using our SAMPLES database?

If so, please send me the XML for the report so I can run it myself.

If not please send me the classes, I need to run the report, and the
.gof to populate the classes with data, as well as the report itself.

Best Regards,
Jonathan S. Levinson
Senior Software Developer
Object Group
InterSystems
617-621-0600

-----Original Message-----
From: InterSys...@googlegroups.com
[mailto:InterSys...@googlegroups.com] On Behalf Of Christian Wessel
Sent: Tuesday, December 02, 2008 3:57 AM
To: InterSys...@googlegroups.com
Subject: Antw: [InterSystems-Zen] Re: ZEN.report and page number format


Hello,

Jonathan Levinson

unread,
Dec 2, 2008, 10:38:22 AM12/2/08
to InterSys...@googlegroups.com
I took the example and you sent me and modified it as follows:

<item special="page-number-/" width="2cm"
style="color:red;font-size:11pt">
<caption value="Page:" width="3cm"/>
</item>
</table>

The page number did appear as red and the font-size became 11 points.
So styles seem to be working.

If you substitute the above into your report and it does not work as I
just described, then it becomes relevant on what version of Cache' or
Ensemble you are. We need to know. Maybe a later bug fix corrected
this area.

I wonder about things like the following in your report:

<item field="pTime" style="text-align:right;font-size:9;">

Notice the "naked" 9. Look on page 321 of Doug Lovell's book XSL
Formatting Objects Developer's Handbook. No mention is made of a
default metric. He says length units are pt, pc, in, cm, mm, px, em
(points, picas, inches, centimeters, millimeters, pixels and em-box
size). He is talking about XSL-FO which is used to generate PDFs. I
highly recommend this book. Instead of naked 9 I would try something
like 9pt (9 points).

Best Regards,
Jonathan S. Levinson
Senior Software Developer
Object Group
InterSystems
617-621-0600


-----Original Message-----
From: InterSys...@googlegroups.com
[mailto:InterSys...@googlegroups.com] On Behalf Of Christian Wessel
Sent: Tuesday, December 02, 2008 3:57 AM
To: InterSys...@googlegroups.com
Subject: Antw: [InterSystems-Zen] Re: ZEN.report and page number format


Hello,

Christian Wessel

unread,
Dec 2, 2008, 10:52:37 AM12/2/08
to InterSys...@googlegroups.com
Hello Jonathan,

after replacing the style section by your example the item apears in
red color. The problem was/is alignment, not color or font-size.

In HTML it looks better, the PDF looks sad. I need something like the
following:

------------------------------------------------------------------------------------------------
| | Title |
---------------------------------- |
| | Subtitle | |
| | |
| | |
---------------------------------- |
| | | |
| | |
| | |
---------------------------------- |
------------------------------------------------------------------------------------------------

How to create this?

I add the metrics, no different behaviour.

I have installed Caché Version 2008.1 (Build 578).

christian

>>> "Jonathan Levinson" <Jonathan...@intersystems.com> 02.12.2008
16:38 >>>

Jonathan Levinson

unread,
Dec 2, 2008, 11:20:06 AM12/2/08
to InterSys...@googlegroups.com
Here is my solution to getting Page and page number together and centered. There may be better solutions. My advice is to patiently play with various combinations till you find one that works. Note I use an inner centered table. The "Page" and "page number" are in separate columns. The "Page" "caption" is aligned right and the "page number" is aligned left. Instead of using the "caption" nested element, I am using columns in table whose orientation is "col."

<pageheader>
<header>
<table orient="row" align="right" style="text-align:right;font-size:9;">
<item field="pDate" style="text-align:right;font-size:9;">
<caption value="Date:"/>
</item>
<item field="pTime" style="text-align:right;font-size:9;">
<caption value="Time:"/>
</item>
<table orient="col" style="text-align:center;width:3in">
<item value="Page: " style="text-align:right" />
<item special="page-number-/" style="font-size:11pt;text-align:left;">

</item>
</table>
</table>
<p style="font-family:Arial,sans-serif;text-align:center;text-decoration:underline;font-size:18;font-weight:bold">
Title
</p>
<p style="font-family:Arial,sans-serif;text-align:center;font-size:11;font-weight:bold">
Subtitle
</p>
</header>
</pageheader>

Christian Wessel

unread,
Dec 3, 2008, 5:39:57 AM12/3/08
to InterSys...@googlegroups.com
Good morning Caché,

I got a solution by night :-). I build a col oriented table contained
three further tables:
Left field with a row oriented table with just a blank line (just for
the FOP)
Middle field with a row oriented table with two items without
captions.
And the right field contain a row oriented table with three items
include caption.
The result is what we wanted.
Thanx for help and ideas.

<pageheader>
<header>
<table orient="col" width="29cm">
<table orient="row" width="5cm" align="center">
<line pattern="empty"></line>
</table>
<table orient="row" width="18cm" align="center">
<item field="title"
style="text-align:center;text-decoration:underline;font-family:Arial,sans-serif;font-size:20;font-weight:bold;">

</item>
<item field="subTitle"
style="text-align:center;font-family:Arial,sans-serif;font-size:14">

</item>
</table>
<table orient="row" width="4cm" align="right"
style="text-align:right;font-size:9;">
<item field="pDate">
<caption value="Date:"/>
</item>
<item field="pTime">
<caption value="Time:"/>
</item>
<item special="page-number-/">
<caption value="Page:"/>
</item>
</table>
</table>
</header>
</pageheader>


>>> "Jonathan Levinson" <Jonathan...@intersystems.com> 02.12.2008
17:20 >>>
Reply all
Reply to author
Forward
0 new messages