Hi guys
I've attached a PDF file generated by the code below:
----------------------------------------------------------------
string fileName = @"C:\Users\xportal42\Desktop\chartexport";
string exportFileName = fileName + ".pdf";
string file = fileName + ".jpg";
this.ChartWebControl1.SaveImage(file);
Font f = new Font("Calibri", 12f, FontStyle.Bold);
PdfFont pdfFont = new PdfTrueTypeFont(f);
//Create a PDF document
PdfDocument pdfDoc = new PdfDocument();
//Add a page to the empty PDF document
pdfDoc.Pages.Add();
//Draw chart image and add some text and datatable in the first page
pdfDoc.Pages[0].Graphics.DrawString("General Information", pdfFont, new PdfSolidBrush(new PdfColor(213, 123, 19)), 25, 5);
pdfDoc.Pages[0].Graphics.DrawString("Education Grade", pdfFont, new PdfSolidBrush(new PdfColor(213, 123, 19)), 200, 5);
// Creating table
PdfLightTable table = new PdfLightTable();
PdfPage page = pdfDoc.Pages[0];
table.DataSourceType = PdfLightTableDataSourceType.External;
// Initializing datasource
table.DataSource = Session["DataToGraphicPDF"] as DataTable;
//table.DataSource = dataTable;
//Set layout properties
PdfLayoutFormat format = new PdfLayoutFormat();
format.Break = PdfLayoutBreakType.FitElement;
format.Layout = PdfLayoutType.Paginate; /////
// Drawing Table
table.Draw(page, new PointF(10,100), format);
pdfDoc.Pages[0].Graphics.DrawImage(Syncfusion.Pdf.Graphics.PdfImage.FromFile(file), new Point(200, 200), new Size(200, 200));
//Save the PDF Document to disk.
pdfDoc.Save(exportFileName);
//Launches the file.
System.Diagnostics.Process.Start(exportFileName);
----------------------------------------------------------------
As you can see PDF file, the dataTable pass through a SyncFusion Chart. How can I solve this? Because the datatable has a variable size (could have over 1000 rows!!!) and all I need is while the dataset grows, the syncfusion stays under the datatable.
Best Regards.
chartexport_ac975710.rar