Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forcing Page Breaks on detection of XML data change.

Status
Not open for further replies.

LaurenM

Programmer
Jun 5, 2006
62
CA
Hi All, I work for a multi-employer pension plan. Every month we mail out reports that we generate using XML, XSLT, and SQL. For each employer we have to run the SQL script restricting it to just that employer. Which of course means that we have to run the reports many, many times, is there a way that I can just run the report once and force the report to start a new page once a new employer? The reports themselves are just a series of tables reporting various information that the employers need to know.

Lauren McDonald, B.Sc.
Programmer Analyst
Saskatchewan Healthcare Employees' Pension Plan

 
Lauren,

At the risk of being a bit terse, this is the third time you have raised this question in this forum. At no time have you gotten an answer that you might consider satisfactory. You obviously are an optimistic person!

Now, my answer to the question posed, "is there a way that I can just run the report once and force the report to start a new page once a new employer?" would be yes. However, without knowing at least some of the particulars, this question is so open-ended that anything more detailed would be quite speculative on my part.

So, how about some example XML (I understand you will have to sanitize it to keep confidential data private)? How about the XSLT you already have? What particular datum indicates a the logic break that will cause a page separation?

Ask a better question, get a better answer...

Tom Morrison
 
XML:
<RECCUR_ROW NUM="1">
<SHEPPID>254621</SHEPPID> <LASTNAME>DOE</LASTNAME> <FIRSTNAME>JANE</FIRSTNAME> <EMPLOYER>0023</EMPLOYER>
//more XML data
</RECCUR_ROW>
<RECCUR_ROW NUM="2">
<SHEPPID>654832</SHEPPID>
<LASTNAME>SMITH</LASTNAME>
<FIRSTNAME>JOHN</FIRSTNAME>
<EMPLOYER>0036</EMPLOYER>
//more XML data
</RECCUR_ROW>
//more XML data

XSLT:

<xsl:for-each select="RECCUR/RECCUR_ROW">
<fo:table-row>
<fo:table-cell>
<fo:block>
<xsl:value-of select="SHEPPID"/>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>
<xsl:value-of select="LASTNAME"/>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>
<xsl:value-of select="FIRSTNAME"/>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>
<xsl:value-of select="EMPLOYER"/>
</fo:block>
</fo:table-cell>
<fo:table-row>
<xsl:for-each select="RECCUR/RECCUR_ROW">

I tried using xsl:for-each-group but it did not work. Any other solutions or suggestions are appriecated

Lauren McDonald, B.Sc.
Programmer Analyst
Saskatchewan Healthcare Employees' Pension Plan

 
Probably your XSLT processor does not support the latest XSLT recommendation (not many do). However, you are on the right track.

You probably must rely on the Muench method described by me [blush] in this thread: thread426-1210886. Look near the end of the thread for an exposition of the Muench method.

(I also presume that the last two lines in the XSLT shown above are some sort of error...?)

Tom Morrison
 
yes, somehow instead of closing tags, the opening tags got included.

Lauren McDonald, B.Sc.
Programmer Analyst
Saskatchewan Healthcare Employees' Pension Plan

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top