2013-04-24 50 views
1

我通常會使用C1Report來生成我在服務器上生成並保存爲PDF的報告。在這種情況下,報告確實需要基於Excel電子表格,所以我使用C1XLBook以所需格式構建數據。但是,我無法解決如何將其導出爲PDF文件。可能? C1論壇似乎已經完成,所以我不能在那裏發帖。用ComponentOne C1XLBook加載XLS並輸出爲PDF?

感謝

傑夫

回答

0

1.Loading與C1XLBook一個XLS文件:

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

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

2.輸出爲PDF:

C1Excel沒有按't公關歡迎使用此功能導出爲pdf。 見here

然而療法是一種變通方法中提到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