Hi,
I have set colors to my grid. When I try to export to pdf, the grid is comming without any styles?
In the page grid appears with my styles but not in pdf?
Thanks in Advance.
Hello ramskr4u,
Thank you for posting your question to the Infragistics ASP.NET WebGrid forums. To have the WebGrid styles display on the PDF Report, the WebGrid styles need to be reproduce when using the Document Exporter. The Document Exporter does not automatically recognize any style settings for the WebGrid.
The following link to a forum post from Sung Kim contains information on Publishing Dynamic Files for PDF/XPS Creation Using the Infragistics Document Library:<http://forums.infragistics.com/blogs/sung_kim/archive/2009/02/18/publishing-dynamic-files-pdf-xps-creation-using-the-infragistics-document-library.aspx>
I have also attached a sample application which demonstrates how to export a WebGrid with no styles applied to a PDF Report with applied styles. Using the DocumentExporter events HeaderCellExporting & CellExporting, I was able to apply styles to the PDF Report during the exporting of the WebGrid.
Download the attached sample and take a look at the information on the above forum post. Please let me know if you have any questions.Sincerely,Mike D.Developer Support EngineerInfragistics, Inc.
Hi Mike,
When I give header back color for grid to export pdf as,
e.Layout.HeaderStyleDefault.BackColor = System.Drawing.
ColorTranslator.FromHtml("E6E6E6");
in grid, it gives the gray shaded color not the actual "E6E6E6" HTML color.
But if I specify,
Color.Blue;
in grid, it gives the exact Blue back color in pdf.
Let me know how do I change the back color by giving the HTML color code?