1

I would usually use a C1Report to generate my reports which are generated on a server and saved as PDF. In this case the report really needs to be based on an Excel spreadsheet so I am using C1XLBook to build the data in the required format. However, I can't work out how to export this as a PDF file. Possible? The C1 forums seem to be done at the moment so I can't post over there.

Thanks

Jeff

GenericJon
  • 8,746
  • 4
  • 39
  • 50

1 Answers1

0

1.Loading a XLS file with C1XLBook :

System.Diagnostics.Process.Start(@"c:\mybook.xls"); 

or

c1XLBook1.Load(@"c:\mybook.xls");

2.Output as PDF:

C1Excel doesn't provide the feature to export to pdf. see here .

However ther is a workaround mentioned here:

You may try using the following approach:

1. Load the excel file in FlexGrid.

2. Capture the image of the displayed flexgrid, please refer to the following link that describes the same:

http://our.componentone.com/2011/04/19/control-rendering-in-print-document/

3. Once, you have the image you can save the same to Pdf by using the DrawImage method of c1PDF. Please refer to the following link that describes the same:

http://helpcentral.componentone.com/nethelp/c1pdf/index.html#!XMLDocuments/Reference/html/M_C1_C1Pdf_C1PdfDocument_DrawImage_2_7dee50e8.htm
Nilay Vishwakarma
  • 3,105
  • 1
  • 27
  • 48