You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Paige Balter <pa...@webpaigednd.com> on 2008/08/11 22:51:44 UTC

Repeating table/group headers on subsequent pages

The XML:

<?xml version="1.0" encoding="utf-8"?>
<PIPELINEREPORT>
<ROW ROWNUM="1">
  <Focus>Education</Focus>
  <Organization>ORG1</Organization>
  <Project>PRJ1</Project>
  <Status>STAT1</Status>
  <Primary_Sector></Primary_Sector>
  <Amount>$1.00</Amount>
  <Funding_Type>FT1</Funding_Type>
</ROW>
<ROW ROWNUM="2">
  <Focus></Focus>
  <Organization>ORG2</Organization>
  <Project>PRJ2</Project>
  <Status>STAT2</Status>
  <Primary_Sector></Primary_Sector>
  <Amount>$1.00</Amount>
  <Funding_Type>FT2</Funding_Type>
</ROW>
<ROW ROWNUM="3">
  <Focus></Focus>
  <Organization>ORG3</Organization>
  <Project>PRJ3</Project>
  <Status>STAT3</Status>
  <Primary_Sector></Primary_Sector>
  <Amount>$1.00</Amount>
  <Funding_Type>FT3</Funding_Type>
</ROW>
<ROW ROWNUM="4">
  <Focus>Inventor Support</Focus>
  <Organization>ORG4</Organization>
  <Project>PRJ4</Project>
  <Status>STAT4</Status>
  <Primary_Sector></Primary_Sector>
  <Amount>$1.00</Amount>
  <Funding_Type>FT4</Funding_Type>
</ROW>
<ROW ROWNUM="5">
  <Focus></Focus>
  <Organization>ORG5</Organization>
  <Project>PRJ5</Project>
  <Status>STAT5</Status>
  <Primary_Sector></Primary_Sector>
  <Amount>$1.00</Amount>
  <Funding_Type>FT5</Funding_Type>
</ROW>


The output I want:

Education
----------------------------------------------------------------------------------------------
| Organization | Project | Status | Primary Sector | Amount | Funding Type |
----------------------------------------------------------------------------------------------
ORG1              PRJ1    STAT1                               $1.00   FT1
----------------------------------------------------------------------------------------------
ORG2              PRJ2    STAT2                               $1.00   FT2
----------------------------------------------------------------------------------------------
ORG3              PRJ3    STAT3                               $1.00   FT3
----------------------------------------------------------------------------------------------
Inventor Support
----------------------------------------------------------------------------------------------
| Organization | Project | Status | Primary Sector | Amount | Funding Type |
----------------------------------------------------------------------------------------------
ORG4              PRJ4    STAT4                               $1.00   FT4
----------------------------------------------------------------------------------------------
ORG5              PRJ5    STAT5                               $1.00   FT5
----------------------------------------------------------------------------------------------

I have everything in place.  The last, crucial missing piece is, if, 
say, the report breaks between the ORG4 and ORG5 rows, how do I get the 
rows:

Inventor Support
----------------------------------------------------------------------------------------------
| Organization | Project | Status | Primary Sector | Amount | Funding Type |


To appear at the top of the next page?  I know table-header-markers 
aren't supported yet.  Is page markers the way to go?  If so, I am 
struggling with how to use them to get these results.

Thank you for any help you can give me.

~Paige
----------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


RE: Repeating table/group headers on subsequent pages

Posted by "Griffin,Sean" <SG...@CERNER.COM>.
After reading this over again I'm not sure you need to do the nested tables after all.  It looks like you want to print a new set of column headers at the same point in time as when you want a new group header, and if that's the case you can just create 2 rows inside one table-header.  So I interpret your algorithm needs to be explained like so:

 

1.       For each set of "ROW" elements inside a unique grouping of child "Focus" element values, create a table for that group where the "Focus" element value and the column headers for each child element under ROW whose name is not equal to "Focus" are placed into a table-header.

2.       Within the group created in step 1, create table-rows for each ROW

 

Using XSLT 2.0 you can do something like this to accomplish said algorithm:

 

<for-each-group select="//ROW" group-by="Focus">

    <table>

        <table-header>

            <table-row><table-cell><block><value-of select="Focus"/></block></table-cell></table-row>

            <table-row>

                <for-each select="*[local-name() != 'Focus']>

                    // Create cells for column headers

                </for-each>

            </table-row>

        </table-header>

        <table-body>

            <for-each select="current-group()">

                <table-row>

                    // Create cells for columns

                </table-row>

            </for-each>

        </table-body>

    </table>

</for-each-group>

 

If you're using XSLT 1.0 you can still accomplish the same thing but it's more difficult.  Google for "XSLT Muenchian" to find examples.

 

From: Paige Balter [mailto:paigeb@webpaigednd.com] 
Sent: Tuesday, August 12, 2008 1:12 PM
To: fop-users@xmlgraphics.apache.org
Subject: Re: Repeating table/group headers on subsequent pages

 

That is an intriguing idea, Sean, and just might work, thank you!

Do you build your tables with For-each statements (e.g.  <xsl:for-each select=".//ROW">)?  And how do you get the outer table's header to change with each new grouping?

Thanks, again!

~Paige

 

----------------------------------------------------------------------
CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.

Re: Repeating table/group headers on subsequent pages

Posted by Paige Balter <pa...@webpaigednd.com>.
That is an intriguing idea, Sean, and just might work, thank you!

Do you build your tables with For-each statements (e.g.  <xsl:for-each 
select=".//ROW">)?  And how do you get the outer table's header to 
change with each new grouping?

Thanks, again!

~Paige


Griffin,Sean wrote:
>
> Paige,
>
> I have to do the very same thing in my solution.  Just use nested 
> tables where each nested table gets its table-header.  So it would be 
> something like (obviously pseudo):
>
>  
>
> <table>
>
>   <table-header>Education</table-header>
>
>   <table-body>
>
>     <table>
>
>        <table-header>Organization | Project | Status</table-header>
>
>        <table-body>
>
>             ORG1 | PRJ1 | STAT1
>
>        </table-body>
>
>     </table
>   </table-body>
>
> </table>
>
>  
>
> -Sean
>
>  
>
> *From:* Paige Balter [mailto:paigeb@webpaigednd.com]
> *Sent:* Monday, August 11, 2008 6:12 PM
> *To:* fop-users@xmlgraphics.apache.org
> *Subject:* Re: Repeating table/group headers on subsequent pages
>
>  
>
> Thanks for your reply, Andreas.
>
> Sorry if my question was unclear, it is so hard to explain everything 
> in an email.  I have many more rows than just 5, I was keeping the 
> number brief for example purposes. 
>
> By creating a table header, I can get
>
> ---------------------------------------------------------------------------------------------- 
>
> | Organization | Project | Status | Primary Sector | Amount | Funding 
> Type |
> ---------------------------------------------------------------------------------------------- 
>
>
> to show up on the top of the next page, but the crucial part is the 
> group header, that part that is bold below:
>
>
> *Inventor Support *
> ---------------------------------------------------------------------------------------------- 
>
> | Organization | Project | Status | Primary Sector | Amount | Funding 
> Type |
> ---------------------------------------------------------------------------------------------- 
>
>
>
> The report may have as many as 100 rows with 10 or so groups in it, 
> and I was hoping that any time a group got split across pages, that 
> the group header could appear at the top of the next page along with 
> the table header.
>
> Please let me know if this still doesn't make sense.  Again, thank you 
> so much for your help.
>
> ~Paige
>
>  
>
> ------------------------------------------------------------------------
> CONFIDENTIALITY NOTICE This message and any included attachments are 
> from Cerner Corporation and are intended only for the addressee. The 
> information contained in this message is confidential and may 
> constitute inside or non-public information under international, 
> federal, or state securities laws. Unauthorized forwarding, printing, 
> copying, distribution, or use of such information is strictly 
> prohibited and may be unlawful. If you are not the addressee, please 
> promptly delete this message and notify the sender of the delivery 
> error by e-mail or you may call Cerner's corporate offices in Kansas 
> City, Missouri, U.S.A at (+1) (816)221-1024.

RE: Repeating table/group headers on subsequent pages

Posted by "Griffin,Sean" <SG...@CERNER.COM>.
Paige,

I have to do the very same thing in my solution.  Just use nested tables where each nested table gets its table-header.  So it would be something like (obviously pseudo):

 

<table>

  <table-header>Education</table-header>

  <table-body>

    <table>

       <table-header>Organization | Project | Status</table-header>

       <table-body>

            ORG1 | PRJ1 | STAT1

       </table-body>

    </table
  </table-body>

</table>

 

-Sean

 

From: Paige Balter [mailto:paigeb@webpaigednd.com] 
Sent: Monday, August 11, 2008 6:12 PM
To: fop-users@xmlgraphics.apache.org
Subject: Re: Repeating table/group headers on subsequent pages

 

Thanks for your reply, Andreas.

Sorry if my question was unclear, it is so hard to explain everything in an email.  I have many more rows than just 5, I was keeping the number brief for example purposes.  

By creating a table header, I can get

---------------------------------------------------------------------------------------------- 
| Organization | Project | Status | Primary Sector | Amount | Funding Type | 
---------------------------------------------------------------------------------------------- 

to show up on the top of the next page, but the crucial part is the group header, that part that is bold below:


Inventor Support 
---------------------------------------------------------------------------------------------- 
| Organization | Project | Status | Primary Sector | Amount | Funding Type | 
---------------------------------------------------------------------------------------------- 


The report may have as many as 100 rows with 10 or so groups in it, and I was hoping that any time a group got split across pages, that the group header could appear at the top of the next page along with the table header.

Please let me know if this still doesn't make sense.  Again, thank you so much for your help.

~Paige 

 

----------------------------------------------------------------------
CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.

Re: Repeating table/group headers on subsequent pages

Posted by Paige Balter <pa...@webpaigednd.com>.
Thanks for your reply, Andreas.

Sorry if my question was unclear, it is so hard to explain everything in 
an email.  I have many more rows than just 5, I was keeping the number 
brief for example purposes. 

By creating a table header, I can get

---------------------------------------------------------------------------------------------- 

| Organization | Project | Status | Primary Sector | Amount | Funding 
Type |
---------------------------------------------------------------------------------------------- 


to show up on the top of the next page, but the crucial part is the 
group header, that part that is bold below:


*Inventor Support *
---------------------------------------------------------------------------------------------- 

| Organization | Project | Status | Primary Sector | Amount | Funding 
Type |
---------------------------------------------------------------------------------------------- 



The report may have as many as 100 rows with 10 or so groups in it, and 
I was hoping that any time a group got split across pages, that the 
group header could appear at the top of the next page along with the 
table header.

Please let me know if this still doesn't make sense.  Again, thank you 
so much for your help.

~Paige



Andreas Delmelle wrote:
> On Aug 11, 2008, at 22:51, Paige Balter wrote:
>
> Hi
>
>> <snip/>
>> I have everything in place.  The last, crucial missing piece is, if, 
>> say, the report breaks between the ORG4 and ORG5 rows, how do I get 
>> the rows:
>>
>> Inventor Support
>> ---------------------------------------------------------------------------------------------- 
>>
>> | Organization | Project | Status | Primary Sector | Amount | Funding 
>> Type |
>>
>>
>> To appear at the top of the next page?  I know table-header-markers 
>> aren't supported yet.  Is page markers the way to go?  If so, I am 
>> struggling with how to use them to get these results.
>
> Assuming that you can create a separate fo:table for the rows 
> containing ORG1-ORG3, if necessary (?) I think you need a simple 
> fo:table-header to contain the header rows. Default behavior is that 
> the header is repeated on page-breaks, so that should lead to the 
> result you seek.
>
> HTH!
>
> Andreas
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>

Re: Repeating table/group headers on subsequent pages

Posted by Andreas Delmelle <an...@telenet.be>.
On Aug 11, 2008, at 22:51, Paige Balter wrote:

Hi

> <snip/>
> I have everything in place.  The last, crucial missing piece is,  
> if, say, the report breaks between the ORG4 and ORG5 rows, how do I  
> get the rows:
>
> Inventor Support
> ---------------------------------------------------------------------- 
> ------------------------
> | Organization | Project | Status | Primary Sector | Amount |  
> Funding Type |
>
>
> To appear at the top of the next page?  I know table-header-markers  
> aren't supported yet.  Is page markers the way to go?  If so, I am  
> struggling with how to use them to get these results.

Assuming that you can create a separate fo:table for the rows  
containing ORG1-ORG3, if necessary (?) I think you need a simple  
fo:table-header to contain the header rows. Default behavior is that  
the header is repeated on page-breaks, so that should lead to the  
result you seek.

HTH!

Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org