Das Notes Forum
Domino 9 und frühere Versionen => ND6: Entwicklung => Thema gestartet von: Gogun_Beokz am 20.11.07 - 12:19:43
-
Hallo Zusammen,
ich wüsste gerne ob man Print aufrufe sammeln und dann daraus EINEN Druckauftrag erzeugen kann.
Ich hab einen Button in einer Maske mit folgendem Quellcode.
Sub Click(Source As Button)
Dim session As New NotesSession
Dim ws As New NotesUIWorkspace
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Dim adoc As notesdocument
Dim uidoc As notesuidocument
Dim Responses As NotesDocumentCollection
Set db = session.CurrentDatabase
Set doc = ws.currentdocument.Document
doc.form = "PRTDMaMmD"
Set uidoc = ws.EditDocument(False,doc)
Call uidoc.Print(1,1)
Call uidoc.Close
Set Responses = doc.Responses
Set adoc = Responses.GetFirstDocument
While Not (adoc Is Nothing)
If adoc.form(0) = "DBeschreibung" Then
adoc.form = "PRTDBeschreibung"
Set uidoc = ws.EditDocument(False,adoc)
Call uidoc.Print(1,1)
End If
If adoc.form(0) = "MmDAnforderung" Then
adoc.form = "PRTMmDAnforderung"
Set uidoc = ws.EditDocument(False,adoc)
Call uidoc.Print(1,1)
End If
If adoc.form(0) = "MaBestellung" Then
adoc.form = "PRTMaBestellung"
Set uidoc = ws.EditDocument(False,adoc)
Call uidoc.Print(1,1)
End If
Call uidoc.Close
Set adoc = Responses.GetNextDocument(adoc)
Wend
Call uidoc.close
End Sub
Hat jemand schon eine Idee oder gar eine Lösung?
Danke im Vorraus O0 G0guN_b3ok*Z
-
Nein, das geht nicht.
Bernhard
-
OK, gibt es denn eine Möglichkeit die Dokumente auf einer Seite untereinander zu drucken?
-
Hallo,
evtl. kannst du dir eine extra Printmaske bauen. Das ist allerdings insofern etwas aufwändiger, als dass du dann auch im Script ein passendes Dokument erstellen musst, in dem alle Felder, die gedruckt werden sollen, enthalten sind.
Dieses Dokument rufst du mit "EditDocument" gefolgt von einem "Print" auf.
Gruß
Dirk
-
Mit RenderToItem-Item könnte man das machen: Usereigenes ProfilDoc oder normales Doc, bei jedem Aufruf wird zuerst das RTItem gekillt und dann mit RenderToRTItem aufgebaut, gespeichert und im FrontEnd gedruckt.
Wie oben angedeutet: Hierfür nur ein einziges Dok verwenden, um nicht sinnlos die Zahl der Deletion Stubs in die Höhe zu treiben.
HTH,
Bernhard
-
OK, so funktioniert es eigentlich ganz ordentlich.
Sub Click(Source As Button)
Dim session As New NotesSession
Dim ws As New NotesUIWorkspace
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Dim RTCollect As notesdocument
Dim adoc As notesdocument
Dim uidoc As notesuidocument
Dim Responses As NotesDocumentCollection
Dim success As Boolean
'On Error Resume Next
Set db = session.CurrentDatabase
'Erstellen des Body-Dokuments
Set RTCollect = New NotesDocument(db)
RTCollect.Form = "PRT"
Dim rtitem As New notesrichtextitem(RTCollect,"Body")
Set doc = ws.currentdocument.Document
doc.form = "PRTDMaMmD"
success = doc.RenderToRTItem( rtitem )
Set Responses = doc.Responses
Set adoc = Responses.GetFirstDocument
While Not (adoc Is Nothing)
If adoc.form(0) = "DBeschreibung" Then
adoc.form = "PRTDBeschreibung"
End If
If adoc.form(0) = "MmDAnforderung" Then
adoc.form = "PRTMmDAnforderung"
End If
If adoc.form(0) = "MaBestellung" Then
adoc.form = "PRTMaBestellung"
End If
Call rtitem.AddNewline(1)
success = adoc.RenderToRTItem( rtitem )
Set adoc = Responses.GetNextDocument(adoc)
Wend
Call RTCollect.Save(True,True)
Set uidoc = ws.EditDocument(False,RTCollect)
Call uidoc.Print(1,1)
Call uidoc.close
Call RTCollect.Remove(True)
End Sub
Die Maske "PRT" enthält nur das "Body" RT-Feld. Danke für die Hilfe!