PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index PDFsharp - moved to http://forum.pdfsharp.net/
Please visit the new PDFsharp forum at http://forum.pdfsharp.net/
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Keeping tables together

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/
View previous topic :: View next topic  
Author Message
chrisb



Joined: 30 Jan 2007
Posts: 3

PostPosted: Sat Feb 24, 2007 3:31 pm    Post subject: Keeping tables together Reply with quote

Hi,
I'm building up an expenditure report that has many costs, which has the following layout

Cost Type1
cost x
cost x
cost x
total xx

Cost Type2
cost x
cost x
cost x
total xx

Grand total xxx

I want to keep all of the costs together with their 'parent' cost type, so that i don't end up with a few rows spilling over on to the next page.

The approach i've taken is to add a new table to the same section each time i lay out a block of cost types, setting the keeptogether property to true, and adding a new row to the table each time i write a cost. However, i just can't seem to get tables to stay together.

The code i'm using is along the lines of:

private void fillTable(Section section)
{
Row r;

//loop through each cost type
foreach (costType c in CostTypes)
{
Table tblTable = new Table();

//add a table to the section
tblTable = base.AddATable(section);
tblTable.KeepTogether = true;
addColumns(tblTable);

r = tblTable.AddRow();
r.Cells[0].AddParagraph("Cost Type Title");
r.HeadingFormat = true;

//loop through each of the costs that belong to the current cost type
foreach (cost cs in costs)
{
r = tblTable.AddRow();
r.Cell[1].AddParagraph("cost title");
r.Cell[2].AddParagraph("0.00");
}
}
}

Am i missing something?

Thanks,
Chris.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/ All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group. Hosted by phpBB.BizHat.com


Start Your Own YouTube Clone

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!
For Support, visit Forums.BizHat.com