BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
//Create a new PDF document.
PdfDocument doc = new PdfDocument();
//Add a page.
PdfPage page = doc.Pages.Add();
//Create a PdfGrid.
PdfGrid pdfGrid = new PdfGrid();
//Assign data source.
pdfGrid.DataSource = dataTable;
//Draw grid to the page of PDF document.
PdfLayoutResult result=pdfGrid.Draw(page, new PointF(10, 10));
//Create a PdfGrid.
PdfGrid pdfGrid1 = new PdfGrid();
//Assign data source.
pdfGrid1.DataSource = dataTable1;
//Draw grid to the page of PDF document.
pdfGrid1.Draw(result.Page, new PointF(10, result.Bounds.Height+20));
|
Hello Sowmiya,
This does not resolve my problem. It seems that drawing on the page does not change layout height.
I have:
PdfLayoutResult result = reportTitle.Draw(page, new PointF()); //this is ok. title is on the page
PdfGrid plgrid = new PdfGrid();
DataTable pldt = new DataTable();
PdfGrid plgrid2 = new PdfGrid();
DataTable pldt2 = new DataTable();
...assigning values to the pldt and pldt2
plgrid.DataSource = pldt;
plgrid2.DataSource = pldt2;
PdfGridLayoutFormat layoutFormat = new PdfGridLayoutFormat();
layoutFormat.Layout = PdfLayoutType.Paginate;
plgrid.Draw(result.Page, new PointF(0, result.Bounds.Height + 40)); //this is ok. grid is under title +40
plgrid2.Draw(result.Page, new PointF(0, result.Bounds.Height + 30)); //this is NOT ok. it is drawn under title +30
When I run debug I try to trace result.Bounds values and it is not changing and it seems to be a problem:
var rb = result.Bounds.Bottom;
var rh = result.Bounds.Height;
Hope that sample code can help us to resolve the issue.
Thank You for the initial help.
Regards, Vladimir.
PdfGridLayoutResult result = pdfGrid.Draw(pdfPage, PointF.Empty);
PdfGrid pdfGrid1 = new PdfGrid();
pdfGrid1.DataSource = dataTable1;
PdfGrid pdfGrid2 = new PdfGrid();
pdfGrid2.DataSource = dataTable2;
PdfGridLayoutFormat layoutFormat = new PdfGridLayoutFormat();
layoutFormat.Layout = PdfLayoutType.Paginate;
PdfLayoutResult result1=pdfGrid1.Draw(result.Page, new PointF(0, result.Bounds.Height + 40), layoutFormat);
pdfGrid2.Draw(result1.Page, new PointF(0, result1.Bounds.Height + 30), layoutFormat);
|