Hi Christian,
Thanks for coming back to me, here is a test based on the example, I really just want to populate to To box whether they press email or export
Public Function Print() As Boolean Implements IReporting.Print
If _ds.Tables.Count > 0 Then
Dim PrintStarted As Boolean = False
If DebugMode Then
_ll.Debug = LlDebug.Enabled And LlDebug.LogToFile
End If
PassDataStructure()
_ll.ExportOptions.Clear()
'Test
_ll.ExportOptions.Add(LlExportOption.ExportSendAsMail, "1")
_ll.ExportOptions.Add(LlExportOption.ExportMailTo, "combit GmbH <SMTP:llmailtest@combit.net>")
_ll.ExportOptions.Add(LlExportOption.ExportMailSubject, "combit List & Label mail test")
_ll.ExportOptions.Add(LlExportOption.ExportMailShowDialog, "1")
_ll.ExportOptions.Add(LlExportOption.ExportMailSendResultAs, "text/html")
If PrintTo = ReportingPrintTo.Preview Then
'Test
'_ll.ExportOptions.Add(LlExportOption.ExportMailTo, EmailTo)
_ll.Core.LlPrintWithBoxStart(LlProject.List, ReportFile, LlPrintMode.Preview, LlBoxType.NormalMeter, OwnerHandle, "Printing report...")
ElseIf PrintTo = ReportingPrintTo.PDF Then
_ll.Core.LlPrintWithBoxStart(LlProject.List, ReportFile, LlPrintMode.Export, LlBoxType.NormalMeter, OwnerHandle, "Printing report...")
_ll.Core.LlXSetParameter(LlExtensionType.Export, "PDF", "Export.File", ExportFilename)
_ll.Core.LlXSetParameter(LlExtensionType.Export, "PDF", "Export.Path", ExportLocation)
_ll.Core.LlXSetParameter(LlExtensionType.Export, "PDF", "Export.Quiet", "1")
_ll.Core.LlXSetParameter(LlExtensionType.Export, "PDF", "PDF.CompressStreamMethod", "3")
_ll.Core.LlXSetParameter(LlExtensionType.Export, "PDF", "PDF.JPEGQuality", "0")
_ll.Core.LlPrintSetOptionString(LlPrintOptionString.Export, "PDF")
ElseIf PrintTo = ReportingPrintTo.JPEG Then
_ll.Core.LlPrintWithBoxStart(LlProject.List, ReportFile, LlPrintMode.Export, LlBoxType.NormalMeter, OwnerHandle, "Printing report...")
_ll.Core.LlXSetParameter(LlExtensionType.Export, "PDF", "Export.File", ExportFilename)
_ll.Core.LlXSetParameter(LlExtensionType.Export, "PDF", "Export.Path", ExportLocation)
_ll.Core.LlXSetParameter(LlExtensionType.Export, "PDF", "Export.Quiet", "1")
_ll.Core.LlXSetParameter(LlExtensionType.Export, "PDF", "PDF.CompressStreamMethod", "3")
_ll.Core.LlXSetParameter(LlExtensionType.Export, "PDF", "PDF.JPEGQuality", "0")
_ll.Core.LlPrintSetOptionString(LlPrintOptionString.Export, "PICTURE_JPEG")
ElseIf PrintTo = ReportingPrintTo.Printer Then
_ll.Core.LlPrintWithBoxStart(LlProject.List, ReportFile, LlPrintMode.Export, LlBoxType.None, OwnerHandle, "Printing report...")
Else
_ll.Core.LlPrintWithBoxStart(LlProject.List, ReportFile, LlPrintMode.Export, LlBoxType.None, OwnerHandle, "Printing report...")
'll.Core.LlPrintSetOptionString(LL_OPTIONSTR_EXPORTS_ALLOWED, "PRN;HTML;PDF;XML;RTF;PICTURE_JPEG;XLS")
_ll.Core.LlPrintOptionsDialog(OwnerHandle, "Choose printing options")
End If
PrintStarted = True
If PrintTo = ReportingPrintTo.PDF Or PrintTo = ReportingPrintTo.JPEG Then
_ll.ExportOptions.Add(LlExportOption.ExportFile, ExportFilename)
_ll.ExportOptions.Add(LlExportOption.ExportPath, ExportLocation)
If ExportQuiet Then
_ll.ExportOptions.Add(LlExportOption.ExportQuiet, "1")
Else
_ll.ExportOptions.Add(LlExportOption.ExportQuiet, "0")
End If
_ll.ExportOptions.Add(LlExportOption.PictureJpegQuality, "50")
_ll.ExportOptions.Add(LlExportOption.PdfCompressStreamMethod, "3")
_ll.ExportOptions.Add(LlExportOption.PdfJpegQuality, "0")
End If
'Initialize first page. A page wrap may occur already caused by objects which are
'printed before the table which is why the loop is needed
While Not _ll.Core.LlPrint()
End While
If MultiTable Then
Dim TableIndex As Integer
Dim dv As New DataView
Do
dv = _ds.Tables(_ll.Core.LlPrintDbGetCurrentTable()).DefaultView
dv.Sort = _ll.Core.LlPrintDbGetCurrentTableSortOrder()
TableIndex = TableIndex + 1
'TR 08.08.2014
Loop Until (PrintDataView(dv, 0, TableIndex) <> LlConstants.WrnTableChange)
'Loop Until (PrintDataView(dv, 0, TableIndex) <> LlConst.LL_WRN_TABLECHANGE)
Else
Dim AddRow As Boolean = False
Dim rowCount As Integer = _ds.Tables(0).Rows.Count
For i = 0 To rowCount - 1
DefineFields(_ds.Tables(0).Rows(i))
_ll.Core.LlPrintSetBoxText("Printing...", Convert.ToInt32(i / rowCount * 100))
Dim nRet As Integer
nRet = _ll.Core.LlPrintFields()
'TR 08.08.2014
'While (nRet = LlConst.LL_WRN_REPEAT_DATA)
While (nRet = LlConstants.WrnRepeatData)
_ll.Core.LlPrint()
nRet = _ll.Core.LlPrintFields()
End While
Next
DefineFields(_ds.Tables(0).Rows(0))
End If
_ll.Core.LlPrintEnd(0)
Return True
'Catch ex As ListLabelException
' ListLabelReturnMessage = ex.Message
' If PrintStarted Then
' _ll.Core.LlPrintEnd(0)
' End If
' Return False
'Catch ex As Exception
' If PrintStarted Then
' _ll.Core.LlPrintEnd(0)
' End If
' Throw New Exception("Error in Reporting.Print - " & ex.Message, ex)
'End Try
Else
Throw New Exception("Error in Reporting.Print - No data has been assigned.")
End If
End Function