PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Apr 20, 2024 1:44 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Wed May 11, 2016 9:11 am 
Offline

Joined: Tue Feb 02, 2016 9:29 am
Posts: 2
I want merge cell in migradoc table. When i try to merge cell[0] with rowspan and colspan it merged with colspan only.
Rowspan is not working. Same thing works fine if cell number is not 0.


Top
 Profile  
Reply with quote  
PostPosted: Wed May 11, 2016 9:57 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
Please provide complete source code.

See also:
viewtopic.php?f=2&t=832

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Fri May 13, 2016 8:49 am 
Offline

Joined: Tue Feb 02, 2016 9:29 am
Posts: 2
i just want To Merge Cell in Table .

i getting stuck when i am trying merge cell at (0,0) to merge down and merge right it gives some unproper merge.
please check attached source file for reference.

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using PdfSharp.Drawing;
using PdfSharp.Pdf;
using PdfSharp.Pdf.Security;
using MigraDoc.DocumentObjectModel;
using MigraDoc.DocumentObjectModel.Tables;
using MigraDoc.Rendering;
using System.Drawing.Imaging;
using System.Diagnostics;
using System.Reflection;

namespace MigraDocTableQuery
{
    class Program
    {
        static void Main(string[] args)
        {

            Document doc = new Document();
            Section sec = doc.AddSection();
            Paragraph para = sec.AddParagraph();

            Table table = sec.AddTable();
            table.Style = "Table";
            table.Borders.Width = 0.75;

            table.AddColumn();
            table.AddColumn();
            table.AddColumn();
            table.AddColumn();
            table.AddColumn();
            table.AddRow();
            table.AddRow();
            table.AddRow();
            table.AddRow();
            table.AddRow();

            //  case 1:
            // here table have total 5 columns and 5 rows
            // I want merge from from (0, 0) to merge right and merge down
            table.Rows[0].Cells[0].MergeDown = 4;
            table.Rows[0].Cells[0].MergeRight = 4;

            // case 2:
            // if i merge from (0, 1) it works properly

            table.Rows[0].Cells[1].MergeDown = 3;
            table.Rows[0].Cells[1].MergeRight = 3;

        }
    }
}



thanks in advance


Top
 Profile  
Reply with quote  
PostPosted: Fri May 13, 2016 8:25 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 915
Location: CCAA
What's the point in creating five rows and five columns when the first cell spans all five rows and all five columns and the table effectively has a single cell only?
Do you get an error at runtime?
Do you get a PDF file? If so, please show it.

The style "Table" is undefined. You do not set the column width for the columns.

Which version of PDFsharp/MigraDoc?

See also:
viewtopic.php?f=2&t=832

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 269 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