Загрузить XLS с помощью ComponentOne C1XLBook и вывести в формате PDF?

Обычно я использую C1Report для создания своих отчетов, которые генерируются на сервере и сохраняются в формате PDF. В этом случае отчет действительно должен быть основан на электронной таблице Excel, поэтому я использую C1XLBook для построения данных в требуемом формате. Однако я не могу понять, как экспортировать это в файл PDF. Возможно? Форумы C1, похоже, на данный момент закрыты, поэтому я не могу писать там.

Спасибо

Джефф


person Jeff - Software Results    schedule 24.04.2013    source источник


Ответы (1)


1. Загрузка файла XLS с помощью C1XLBook:

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

or

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

2.Вывод в формате PDF:

C1Excel не предоставляет возможности экспорта в pdf. см. здесь .

Однако есть обходной путь, упомянутый здесь:

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
person Nilay Vishwakarma    schedule 07.05.2014