View previous topic :: View next topic |
Author |
Message |
vikramjb
Joined: 13 Nov 2006 Posts: 7
|
Posted: Mon Nov 13, 2006 9:10 am Post subject: Table Continuity Over Next Page |
|
|
Hi
I am using MigraDoc to generate tables and all is working fine. This is a simple structure of my report.
======================================
Header - Contains a Table with three rows having 2 cellls
======================================
Simple Text
Invoice Table (Can contain from one to 100 rows)
Simple Text
The above is my pdf format. The header as designed comes in all pages. The issue is the Table. Say if i have table which 30 rows its displaying it in the first page and the rest of the text in the next page. But if the table content itself spawns to more than one page then its having only the column on the first page and rest of the content on the second page. And moreover the table is being drawn on top of the header. I am not sure how to resolve this issue. Can you help me ?
Here is the link
http://www24.brinkster.com/vikramjb/test.pdf |
|
Back to top |
|
|
Thomas Hoevel
Joined: 16 Oct 2006 Posts: 387 Location: Cologne, Germany
|
Posted: Tue Nov 14, 2006 10:06 am Post subject: |
|
|
In general tables can spread accross several pages (but each row must fit on one page as rows cannot spread).
It seems you're using a table that only has 2 rows (but the second row contains 55 lines of text).
It should work using a new row for each line of text. Border properties can be set for each cell to make it look like the table you currently have. _________________ Regards
Thomas Hoevel
PDFsharp Team |
|
Back to top |
|
|
vikramjb
Joined: 13 Nov 2006 Posts: 7
|
Posted: Wed Nov 15, 2006 5:14 am Post subject: |
|
|
Thomas
Thanks for your reply and sorry for the confusion. That's not two rows and 55 lines of text, its actually 55 rows having only a single line of text. I have hidden the borders to make it look one single set.
Quote: | Border properties can be set for each cell to make it look like the table you currently have. |
That is exactly what i have done. I have added new row for each line of text that is there in the table. I will bring the code tomorrow, maybe you would have better idea what's happening. |
|
Back to top |
|
|
Thomas Hoevel
Joined: 16 Oct 2006 Posts: 387 Location: Cologne, Germany
|
Posted: Wed Nov 15, 2006 1:38 pm Post subject: |
|
|
vikramjb wrote: | That is exactly what i have done. |
Strange...
Do you use "row.HeadingFormat = true;"?
We use it always for the heading rows we want to have on every page.
I expect strange behaviour if this is used on every row however.
But I don't really think this is the explanation.
Cluelessly yours
Thomas _________________ Regards
Thomas Hoevel
PDFsharp Team |
|
Back to top |
|
|
vikramjb
Joined: 13 Nov 2006 Posts: 7
|
Posted: Thu Nov 16, 2006 4:27 am Post subject: |
|
|
I remember setting the heading format to true. Don't really remember now, would have to look at the code. Sorry i coudn't bring the code today, had a hectic day at office yesterday, was not able to do anything else. I will see if i can get the code for you tomorow. Btw just a note here. i am using one of you previous version release, not sure which one it is. I downloaded the latest one and tried doing a compile with SharpDevelop. It spat errors like hell, so i reverted back to the previous version. I downloaded that version 1 month before september. I will try get more details tomorrow or this weekend. That is the only part that i am left with in the application.
P.s. Would it be possible for you guys to create a package (SetupFile) for PDFSharp + MigraDocLite. I think it would benefit people who would not wanna compile and those are missing some specific libraries like AcroLib and so on. If i can be of any help, please tell me what to do i will create that package and send you. |
|
Back to top |
|
|
vikramjb
Joined: 13 Nov 2006 Posts: 7
|
Posted: Fri Nov 17, 2006 5:50 am Post subject: |
|
|
Here is the code that i am using
Code: | Deleted by vikramjb |
Last edited by vikramjb on Mon Nov 20, 2006 9:27 am; edited 1 time in total |
|
Back to top |
|
|
vikramjb
Joined: 13 Nov 2006 Posts: 7
|
Posted: Sat Nov 18, 2006 3:08 pm Post subject: |
|
|
Hey Thomas
Any luck with finding the bug in my code. Is it just my code ??. I am gonna see if i can do some heavy investigation tonight with the code. Thanks for your help mate |
|
Back to top |
|
|
vikramjb
Joined: 13 Nov 2006 Posts: 7
|
Posted: Mon Nov 20, 2006 9:33 am Post subject: |
|
|
Thomas
It seems i was wrong all the way, and you where correct. I was infact adding 55 lines of text in a single row that's why it was carrying over the pages. Sorry for the confusion again . I modified and this is what i have come up with. I think the error is obvious here. The library is not adding text after header. I ran one of the samples(Invoice). I added more products to make sure it goes more than 2 pages and then i saw the error their also. The image which was positioned as a header was being over written by the invoice bill content. I am not sure how to proceed after this. Here is the link
http://www24.brinkster.com/vikramjb/AVS%2011-19-2006.pdf
How can i rectify this . Thanks again for such a wonderful library . Its making my job to generate reports easier and removing the dependency with word that i previously had . |
|
Back to top |
|
|
Thomas Hoevel
Joined: 16 Oct 2006 Posts: 387 Location: Cologne, Germany
|
Posted: Tue Nov 21, 2006 1:10 pm Post subject: |
|
|
vikramjb wrote: | How can i rectify this . |
I don't have time to investigate this.
I hope this is just a case of incorrect top margin.
Please try this:
Code: | Section section = Document.LastSection;
section.PageSetup.TopMargin = "5cm";
|
_________________ Regards
Thomas Hoevel
PDFsharp Team |
|
Back to top |
|
|
abcpaem
Joined: 20 Mar 2007 Posts: 1 Location: Barcelona, Spain
|
Posted: Tue Mar 20, 2007 9:54 am Post subject: Table Continuity Over Next Page |
|
|
This thread was very useful to me, the following code wrote by Thomas Hövel was the solution to my table problem:
Code: | Section section = Document.LastSection;
section.PageSetup.TopMargin = "5cm"; |
I also want to add that I had problems with the footer too (I have images on header and footer), so I used the BottomMargin and FooterDistance properties as well:
Code: | Section lastSection = this.document.LastSection;
lastSection.PageSetup.TopMargin = "5.5cm";
lastSection.PageSetup.BottomMargin = "5cm";
lastSection.PageSetup.FooterDistance = "3cm"; |
Thanks to eveybody! |
|
Back to top |
|
|
|