We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

merging pdf grids or their grid rows

Thread ID:

Created:

Updated:

Platform:

Replies:

118719 Apr 2,2015 09:28 PM Mar 28,2018 08:22 AM Windows Forms 10
loading
Tags: PDF
jb
Asked On April 2, 2015 09:28 PM

I have following scenario

PdfGrid parentGrid = new PdfGrid();
//populate parentGrid so it contains  1 grid row

PdfGrid child1Grid= new PdfGrid();
//populate child1Grid. say it has 10 pdfgridrow


PdfGrid child2Grid= new PdfGrid();
//populate child2Grid so it has 30 pdfgridrow

Now I want to merger cgild1Grid and child2Grid into parentGrid so at end when i do

parentGrid.Dar and save i would have 41 grid rows








jb
Replied On April 2, 2015 10:07 PM

All grids in my example below have 22 cells and not all cells are filled in all grids

KarthikeyanC [Syncfusion]
Replied On April 3, 2015 03:28 AM

Hi Jb,
Thank you for your interest in Syncfuions Products.

We do have support for nested PdfGrid in Essential PDF, please find the below code snippet.


PdfGrid childPdfGrid = new PdfGrid();
childPdfGrid.Columns.Add(5);
for (int i = 0; i < 5; i++)
{
PdfGridRow row = childPdfGrid.Rows.Add();
for (int j = 0; j < 5; j++)
{
row.Cells[j].Value = String.Format("Cell [{0} {1}]", j, i);
}
}

// Set the value as another PdfGrid in a cell.
parentGrid.Rows[0].Cells[1].Value = childPdfGrid;


If you want to print the PdfGrid one after another please refer the below link for more reference.
http://www.syncfusion.com/kb/2690/how-to-calculate-pdfgrid-table-height

Please let us know if you need any further assistance in this.

Regards,
Karthikeyan.C


jb
Replied On April 22, 2015 04:21 PM

Hi Jb,
Thank you for your interest in Syncfuions Products.

We do have support for nested PdfGrid in Essential PDF, please find the below code snippet.


PdfGrid childPdfGrid = new PdfGrid();
childPdfGrid.Columns.Add(5);
for (int i = 0; i < 5; i++)
{
PdfGridRow row = childPdfGrid.Rows.Add();
for (int j = 0; j < 5; j++)
{
row.Cells[j].Value = String.Format("Cell [{0} {1}]", j, i);
}
}

// Set the value as another PdfGrid in a cell.
parentGrid.Rows[0].Cells[1].Value = childPdfGrid;


If you want to print the PdfGrid one after another please refer the below link for more reference.
http://www.syncfusion.com/kb/2690/how-to-calculate-pdfgrid-table-height

Please let us know if you need any further assistance in this.

Regards,
Karthikeyan.C


If i do the following using your example as a sample

PdfGrid parentPdfGrid = new PdfGrid();
PdfGridRow parentRow = parentPdfGrid.Rows.Add();

PdfGrid childPdfGrid = new PdfGrid();
childPdfGrid.Columns.Add(5);
for (int i = 0; i < 5; i++)
{
PdfGridRow row = childPdfGrid.Rows.Add();
for (int j = 0; j < 5; j++)
{
row.Cells[j].Value = String.Format("Cell [{0} {1}]", j, i);
}
}

parentRow.Cells[0].Value = childPdfGrid;
results in ` Can't draw one or more inner grids, no enough space available for it.`

Basically in the cell i want to show 2 rows. Row 0 spans 4 columns. Row 1. 4 columns and each column has a value

Pasting HTML equivalent of what I want in the cell below
<table class="tg">
  <tr>
    <th class="tg-031e" colspan="3">Main</th>
  </tr>
  <tr>
    <td class="tg-031e">sub1</td>
    <td class="tg-031e">sub2</td>
    <td class="tg-031e">sub3</td>
  </tr>
</table>


jb
Replied On April 22, 2015 04:23 PM

Hi Jb,
Thank you for your interest in Syncfuions Products.

We do have support for nested PdfGrid in Essential PDF, please find the below code snippet.


PdfGrid childPdfGrid = new PdfGrid();
childPdfGrid.Columns.Add(5);
for (int i = 0; i < 5; i++)
{
PdfGridRow row = childPdfGrid.Rows.Add();
for (int j = 0; j < 5; j++)
{
row.Cells[j].Value = String.Format("Cell [{0} {1}]", j, i);
}
}

// Set the value as another PdfGrid in a cell.
parentGrid.Rows[0].Cells[1].Value = childPdfGrid;


If you want to print the PdfGrid one after another please refer the below link for more reference.
http://www.syncfusion.com/kb/2690/how-to-calculate-pdfgrid-table-height

Please let us know if you need any further assistance in this.

Regards,
Karthikeyan.C


If i do the following using your example as a sample

PdfGrid parentPdfGrid = new PdfGrid();
PdfGridRow parentRow = parentPdfGrid.Rows.Add();

PdfGrid childPdfGrid = new PdfGrid();
childPdfGrid.Columns.Add(5);
for (int i = 0; i < 5; i++)
{
PdfGridRow row = childPdfGrid.Rows.Add();
for (int j = 0; j < 5; j++)
{
row.Cells[j].Value = String.Format("Cell [{0} {1}]", j, i);
}
}

parentRow.Cells[0].Value = childPdfGrid;
results in ` Can't draw one or more inner grids, no enough space available for it.`

Basically in the cell i want to show 2 rows. Row 0 spans 4 columns. Row 1. 4 columns and each column has a value

Pasting HTML equivalent of what I want in the cell below
<table class="tg">
  <tr>
    <th class="tg-031e" colspan="3">Main</th>
  </tr>
  <tr>
    <td class="tg-031e">sub1</td>
    <td class="tg-031e">sub2</td>
    <td class="tg-031e">sub3</td>
  </tr>
</table>


This pdfgrid has many columns, the html table sample is what i want inside a gridrow cell.

jb
Replied On April 22, 2015 04:26 PM

Hi Jb,
Thank you for your interest in Syncfuions Products.

We do have support for nested PdfGrid in Essential PDF, please find the below code snippet.


PdfGrid childPdfGrid = new PdfGrid();
childPdfGrid.Columns.Add(5);
for (int i = 0; i < 5; i++)
{
PdfGridRow row = childPdfGrid.Rows.Add();
for (int j = 0; j < 5; j++)
{
row.Cells[j].Value = String.Format("Cell [{0} {1}]", j, i);
}
}

// Set the value as another PdfGrid in a cell.
parentGrid.Rows[0].Cells[1].Value = childPdfGrid;


If you want to print the PdfGrid one after another please refer the below link for more reference.
http://www.syncfusion.com/kb/2690/how-to-calculate-pdfgrid-table-height

Please let us know if you need any further assistance in this.

Regards,
Karthikeyan.C


If i do the following using your example as a sample

PdfGrid parentPdfGrid = new PdfGrid();
PdfGridRow parentRow = parentPdfGrid.Rows.Add();

PdfGrid childPdfGrid = new PdfGrid();
childPdfGrid.Columns.Add(5);
for (int i = 0; i < 5; i++)
{
PdfGridRow row = childPdfGrid.Rows.Add();
for (int j = 0; j < 5; j++)
{
row.Cells[j].Value = String.Format("Cell [{0} {1}]", j, i);
}
}

parentRow.Cells[0].Value = childPdfGrid;
results in ` Can't draw one or more inner grids, no enough space available for it.`

Basically in the cell i want to show 2 rows. Row 0 spans 4 columns. Row 1. 4 columns and each column has a value

Pasting HTML equivalent of what I want in the cell below
<table class="tg">
  <tr>
    <th class="tg-031e" colspan="3">Main</th>
  </tr>
  <tr>
    <td class="tg-031e">sub1</td>
    <td class="tg-031e">sub2</td>
    <td class="tg-031e">sub3</td>
  </tr>
</table>


This pdfgrid has many columns, the html table sample is what i want inside a gridrow cell.

sample code snippet

childPdfGrid.Columns.Add(3);
PdfGridRow row = childPdfGrid.Rows.Add();
row.Cells[0].ColumnSpan = 3;


row.Cells[0].Value = "Hello world";
row = childPdfGrid.Rows.Add();

childPdfGrid.Columns[0].Format.LineAlignment = PdfVerticalAlignment.Middle;


row.Cells[0].Value = "Sub1";
row.Cells[1].Value = "Sub2";
row.Cells[2].Value = "sub3";

parentGridRow.Cells[0].Value = childPdfGrid

KarthikeyanC [Syncfusion]
Replied On April 23, 2015 01:28 AM

Hi JB,
Thank you for your update.

We can achieve your requirement by using Column Span, I have attached a simple sample similar to your requirement. Could you please refer this and let us know is it helpful.
http://www.syncfusion.com/downloads/support/forum/118719/PdfGridSample698096172.zip

Please let us know if you need any further assistance.
Regards,
Karthikeyan.C

jb
Replied On April 23, 2015 04:13 PM

Hi JB,
Thank you for your update.

We can achieve your requirement by using Column Span, I have attached a simple sample similar to your requirement. Could you please refer this and let us know is it helpful.
http://www.syncfusion.com/downloads/support/forum/118719/PdfGridSample698096172.zip

Please let us know if you need any further assistance.
Regards,
Karthikeyan.C

The solution you provided did not work

Here is a diagram
[IMG]http://i57.tinypic.com/4jvp5h.png[/IMG]

I am trying to do R1C1..R1C3

If i add a grid row then i get a border across the row on any columns whose columnspan is > 1

Abirami Selvan [Syncfusion]
Replied On April 24, 2015 01:39 PM

Hi Jb,
We have created the sample for your requirement. We have tried the sample by applying span. To apply the span, we are combining the rows and columns. So when we create the table as you mentioned structure , we get the columns like R0C0,R0C1 and R0C4.
We have attached the sample for your reference in the below link:
http://www.syncfusion.com/downloads/support/forum/118719/PdfGridSample2030664930.zip
Please try this and let us know if you need any further assistance.

Thanks,
Abirami.

Júlio Daniel Ferreira Papel
Replied On March 27, 2018 02:40 PM

Hi Jb,
Thank you for your interest in Syncfuions Products.

We do have support for nested PdfGrid in Essential PDF, please find the below code snippet.


PdfGrid childPdfGrid = new PdfGrid();
childPdfGrid.Columns.Add(5);
for (int i = 0; i < 5; i++)
{
PdfGridRow row = childPdfGrid.Rows.Add();
for (int j = 0; j < 5; j++)
{
row.Cells[j].Value = String.Format("Cell [{0} {1}]", j, i);
}
}

// Set the value as another PdfGrid in a cell.
parentGrid.Rows[0].Cells[1].Value = childPdfGrid;


If you want to print the PdfGrid one after another please refer the below link for more reference.
http://www.syncfusion.com/kb/2690/how-to-calculate-pdfgrid-table-height

Please let us know if you need any further assistance in this.

Regards,
Karthikeyan.C


If i do the following using your example as a sample

PdfGrid parentPdfGrid = new PdfGrid();
PdfGridRow parentRow = parentPdfGrid.Rows.Add();

PdfGrid childPdfGrid = new PdfGrid();
childPdfGrid.Columns.Add(5);
for (int i = 0; i < 5; i++)
{
PdfGridRow row = childPdfGrid.Rows.Add();
for (int j = 0; j < 5; j++)
{
row.Cells[j].Value = String.Format("Cell [{0} {1}]", j, i);
}
}

parentRow.Cells[0].Value = childPdfGrid;
results in ` Can't draw one or more inner grids, no enough space available for it.`

Basically in the cell i want to show 2 rows. Row 0 spans 4 columns. Row 1. 4 columns and each column has a value

Pasting HTML equivalent of what I want in the cell below
<table class="tg">
  <tr>
    <th class="tg-031e" colspan="3">Main</th>
  </tr>
  <tr>
    <td class="tg-031e">sub1</td>
    <td class="tg-031e">sub2</td>
    <td class="tg-031e">sub3</td>
  </tr>
</table>


This pdfgrid has many columns, the html table sample is what i want inside a gridrow cell.

This needs to be updated!

Cheers.

Sowmiya Loganathan [Syncfusion]
Replied On March 28, 2018 08:22 AM

Hi Jb, 

We have earlier updated the sample for your requirement. Kindly check whether the previously updated sample meets your requirement. If not kindly share us the details regarding your requirement. It will helpful for us to provide the better solution on this. 

Please let us know if you need any further assistance. 

Regards, 
Sowmiya L 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;