PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue Apr 16, 2024 6:31 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Mon Nov 13, 2006 9:10 am 
Offline

Joined: Mon Nov 13, 2006 8:49 am
Posts: 7
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Nov 14, 2006 10:06 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Nov 15, 2006 5:14 am 
Offline

Joined: Mon Nov 13, 2006 8:49 am
Posts: 7
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.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Nov 15, 2006 1:38 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Nov 16, 2006 4:27 am 
Offline

Joined: Mon Nov 13, 2006 8:49 am
Posts: 7
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.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Nov 17, 2006 5:50 am 
Offline

Joined: Mon Nov 13, 2006 8:49 am
Posts: 7
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.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Nov 18, 2006 3:08 pm 
Offline

Joined: Mon Nov 13, 2006 8:49 am
Posts: 7
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 :)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Nov 20, 2006 9:33 am 
Offline

Joined: Mon Nov 13, 2006 8:49 am
Posts: 7
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 :oops: . 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 ... 9-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 :).


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Nov 21, 2006 1:10 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
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


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 20, 2007 9:54 am 
Offline

Joined: Tue Mar 20, 2007 9:42 am
Posts: 1
Location: Barcelona, Spain
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!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 68 guests


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 post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group