| View previous topic :: View next topic |
| Author |
Message |
KSJ General User

Joined: 17 Jul 2006 Posts: 6
|
Posted: Tue Jul 03, 2007 5:37 am Post subject: [Solved] OCalc <> Excell |
|
|
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 |
|
 |
squenson Super User


Joined: 09 Mar 2007 Posts: 690 Location: Nis, Serbia
|
Posted: Tue Jul 03, 2007 9:22 am Post subject: |
|
|
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 |
|
 |
KSJ General User

Joined: 17 Jul 2006 Posts: 6
|
Posted: Mon Jul 09, 2007 12:04 am Post subject: |
|
|
Thank you very much,
it works fine, got now the same result creating excel and calc document
Karel |
|
| Back to top |
|
 |
|