'Save Document' Dialog

Discussions concerning general integration topics.

Moderator: Phil Barton

Shevy
Posts: 48
Joined: Tue Dec 23, 2008 12:21 pm

Re: 'Save Document' Dialog

Post by Shevy »

Version 2.6.40705.306
Shevy
Posts: 48
Joined: Tue Dec 23, 2008 12:21 pm

Re: 'Save Document' Dialog

Post by Shevy »

Does anyone have any ideas for me?
thanks.
John Morris
Posts: 411
Joined: Thu Sep 11, 2008 11:35 am
Location: Raleigh, NC, USA
Contact:

Re: 'Save Document' Dialog

Post by John Morris »

If you could post your complete handler routine, that will help a lot.
John Morris
Sr. Software Architect
SoftPro
Shevy
Posts: 48
Joined: Tue Dec 23, 2008 12:21 pm

Re: 'Save Document' Dialog

Post by Shevy »

If TryCast(printJob.Properties(PrintJobProperty.Targets), List(Of String)).Contains([Enum].GetName(GetType(PrintJobTarget), PrintJobTarget.Publish)) Then
'first get the firmfile and username
Dim order As SoftPro.OrderTracking.Client.IOrder = TryCast(printJob.Properties("Order"), SoftPro.OrderTracking.Client.IOrder)
Dim firmfile As String = order.Number
Dim currentUser As String = order.CurrentUser.UserName
'get the connection string
Dim strConnect As String = My.Settings.ConnectionString
strSQL = "Select PDFLoc from controlrecord"
Dim oData As New clsData
Dim pdfLoc As String = oData.GetDataReader(strConnect, strSQL, "PDFLoc")

Dim ListEL As New List(Of String)()
Dim ListOL As New List(Of String)()

'Dim oMergePDF As New MergePDF

For Each item As IPrintJobItem In printJob.OriginalItems
Dim fi As FileInfo = TryCast(item.Properties("FileLocation"), FileInfo)
Dim desc As String = TryCast(item.Properties("DocReportName"), String)
If desc = "Endorsement - Loan" Then
Dim S As String = fi.ToString
ListEL.Add(S)
ElseIf desc = "Endorsement - Owners" Then
Dim S As String = fi.ToString
ListOL.Add(S)
End If
Next

Dim sfilenameEL As String = ""
Dim sfilenameOL As String = ""
Dim fileCounter As Integer = GetAndUpdateFileCounter(oData, strConnect)

strSQL = "SELECT PDFLoc from ControlRecord"
Dim getPdfLoc As String = oData.GetDataReader(strConnect, strSQL, "PDFLoc")

sfilenameEL = getPdfLoc & "Pdf\" & fileCounter & ".pdf"
fileCounter = GetAndUpdateFileCounter(oData, strConnect)
sfilenameOL = getPdfLoc & "Pdf\" & fileCounter & ".pdf"
'End If
Dim arrEL As String() = ListEL.ToArray()
Dim arrOL As String() = ListOL.ToArray()
Dim rValEL As String = ""
Dim rValOL As String = ""

Try
If ListEL.Count > 0 Then
rValEL = Merge(sfilenameEL, arrEL)
End If
If ListOL.Count > 0 Then
rValOL = Merge(sfilenameOL, arrOL)
End If
Catch e As Exception

End Try


Dim d1 As Integer = 0
Dim d2 As Integer = 0

' rip through the individual items in the print job
For Each item As IPrintJobItem In printJob.OriginalItems
Dim obj As Object

item.Properties.TryGetValue("DocReportId", obj)
If obj IsNot Nothing Then
Dim docReportId As Guid = DirectCast(obj, Guid)
End If

Dim fi As FileInfo = TryCast(item.Properties("FileLocation"), FileInfo)
Dim desc As String = TryCast(item.Properties("DocReportName"), String)

If desc = "Endorsement" Then
desc = TryCast(item.Properties("PrimaryContextName"), String)
subCatID = "PCYEND"
End If

desc = Replace(desc, "'", "''")

strSQL = "Select saveAsPublic,subCatID from selectDocList where DocName='" & desc & "'"
Dim dsSelectDocs As DataSet = oData.GetDataSet(strConnect, strSQL)
If dsSelectDocs.Tables(0).Rows.Count > 0 Then
saveAsPublic = dsSelectDocs.Tables(0).Rows(0).Item("saveAsPublic")
subCatID = dsSelectDocs.Tables(0).Rows(0).Item("subCatID")
End If

fileName = DateTime.Now.Millisecond & fi.Name

Dim numPages As Integer = GetNoOfPagesPDF(fi.FullName)
If desc = "Endorsement - Loan" And rValEL = "Success" Then
If d1 = 0 Then
File.Move(sfilenameEL, pdfLoc & fileName)
d1 += 1
InsertToTheDatabase(firmfile, currentUser, numPages, desc, fileName, saveAsPublic, subCatID, strConnect, strSQL, oData)
End If
ElseIf desc = "Endorsement - Owners" And rValOL = "Success" Then
If d2 = 0 Then
File.Move(sfilenameOL, pdfLoc & fileName)
d2 += 1
InsertToTheDatabase(firmfile, currentUser, numPages, desc, fileName, saveAsPublic, subCatID, strConnect, strSQL, oData)
End If
Else
File.Copy(fi.FullName, pdfLoc & fileName) 'RR: changed it to Copy (and Deleted after copying) instead of Move so that can also save to HDS Ref#
InsertToTheDatabase(firmfile, currentUser, numPages, desc, fileName, saveAsPublic, subCatID, strConnect, strSQL, oData)
File.Delete(fi.FullName)
End If

Next

MsgBox("Your document(s) have been published to the web successfully.")

'Below are the 2 lines of code that causes the default publish box not to appear
''however they cause an error when trying to email after publishing.

Dim a As IBusinessObjectList
a = order.DocumentImage().Last

End If
'allow the pipeline to continue
Return False
End Function
John Morris
Posts: 411
Joined: Thu Sep 11, 2008 11:35 am
Location: Raleigh, NC, USA
Contact:

Re: 'Save Document' Dialog

Post by John Morris »

Have you tried removing the PrintJobTarget.Publish enumeration from the print job properties, leaving only the Email target and returning true instead of false?
John Morris
Sr. Software Architect
SoftPro
Shevy
Posts: 48
Joined: Tue Dec 23, 2008 12:21 pm

Re: 'Save Document' Dialog

Post by Shevy »

No, Can you give me the code to do that?
Thanks.
John Morris
Posts: 411
Joined: Thu Sep 11, 2008 11:35 am
Location: Raleigh, NC, USA
Contact:

Re: 'Save Document' Dialog

Post by John Morris »

Try this:

Code: Select all

C#
-----------------------------------------------------------------
List<String> list = (List<String>)printJob.Properties[PrintJobProperty.Targets];
list.Remove("Publish");
...
return true;
John Morris
Sr. Software Architect
SoftPro
Shevy
Posts: 48
Joined: Tue Dec 23, 2008 12:21 pm

Re: 'Save Document' Dialog

Post by Shevy »

It is doing the same thing as it was doing before.
giving the error when trying to email.
"Failed to send email, the given key was not present in the dictionary".

Do you have any other ideas?
Thanks!
John Morris
Posts: 411
Joined: Thu Sep 11, 2008 11:35 am
Location: Raleigh, NC, USA
Contact:

Re: 'Save Document' Dialog

Post by John Morris »

Please provide the full exception details, including the entire call stack.
John Morris
Sr. Software Architect
SoftPro
Shevy
Posts: 48
Joined: Tue Dec 23, 2008 12:21 pm

Re: 'Save Document' Dialog

Post by Shevy »

Select.exe Information: 0 : InteropProvider: Invoking SetDefaultPrinter on Executive on APPS (redirected 6).
Select.exe Information: 0 : InteropProvider: Result of invoking SetDefaultPrinter: True
Select.exe Information: 0 : Print dispatcher starting.
Select.exe Information: 0 : Print job 'PrintJob' preparing to enter print job handler 'ProxyProviderPrintJobHandler' inside stage 'Preprocessing'.
Select.exe Information: 0 : Print job handler 'ProxyProviderPrintJobHandler' returned value 'Continue'.
Select.exe Information: 0 : Print job 'PrintJob' preparing to enter print job handler 'CollationPrintJobHandler' inside stage 'Preprocessing'.
Select.exe Information: 0 : Print job handler 'CollationPrintJobHandler' returned value 'Continue'.
Select.exe Information: 0 : Print job 'PrintJob' preparing to enter print job handler 'WatermarkPrintJobHandler' inside stage 'Preprocessing'.
Select.exe Information: 0 : Print job handler 'WatermarkPrintJobHandler' returned value 'Continue'.
Select.exe Information: 0 : Print job 'PrintJob' preparing to enter print job handler 'PexReadyDocPrintJobHandler' inside stage 'Processing'.
Select.exe Information: 0 : Print job handler 'PexReadyDocPrintJobHandler' returned value 'Continue'.
Select.exe Information: 0 : Print job 'PrintJob' preparing to enter print job handler 'PrinterPrintJobHandler' inside stage 'Processing'.
Select.exe Information: 0 : Print job handler 'PrinterPrintJobHandler' returned value 'Continue'.
Select.exe Information: 0 : Print job 'PrintJob' preparing to enter print job handler 'EmailPrintJobHandler' inside stage 'Processing'.
Select.exe Information: 0 : Preparing to email print job.
Focus Tracker: Editor Pane: Focusing Control: Type=SoftProButton, Name=_emailButton.
Current selection changed.
Focus Tracker: Clipboard: Focusing Control: Type=SoftProButton, Name=_emailButton.
Current selection changed.
Select.exe Information: 0 : MessageBox: Instruction=Email error, Content=Failed to send email. The given key was not present in the dictionary., Result=OK
Select.exe Warning: 0 : An exception of type KeyNotFoundException was caught inside the Email print job handler: The given key was not present in the dictionary.
Select.exe Information: 0 : Print job handler 'EmailPrintJobHandler' returned value 'Stop'.
Select.exe Information: 0 : Print dispatcher completed.
Select.exe Information: 0 : Root reference released for Ledger TEST1302-0064 (89d0805b-6ffd-e311-a174-005056a02c69). Updated reference count = 0.
Select.exe Information: 0 : Root Ledger TEST1302-0064 (89d0805b-6ffd-e311-a174-005056a02c69) released from memory.
Focus Tracker: Editor Pane: Leaving Control: Type=SoftProButton, Name=_emailButton.
Focus Tracker: Editor Pane: Entering Control: Type=SoftProListBox, Name=_documentsListBox.
Focus Tracker: Clipboard: Leaving Control: Type=SoftProButton, Name=_emailButton.
Focus Tracker: Clipboard: Entering Control: Type=SoftProListBox, Name=_documentsListBox.
Focus Tracker: Editor Pane: Focusing Control: Type=SoftProListBox, Name=_documentsListBox.
Current selection changed.
Focus Tracker: Clipboard: Focusing Control: Type=SoftProListBox, Name=_documentsListBox.
Starting command UI update.
No command targets handled the command query status for f436331e-3d02-4b9b-af76-fc878517bcf9 : 4248.
No command targets handled the command query status for f436331e-3d02-4b9b-af76-fc878517bcf9 : 4022.
No command targets handled the command query status for f436331e-3d02-4b9b-af76-fc878517bcf9 : 4217.
No command targets handled the command query status for fb696879-7a08-4ef9-acbf-690a2fbbf4ba : 12347.
No command targets handled the command query status for fb696879-7a08-4ef9-acbf-690a2fbbf4ba : 12349.
No command targets handled the command query status for fb696879-7a08-4ef9-acbf-690a2fbbf4ba : 12348.
No command targets handled the command query status for fb696879-7a08-4ef9-acbf-690a2fbbf4ba : 12352.
No command targets handled the command query status for fb696879-7a08-4ef9-acbf-690a2fbbf4ba : 12337.
No command targets handled the command query status for fb696879-7a08-4ef9-acbf-690a2fbbf4ba : 12358.
No command targets handled the command query status for fb696879-7a08-4ef9-acbf-690a2fbbf4ba : 12359.
No command targets handled the command query status for fb696879-7a08-4ef9-acbf-690a2fbbf4ba : 12355.
No command targets handled the command query status for fb696879-7a08-4ef9-acbf-690a2fbbf4ba : 12368.
No command targets handled the command query status for fb696879-7a08-4ef9-acbf-690a2fbbf4ba : 12369.
No command targets handled the command query status for f436331e-3d02-4b9b-af76-fc878517bcf9 : 4216.
No command targets handled the command query status for f436331e-3d02-4b9b-af76-fc878517bcf9 : 4249.
No command targets handled the command query status for f436331e-3d02-4b9b-af76-fc878517bcf9 : 4220.
No command targets handled the command query status for f436331e-3d02-4b9b-af76-fc878517bcf9 : 4221.
No command targets handled the command query status for f436331e-3d02-4b9b-af76-fc878517bcf9 : 4222.
Command UI updated completed.
Post Reply