Posted 7 August 2019, 9:39 am EST
Is it possible to save / export a flex grid to a pdf file?
Thanks
Andrew
Forums Home / ComponentOne / WinForms Edition
Posted by: ah on 7 August 2019, 9:39 am EST
Posted 7 August 2019, 9:39 am EST
Is it possible to save / export a flex grid to a pdf file?
Thanks
Andrew
Posted 8 August 2019, 3:58 am EST
Hi Andrew,
this is not directly possible, but with a workaround: take a look at the sample “C1FlexGridPrintable2” (found in your user profile “%USERPROFILE%\Documents\ComponentOne Samples\WinForms\v4.0\C1Preview\CS\C1FlexGridPrintable2”: it is used to print a C1FlexGrid and uses C1PrintDocument for this task. The C1PrintDocument can be exported to a pdf file.
Hope this helps
Wolfgang
Posted 8 August 2019, 3:58 am EST
@C1: this sample “C1FlexGridPrintable2” is not found in your only sample database…
Posted 8 August 2019, 7:28 am EST
Hello,
You can use C1PDF class to export a C1FlexGrid to pdf.
I recommend checking out the PdfExport sample located here: Documents\ComponentOne Samples\WinForms\C1FlexGrid\CS\PdfExport
You can also refer the product sample suggested by Wolfgang. It is located at :
Documents\ComponentOne Samples\WinForms\C1Preview\CS\C1FlexGridPrintable2
@Wolfgang, I could find the sample at the above mentioned location. Please let us know what do you want to refer by this?
Thanks and Regards,
Prabhat Sharma.
Posted 9 August 2019, 3:47 am EST
@Prabat: thanks, I did not know about the PdfExporter sample - good to know it exists. C1FlexGridPrintable2 might be more flexible anyway. PdfExporter creates images for each page instead of a Pdf table, this is probably not to optimal result.
Today, I found the C1FlexGridPrintable2 sample also in your only database at https://www.grapecity.com/samples/c1flexgridprintable2 - don’t know why I did not find it yesterday. Sorry!
Wolfgang
Posted 9 August 2019, 4:20 am EST
Hello,
@Wolfgang, Thank you for the information. It is nice to hear that you got the sample.
Regards,
Prabhat Sharma.
Posted 4 December 2020, 3:01 pm EST
Is there a version of this sample that references C1.Win.FlexReport.4 instead of the deprecated C1 report controls?
Posted 7 December 2020, 3:36 am EST
Hi Jong,
only the “C1Report” component in the C1Report dll is deprecated, but not the “C1PrintDocument” class that is used in this sample. As C1 does not have a replacement for C1PrintDocument, you are save to continue using it.
Best regards
Wolfgang
Posted 7 December 2020, 4:49 am EST
Hi Jong,
As said by the Wolfgang, C1PrintDocument class is not deprecated so you can continue using this sample. If you face any issues then please let us know.
@Wolfgang, thank you for your suggestions.
Regards,
Prabhat Sharma.