http://www.mediafire.com/?x9qjrd5n7u7jytl
VB : VB Set Style To LibreOffice Calc And Print To Other Sheet.
- Dim Result(-1) As Object
- Dim CurrLine As String = String.Empty
- Dim myDoc As Object, firstSheet As Object, secondSheet As Object //Print To Sheet
- Dim oSM
- Dim oDesk As Object
- Dim arg(-1) As Double
- 'Connect file and open OpenOffice
- oSM = CreateObject("com.sun.star.ServiceManager")
- oDesk = oSM.createInstance("com.sun.star.frame.Desktop")
- ' Open calc
- 'myDoc = oDesk.loadComponentFromURL("private:factory/scalc", "_blank", 0, arg)
- myDoc = oDesk.loadComponentFromURL("file://datacenter/Asset/Template/RP_Reports.ods", "_blank", 0, arg)
- firstSheet = myDoc.Sheets.getByIndex(0) 'index sheet insert data.
- secondSheet = myDoc.Sheets.getByIndex(1) 'index sheet insert data.
- //Select DATA We Need.
- firstSheet.getCellByPosition(0, 0).setPropertyValue("CellStyle", "IntRed")
- firstSheet.getCellByPosition(0, 1).Value = myReader1.Item("In_price").ToString()
- firstSheet.getCellByPosition(1, 1).setPropertyValue("CellStyle", "StrRed")
- firstSheet.getCellByPosition(1, 2).String = myReader1.Item("RPID").ToString()
- //Print To Second Seet
- secondSheet.getCellByPosition(0, 0).setPropertyValue("CellStyle", "StrRed")
- secondSheet.getCellByPosition(0, 1).String = myReader1.Item("RPID").ToString()
- secondSheet.getCellByPosition(1, 1).setPropertyValue("CellStyle", "IntRed")
- secondSheet.getCellByPosition(1, 2).Value = myReader1.Item("In_price").ToString()
No comments:
Post a Comment