Autor Thema: Export View nach Symphony  (Gelesen 1893 mal)

Offline Hans

  • Frischling
  • *
  • Beiträge: 20
Export View nach Symphony
« am: 04.02.11 - 11:47:38 »
Hallo zusammen.

Ich habe hier ein Script (Agent) mit dem ich eine Notes View nach Symphony Calc exportiere.
Diese Script funktioniert unter dem Windows Betriebssystem mit Lotus Notes 8.5.2 einwandfrei.

Wenn ich es allerdings unter einem Linux Betriebssystem (Ubuntu) mit Lotus Notes 8.5.2 laufen lasse bekomme ich
die Meldung : " Diese Funktion wird nicht unterstützt "

Kann mir jemand einen Tip geben wo ich etwas Ändern muss oder wo ich Informationen bekomme oder Nachlesen kann.

Hier das Script.

Class OOProperties
   'Call cell.setString(Format(colval, "0"))   
   
   Private vProp() As Variant
   Private app As Variant
   Private vStruct As Variant
   Private bInz As Integer
   
   Sub new()
      Set App = createobject("com.sun.star.ServiceManager")
      Set vStruct = App.Bridge_GetStruct("com.sun.star.beans.PropertyValue")
   End Sub
   
   Sub addProperty(sName As String, vValue As Variant)
      If bInz Then
         Redim Preserve vProp(Ubound(vProp) + 1)
      Else
         Redim vProp(0)
      End If
      bInz = True
      vStruct.Name = sName
      vStruct.Value = vValue
      Set vProp(Ubound(vProp)) = vStruct
   End Sub
   
   Property Get Values()
      If Not bInz Then
         Me.addProperty "Dummy!", 0
         bInz = True
      End If
      Values = vProp
   End Property
   
End Class

Sub Initialize
   Dim session As New NotesSession
   Dim ws As New NotesUIWorkspace
   Dim fileOo As String
   Dim fileOoA As String
   
   Dim args() As Variant
   
   Dim prop As New OOProperties
   
   Dim App As Variant
   Dim objCoreReflection As Variant
   Dim objDesktop As Variant
   Dim objDocument As Variant
   Dim objSheet As Variant
   Dim cell As Variant
   
   Dim db As notesdatabase
   Set db = ws.CurrentDatabase.Database
   
   Dim view As NotesView 'The notes view that contains the data to export
   Set view = db.GetView("TestView")
   
   Dim doc As NotesDocument 'A notes document that contains data to be exported
   Set doc = view.GetFirstDocument
   
   'Remember that Openoffice uses / not \ you might have to convert your filepath.
   fileOo = "C:/Notes/Data/Testfile.xxx.ods"
   fileOoA = "C:/Temp/Testfile 2011.xxx.ods"
   
   'Create objects that are required to work with openoffice
   Set App = createobject("com.sun.star.ServiceManager") 'The servicemanager
   
   Set objCoreReflection= App.createInstance("com.sun.star.reflection.CoreReflection")
   Set objDesktop = App.createInstance("com.sun.star.frame.Desktop") 'The main desktop object
   
   prop.addProperty "Hidden", True 'Decide to run Openoffice hidden in background or visible to the user
   
   Set objDocument = objDesktop.loadComponentFromURL("file:///"+fileOo,"_blank", 0, prop.Values) 'Load the file
   
   Set objSheet = objDocument.Sheets.getByName("Tabelle1") 'Define which Sheet to process. This sheet must exist in the template
   
   objDocument.CurrentController.setActiveSheet(objSheet)
   
   Dim rowposition As Integer 'current spreadsheet row
   Dim colposition As Integer 'current spreadsheet column
   
   rowposition = 1 'Note that the array starts at 0, to adress the first spreedsheet row 1 set rowposition = 0
   
   While Not doc Is Nothing
      colposition = 0
      
      Print "Preparing Spreadsheet, please wait! Processing "+ doc.Country(0)
      Call InsertSpreedsheetCellValue (objSheet, colposition ,rowposition, doc.Test(0))
      Call InsertSpreedsheetCellValue (objSheet, colposition ,rowposition, doc.Test_1(0))
      Call InsertSpreedsheetCellValue (objSheet, colposition ,rowposition, doc.Test_2(0))
      Call InsertSpreedsheetCellValue (objSheet, colposition ,rowposition, doc.BlankColumn(0))
      Call InsertSpreedsheetCellValue (objSheet, colposition ,rowposition, doc.Test_3(0))
      Call InsertSpreedsheetCellValue (objSheet, colposition ,rowposition, doc.Test_4(0))
      
      rowposition = rowposition+1
      Set doc = view.GetNextDocument(doc)
   Wend

Call objDocument.storeToURL("file:///"+fileOoA, prop.Values)
   Call objDocument.close( True)
   Call objDocument.close( True)
   
   Msgbox "Your file is ready! Please open File >> " & Chr(10) &  " C:\Temp\Testfile 2011.xxx.ods !!!", 64 ,db.Title
End Sub

Sub InsertSpreedsheetCellValue (objSheet As Variant, colposition As Integer, rowposition As Integer, fieldvalue As String)
   
   Dim cell As Variant
   Set Cell = objSheet.getCellByPosition(colposition, rowposition)
   Cell.String= FieldValue
   colposition = colposition+1
   
End Sub

MfG Hans
 


Offline m3

  • Freund des Hauses!
  • Gold Platin u.s.w. member:)
  • *****
  • Beiträge: 8.102
  • Geschlecht: Männlich
  • Non ex transverso sed deorsum!
    • leyrers online pamphlet
Re: Export View nach Symphony
« Antwort #1 am: 04.02.11 - 11:48:52 »
Ja, Du musst alle COM-Calls (createObject, ...) ausbauen. COM ist Windows-only.
HTH
m³ aka. Martin -- leyrers online pamphlet | LEYON - All things Lotus (IBM Collaborations Solutions)

All programs evolve until they can send email.
Except Microsoft Exchange.
    - Memorable Quotes from Alt.Sysadmin.Recovery

"Lotus Notes ist wie ein Badezimmer, geht ohne Kacheln, aber nicht so gut." -- Peter Klett

"If there isn't at least a handful of solutions for any given problem, it isn't IBM"™ - @notessensai

Offline m3

  • Freund des Hauses!
  • Gold Platin u.s.w. member:)
  • *****
  • Beiträge: 8.102
  • Geschlecht: Männlich
  • Non ex transverso sed deorsum!
    • leyrers online pamphlet
Re: Export View nach Symphony
« Antwort #2 am: 04.02.11 - 12:01:00 »
Wu wirst wahrscheinlich lieber die "Lotus Symphony LotusScript API" verwenden wollen:
Code
	Dim application As New SymphonyApplication
	Dim spreadsheets As SymphonySpreadsheets
	Dim spreadsheet As SymphonySpreadsheet
	Set spreadsheets = application.Spreadsheets
	Set spreadsheet = spreadsheets.AddSpreadsheet("",False,True)
	
	Dim sheet As SymphonySheet
	Set sheet = spreadsheet.ActiveSheet
	Dim range As SymphonyRange
	Set range = sheet.Range("A1:E10")
	range.Text = "Hello World"
	Call range.AutoFit
	Call range.AutoFormat( spreadsheet.TableStyles.Item(4).Name )

The documentation of the lotus script API can be found in the development toolkit.

To use the lotus script API you simply need Notes 8.5.1 or higher and you must have installed the embedded symphony which comes with your Notes client. In your script you have to use following statement %Include "symphonylsx.lss" to gain access to the API.
HTH
m³ aka. Martin -- leyrers online pamphlet | LEYON - All things Lotus (IBM Collaborations Solutions)

All programs evolve until they can send email.
Except Microsoft Exchange.
    - Memorable Quotes from Alt.Sysadmin.Recovery

"Lotus Notes ist wie ein Badezimmer, geht ohne Kacheln, aber nicht so gut." -- Peter Klett

"If there isn't at least a handful of solutions for any given problem, it isn't IBM"™ - @notessensai

Offline Hans

  • Frischling
  • *
  • Beiträge: 20
Re: Export View nach Symphony
« Antwort #3 am: 04.02.11 - 12:07:37 »
Hallo m3.

Danke für die schnelle Information.

MfG Hans

 

Impressum Atnotes.de  -  Powered by Syslords Solutions  -  Datenschutz