[Solved] Disable Print only selected sheets option, headless

Discuss the spreadsheet application
Post Reply
sergtv
Posts: 2
Joined: Tue Aug 17, 2010 1:11 pm

[Solved] Disable Print only selected sheets option, headless

Post by sergtv »

I have OpenOffice 3.2.1 installed headless on RHEL 5.4.

I tried to print xls and xlsx documents from command line. I need to disable "Print only selected sheets" without GUI. Maybe I can edit some configuration file, or use command line key? But I didn't find how I can done this.

Thx.
Last edited by Hagar Delest on Sat Aug 28, 2010 7:06 pm, edited 1 time in total.
Reason: tagged [Solved].
OpenOffice 3.2.1 headless on RHEL.
ARoden
Posts: 7
Joined: Tue Nov 10, 2009 9:01 pm

Re: How to disable "Print only selected sheets" option,headl

Post by ARoden »

I am in the same boat. Trying to get my windows 7 service to print xls files from the command line...
OpenOffice 3.1 Windows (XP Vista 7) 32 and 64 bit...
User avatar
MrProgrammer
Moderator
Posts: 4908
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: How to disable "Print only selected sheets" option,headl

Post by MrProgrammer »

On a Mac, that setting is kept in "~/Library/Application Support/OpenOffice.org/3/user/registry/data/org/openoffice/Office/Calc.xcu" however I can't tell you where it will be on Windows. But if you search for Calc.xcu it might be easy to find. At the bottom of my file, I find
   <node oor:name="Print">
   <node oor:name="Other">
   <prop oor:name="AllSheets" oor:type="xs:boolean">
   <value>false</value>
   </prop>
   </node>
   </node>

Changing the property value from false to true appears to be the equivalent of clearing the "Print only selected sheets" checkbox. A program, even a Windows .BAT file, should be able to change the property value prior to printing. My impression is that this is a global option and changing it will affect all Calc spreadsheets.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
sergtv
Posts: 2
Joined: Tue Aug 17, 2010 1:11 pm

Re: How to disable "Print only selected sheets" option,headl

Post by sergtv »

It's helped. I found /opt/openoffice.org/basis3.2/share/registry/data/org/openoffice/Office/Calc.xcu and changed settings to 'true', after that xls files print successful.
OpenOffice 3.2.1 headless on RHEL.
ARoden
Posts: 7
Joined: Tue Nov 10, 2009 9:01 pm

Re: [Solved] Disable Print only selected sheets option, head

Post by ARoden »

I am still trying to resolve this. We have a program running as a Service. I fix the 'Print only selected sheets' option but the setting doesnt seem to apply when the Service trys to run Calc... Any idea how to programmatically set this option for all users?
OpenOffice 3.1 Windows (XP Vista 7) 32 and 64 bit...
User avatar
MrProgrammer
Moderator
Posts: 4908
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: [Solved] Disable Print only selected sheets option, head

Post by MrProgrammer »

I no longer have a Windows system (yeah!) but from what I remember of that platform there is a directory (Documents and Settings?) which contains all the users on the machine. Or you could get the user names from WMI. In theory your program could run through that directory and fix all the users, assuming it had the privileges to do that. However, I think that's the wrong approach, in part because it's stepping on the settings for other users. I believe that a service runs as a particular user, which you can set in its Properties. So just set this printing service to run with a specific user which has the Print only selected sheets option set. Or, since a program "knows" which user it is, locate the file for that specific user and programmatically fix it.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
Post Reply