Click here to Skip to main content
11,797,355 members (74,566 online)
Rate this: bad
Please Sign up or sign in to vote.
I made an coding to create a open-office calc document using a
Public Class OoCalc
Public Context As
Public Factory As
Public Loader As
Public Doc As
Public Storable As
Public Model As
Public Sheets As
Public Sheet As
Public Closeable As
Public FileProps As
Public strSheetName as String = "Price"
Public strArray(,) as String={{"Aries","79"},{"Bridge","86"},{"Copper","80"}}
Public strFilePathSource as String = "file:///c:/tmp/reportcard.ods"
Sub Main
Context = uno.util.Bootstrap.bootstrap
Factory = Context.getServiceManager
Loader = CType(Factory.createInstance(""),
Doc = Loader.loadComponentFromURL("private:factory/scalc", "_blank", 0, Nothing)
Sheets.insertNewByName(strSheetName, 0)
Sheet = DirectCast(Sheets.getByName(strSheetName).Value,
'Insert name and grade and comments
For x = strArray.GetLowerBound(0) To strArray.GetUpperBound(0)
    For y = strArray.GetLowerBound(1) To strArray.GetUpperBound(1)
        If IsNumeric(strArray(x, y)) = True Then
           Sheet.getCellByPosition(y, x).setValue(strArray(x, y))
           Sheet.getCellByPosition(y, x).setFormula(strArray(x, y))
        End If
'Insert signature

Storable = DirectCast(Doc,
FileProps.setPropertyValue("Overwrite", New uno.Any(CType(True, Boolean)))
Storable.storeAsURL(strFilePathSource, MyClass.FileProps)
If Doc IsNot Nothing Then
   Closeable = DirectCast(Doc,
   Doc = Nothing
   Factory = Nothing
   Loader = Nothing
   Context = Nothing
End If
End Sub
End Class

My problem now is i don't know how to put an image to the calc document. I tried to search but i cant find anything. I'm using OpenOffice 3.3 and the following ddl: cli_basetypes,cli_cppuhelper,cli_oootypes, cli_uno,cli_ure and cli_uretypes
Posted 6-Sep-12 1:09am
Edited 6-Sep-12 2:17am
evilson at 15-Sep-12 0:26am
Can anyone help me?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 CPallini 475
1 OriginalGriff 435
2 Maciej Los 370
3 Abhinav S 344
4 KrunalRohit 251
0 OriginalGriff 2,092
1 Maciej Los 1,760
2 KrunalRohit 1,436
3 CPallini 1,245
4 ppolymorphe 893

Advertise | Privacy | Mobile
Web04 | 2.8.151002.1 | Last Updated 6 Sep 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100