Hi,
i am using infragistics webdatagrid. the grid have both scrollbars. when i export grid to pdf, it doesnot show all columns of grid. i used Landscape page orientation but couldn't succeed. please let me know how all columns of grid can be shown in pdf. can we show horizantal scorllbar in pdf.
Please help me out. thanks in advance.
Please provide me any answer. i am waiting for it . i have stuck in this problem. please help me. Thanks in advance.
Hello nitin jain,
Thank you for posting in our forum.
A possible workaround would be to set WebDocumentExporter1.EnableStylesExport = false; and apply appropriate styles on CellExporting event, as described in this thread - http://beta.infragistics.com/community/forums/t/57087.aspx.
If you have any further questions, please let me know.
this solution didn't solve my problem.after implementing this solution, columns does not come in readable form.Please suggest me another solution. my number of columns is more than 70. is there any way to fit all grid with this much columns in a pdf. Please help. i am waiting for your reply.
A possible solution would be to set auto width for each column and 100% width of the grid before exporting. Also you could set the page orientation to "Landscape":
foreach (GridField col in WebDataGrid1.Columns){ col.Width = Unit.Empty;}WebDataGrid1.Width = Unit.Percentage(100);WebDocumentExporter1.TargetPaperOrientation = Infragistics.Documents.Reports.Report.PageOrientation.Landscape;WebDocumentExporter1.Export(WebDataGrid1);
Please let me know if this helps.
Hi Nikolay,
I am attaching Image of my exported PDF file.You can see that PDF file is not in readable form. Can we increase the size of PDF Report page so it accomate whole grid with custom width inside it? below is the code i am using to export report.
protected
void ibExportToPDF_Click(object sender, EventArgs e){
if (ExportToPDF != null){Report objReport = new Report();
ISection section = objReport.AddSection();
section.PageOrientation =PageOrientation.Landscape;
//for header and footer.
ISection sectionUtility = PageUtility.GetSectionForExport(section);
sectionUtility.PageOrientation =PageOrientation.Landscape;
this.ExportToPDF(this, new ExportToPDF(DownLoadName, ExportDataGrid));
PagerDocumentExporter.DownloadName = DownLoadName;
PagerDocumentExporter.Format = Infragistics.Web.UI.GridControls.FileFormat.PDF;
PagerDocumentExporter.EnableStylesExport =false;
PagerDocumentExporter .CellExporting +=new EventHandler<DocumentCellExportingEventArgs>(PagerDocumentExporter_CellExporting);
foreach (GridField col in ExportDataGrid.Columns)
{
col.Width =Unit.Empty;
}
ExportDataGrid.Width =Unit.Percentage(100);
PagerDocumentExporter.TargetPaperOrientation =PageOrientation.Landscape;
// PagerDocumentExporter.TargetPaperSize = PageSizes.Ledger;
PagerDocumentExporter.Export(ExportDataGrid, objReport, sectionUtility);
ExportDataGrid.Rows.Clear();