PDFsharp & MigraDoc Forum

PDFsharp - A .NET library for processing PDF & MigraDoc - Creating documents on the fly
It is currently Tue Nov 04, 2025 11:11 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules

Also see our new Tailored Support & Services site.



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Jun 06, 2012 7:26 pm 
Offline

Joined: Wed Jun 06, 2012 3:03 pm
Posts: 4
I want to render a table with the first column repeating on every page. I see the Column object has a HeadingFormat property, but couldn't get it to do what I want -- is there any examples available that demonstrates this?

Thanks in advance.


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 06, 2012 7:59 pm 
Offline

Joined: Wed Jun 06, 2012 3:03 pm
Posts: 4
Here's what I have:

Code:
            Document doc = new Document();
            Section section = doc.AddSection();
            Table table = section.AddTable();
            table.Format.Borders.Width = 1;

            Column headerColumn = table.AddColumn();
            headerColumn.HeadingFormat = true;

            for (int i = 0; i < 100; i++) {
                table.AddColumn();
            }

            for (int i = 0; i < 15; i++) {
                Row row = table.AddRow();
                for (int j = 0; j < table.Columns.Count; j++) {
                    row[j].AddParagraph(string.Format("[{0}, {1}]", i, j));
                }
            }

            PdfDocumentRenderer render = new PdfDocumentRenderer(true);
            render.Document = doc;
            render.RenderDocument();
            string filename = "temp.pdf";
            render.Save(filename);
            Process.Start(filename);


Currently it gets cutoff at the 8th column. What do I have to do so that it'd automatically render the rest of the columns on a new page and repeat the first column?


Top
 Profile  
Reply with quote  
PostPosted: Thu Jun 07, 2012 8:22 am 
Offline
PDFsharp Expert
User avatar

Joined: Wed Dec 09, 2009 8:59 am
Posts: 355
Hi!
lala wrote:
What do I have to do so that it'd automatically render the rest of the columns on a new page and repeat the first column?
AFAIK this is not (yet) implemented in the current generation of MigraDoc.

Heading rows do work, but currently all columns must fit the width of a single page.

You can save your document to an MDDDL file and then use the old MigraDoc client to render the PDF:
http://migradoc.empira.de/migradoc/Defa ... D=DlClient
This previous generation of MigraDoc supports wide tables spreading over several pages.

If you save the MDDDL file with the correct extension, double clicking the file will open the preview - just click the PDF symbol in the toolbar to create a PDF file.
The MigraDoc client includes a command-line tool (IIRC it's MGD.EXE) that allows you to run this step (MDDDL to PDF) automatically without a GUI popping up.

_________________
Öhmesh Volta ("() => true")
PDFsharp Team Holiday Substitute


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

All times are UTC


Who is online

Users browsing this forum: Google Adsense [Bot] and 87 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