Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Sun Jan 19, 2020 12:28 pm

Hi,

we are doing a POC to see if we can use this component in our application.
We have an excel file with three sheets: a data sheet, which contains all the data; and two other sheets with graphs that use the data of the data sheet.

Currently we export this excel with the SaveToStream method, as explained in the tutorial "NET-Excel-New-method-of-Convert-Excel-to-PDF":

Code: Select all
wb.SaveToStream(pdfStream, Spire.Xls.FileFormat.PDF);


This exports all three sheets.

However, we want to export only one sheet with the graph to PDF.

We cannot create a new workbook and copy the sheet to it, because then the data is absent and so the graph is empty.

So basically we need a way to specify which sheet(s) we want to export to pdf.

Is there a way to do that?

lustuyck
 
Posts: 2
Joined: Fri Jan 17, 2020 9:09 am

Mon Jan 20, 2020 1:31 am

Hello,

Thanks for your inquiry.
Our Spire.PDF supports exporting specific sheet to PDF, please refer to the below code. If there is any question, please provide your input file as well as your desired output for further investigation. You could upload them here or send them to us via email (support@e-iceblue.com).
Code: Select all
Workbook workbook = new Workbook();
workbook.LoadFromFile("your file");
Worksheet sheet = workbook.Worksheets[0];
MemoryStream pdfStream = new MemoryStream();
sheet.SaveToPdfStream(pdfStream);

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Thu Feb 06, 2020 7:50 am

Hello,

Hope you are doing well.
Did the code I provide help you? Could you please give us some feedback at your convenience?
Thanks in advance.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Mon Feb 10, 2020 2:23 pm

rachel.lei wrote:Hello,

Hope you are doing well.
Did the code I provide help you? Could you please give us some feedback at your convenience?
Thanks in advance.

Sincerely,
Rachel
E-iceblue support team


Yes, it worked, I was able to export the required sheet. Thank you for the response!

lustuyck
 
Posts: 2
Joined: Fri Jan 17, 2020 9:09 am

Tue Feb 11, 2020 1:12 am

Hello,

Thanks for your feedback.
If you encounter any question related to our product in the future, just feel free to contact us.
Have a nice day!

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Return to Spire.XLS