Apache OpenOffice (AOO) Bugzilla – Issue 73988
Work with active sheet in Excel file
Last modified: 2013-02-24 21:09:06 UTC
Can't export to PDF file only active list of XLS file when i trying convert XLS file. In this way happen convert all sheets in XLS to PDF file and option "SelectionOnly" don't work.
chernolyas, please test with latest released version of OO (2.1 at the moment) and reopen, attaching sample file.
Created attachment 42568 [details] Archive with source java classes, example XLS file and resulting PDF file
I try it for OpenOffice 2.1. Result same as for OpenOffice 2.2
Created attachment 42569 [details] Correct ExcelWork.java
chernolyas, still can't repro even with your files - exporting selection produces just one- page .pdf. Please provide detailed step by step instruction.
Step-by-step is like that: I have multi-tab .xls document which i'm trying to render using OpenOffice 2.1. The taks is to render only active sheet (1 tab with name "1 pager"). I'm using library http://jooreports.sourceforge.net/?q=node/33 and in the end have a .pdf which contains entire .xls document instead of only active sheet. If i got you right you have .pdf with only active sheet inside although you in the same situation as i am. Could you please specify how you get only active page in result pdf file (your options of OpenOffice,Excel, PDF Converter)? Where is i can get step-by-step instructions for work with export from XLS to PDF? Thank you.
chernolyas, I export spreadsheet via File, Export to PDF. In PDF settings dialog I just change to "Selection" and get only active sheet.
You incorrect understand me. In GUI client for OpenOffice Server it work fine. But i use API and work with OpenOffice Server by network socket. Please, check ExcelWork.java and tell me where i wrong. Thank you.
This is link to equal problem http://www.oooforum.org/forum/viewtopic.phtml? t=52382. When will you correct this problem? Thank you.
Hi kpalagin I wrote you an email yesterday about my problem with OpenOffice but it seems that you didn't recieved it because i've never got an answer from you. Could you please help me to understand what is the issue when i use API and work with OpenOffice Server by network socket because currently i can't render .xls active page using API. ExcelWork.java contains the code which tries to do that. If it is a bug of OpenOffice could you please tell when (in what version perhaps) this will be fixed. Thank you.
To export a single sheet to PDF, you have to pass it to the PDF filter in the MediaDescriptor's FilterData. FilterData is a sequence of PropertyValue, one supported entry is "Selection", into which you can put a sheet object.
Created attachment 42626 [details] Java class which use only OpenOffice API
Dear nn I added java class which use only OpenOffice API (without JOOConverter). After start i get same result (PDF file consist OpenOffice Calc data).
In the attached code, you don't assign to filterProps. If you get the sheet from the document by its name, there's no need to involve the view. Just pass the object you get from the document.
I've finally understood the problem and took care of it. Thank you very much for your help.