OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

[Solved] OCalc <> Excell

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
KSJ
General User
General User


Joined: 17 Jul 2006
Posts: 8

PostPosted: Tue Jul 03, 2007 5:37 am    Post subject: [Solved] OCalc <> Excell Reply with quote

n our application, we can export our reports to excell

To give the application some extras we would also like to create Calc files, after struggling with the syntax, we succeeded in writing the data into a Calc document. However there are a few commands we use for formatting excel, that we would like to apply to the Calc document

Can someone give the command to use:
1. Set the row to bold:
Excel: chWorkSheet:Rows(1):FONT:BOLD = TRUE
(chWorkSheet is a handle to the excel document).


2. Autofit
After filling the document we autofit the columns (example columns A to I)
chWorkSheet:COLUMNS("A:I"):Autofit

Thanks


Last edited by KSJ on Mon Sep 29, 2008 7:03 am; edited 1 time in total
Back to top
View user's profile Send private message
squenson
Super User
Super User


Joined: 09 Mar 2007
Posts: 690
Location: Nis, Serbia

PostPosted: Tue Jul 03, 2007 9:22 am    Post subject: Reply with quote

KSJ,

1)Let's have row 24 in bold (use 100 instead of 150 to reset to normal font weight)
Code:
   oDoc = ThisComponent
   oRange = oDoc.Sheets.getByName("YourSheetName").getCellRangeByName("A24:IV24")
   oRange.CharWeight = 150


2) Let's autofit the column A to I
Code:
   oDoc = ThisComponent
   oRange = oDoc.Sheets.getByName("YourSheetName").getCellRangeByName("A1:I65536")
   oRange.Columns.OptimalWidth = True

_________________
Help us to help you: Add [Solved] to the title of the thread if you agree with the answer
>>> Do you know the new OOo support forum http://user.services.openoffice.org/en/forum/index.php? <<<
Back to top
View user's profile Send private message
KSJ
General User
General User


Joined: 17 Jul 2006
Posts: 8

PostPosted: Mon Jul 09, 2007 12:04 am    Post subject: Reply with quote

Thank you very much,
it works fine, got now the same result creating excel and calc document

Karel
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group