Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » RichText,QTF,RTF... » Page Totals in a table?
Page Totals in a table? [message #23490] Fri, 23 October 2009 02:10 Go to next message
jeremy_c is currently offline  jeremy_c
Messages: 175
Registered: August 2007
Location: Ohio, USA
Experienced Member
I have a long lasting table (10-20 pages in some cases) on a report. I am wondering how I can detect page changes and insert page totals? Thus far, I have been constructing the table in a StringBuffer as QTF, then at the very end doing:

Report r;
r << buf;
Perform(r);


This obviously isn't going to work for what I need.

Jeremy
Re: Page Totals in a table? [message #23491 is a reply to message #23490] Fri, 23 October 2009 02:11 Go to previous messageGo to next message
jeremy_c is currently offline  jeremy_c
Messages: 175
Registered: August 2007
Location: Ohio, USA
Experienced Member
Oh, I can't just count the number of rows output because one of the columns is "Remarks" which could span to a few lines long, thus, each page will have a varying number of rows.

Jeremy
Re: Page Totals in a table? [message #23492 is a reply to message #23490] Fri, 23 October 2009 09:17 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
jeremy_c wrote on Thu, 22 October 2009 20:10

I have a long lasting table (10-20 pages in some cases) on a report. I am wondering how I can detect page changes and insert page totals? Thus far, I have been constructing the table in a StringBuffer as QTF, then at the very end doing:

Report r;
r << buf;
Perform(r);


This obviously isn't going to work for what I need.

Jeremy



Interestingly, I had the same request a little time ago and there is quite generic solution to the problem. See

http://www.ultimatepp.org/reference$RichTextLayoutTracer.htm l

Mirek
Re: Page Totals in a table? [message #23497 is a reply to message #23492] Fri, 23 October 2009 20:10 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

I was looking for ability to manage the overflow of the report page (as I understand it, it is necessary for jeremy).

I found that in the QTF-code of table, you can specify which part of the table is constant and is transferred from page to page. (see the documentation for QTF)



SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: Page Totals in a table? [message #23501 is a reply to message #23497] Fri, 23 October 2009 22:46 Go to previous messageGo to next message
jeremy_c is currently offline  jeremy_c
Messages: 175
Registered: August 2007
Location: Ohio, USA
Experienced Member
sergeynikitin,

Are you speaking of the table header? I see how to accomplish that but what I don't see how to do is making running page totals. luzr is semi-working. It allows me to insert text into the footer of the page when a new page is created but it has a few issues that I'm trying to work out right now.

If you see another way in the docs to have running totals in the table, I'd like to know more. I cannot find anything but header information being transfered from page to page and that would be static, as it simply defines how many rows are header rows and then just duplicates those rows on subsequent pages.

Jeremy
Re: Page Totals in a table? [message #23511 is a reply to message #23501] Sun, 25 October 2009 19:08 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Hi,

I have improved the reference example and RichTextLayoutTracer so that it now works fine with multipage cells.

In fact, it would be possible to do so without RichTextLayoutTracer, using "EndTableCell" which contains the ending page of cell, but it would be too much hassle to store the state. So I have added this as parameter to TableCell.

Now what I do in improved reference example is that I trace first column cells. As header cells there have vertical span, the numbers are 1 less than before, but page breaked cells are now accounted correctly.

I hope this fixes your problem.

Mirek
Re: Page Totals in a table? [message #23533 is a reply to message #23490] Wed, 28 October 2009 16:14 Go to previous messageGo to next message
jeremy_c is currently offline  jeremy_c
Messages: 175
Registered: August 2007
Location: Ohio, USA
Experienced Member
Mirek,

I still have the same problem of the 2nd page of my 3 page log not having table totals. The QTF I sent in a PM should expose the problem.

Jeremy

[Updated on: Wed, 28 October 2009 16:14]

Report message to a moderator

Re: Page Totals in a table? [message #23555 is a reply to message #23533] Fri, 30 October 2009 20:28 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
jeremy_c wrote on Wed, 28 October 2009 11:14

Mirek,

I still have the same problem of the 2nd page of my 3 page log not having table totals. The QTF I sent in a PM should expose the problem.

Jeremy



I am gettin 24-24-16, which IMO is OK.

Have you changed the code according to improved reference example?

Mirek
Re: Page Totals in a table? [message #23556 is a reply to message #23555] Fri, 30 October 2009 20:44 Go to previous message
jeremy_c is currently offline  jeremy_c
Messages: 175
Registered: August 2007
Location: Ohio, USA
Experienced Member
Hm, I am not sure what changed (the data a little but only more onto the end) but I am now getting a totals line on each page. I'll keep a watch on it and see if it messes up again.

Jeremy
Previous Topic: QTF table borders disappering on Report/Perform()
Next Topic: Extracting StymeManager
Goto Forum:
  


Current Time: Fri Mar 29 15:00:29 CET 2024

Total time taken to generate the page: 0.01847 seconds