Imports System.IO
Public Class nbfPreviewForm
Friend WithEvents PrintPreviewControl1 As PrintPreviewControl
Friend PDI As PrintDocInfo
Private WithEvents docToPrint As New Printing.PrintDocument 'New Printing.PrintDocument
Declare Function BringWindowToTop Lib "user32" (ByVal hWnd As IntPtr) As Integer
Public Sub New(ByVal inPDI As PrintDocInfo, ByVal DocName$)
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
PDI = inPDI
InitializePrintPreviewControl(DocName)
AddHandler PageButton.MouseDown, AddressOf pgButtonClick
AddHandler AutoToolStripMenuItem.Click, AddressOf ZoomAuto
AddHandler ToolStripMenuItem2.Click, AddressOf Zoom500
AddHandler ToolStripMenuItem3.Click, AddressOf Zoom200
AddHandler ToolStripMenuItem4.Click, AddressOf Zoom150
AddHandler ToolStripMenuItem5.Click, AddressOf Zoom100
AddHandler ToolStripMenuItem6.Click, AddressOf Zoom75
AddHandler ToolStripMenuItem7.Click, AddressOf Zoom50
AddHandler ToolStripMenuItem8.Click, AddressOf Zoom25
AddHandler ToolStripMenuItem9.Click, AddressOf Zoom10
AddHandler ExportToExcel2007ToolStripMenuItem.Click, AddressOf ExportGridToExcel2007
AddHandler RTFToolStripMenuItem.Click, AddressOf ExpRTF
AddHandler WordToolStripMenuItem.Click, AddressOf ExpWord
AddHandler ExportReportDataToolStripMenuItem.Click, AddressOf ExpGData
AddHandler PDFToolStripMenuItem.Click, AddressOf ExpPDF
AddHandler RunPDFToolStripMenuItem.Click, AddressOf ExpPDFView
AddHandler btnPrint.Click, AddressOf PrintDoc
AddHandler btnClose.Click, AddressOf btnCloseClick
AddHandler txtPage.Leave, AddressOf txtPageCHg
AddHandler txtPage.KeyDown, AddressOf txtPagekd
'AddHandler Me.ChangeUICues, AddressOf uiChange
'AddHandler Me, AddressOf MD
End Sub
'Private Sub uiChange(ByVal sender As Object, ByVal e As System.Windows.Forms.UICuesEventArgs)
'Me.TopMost = False
'End Sub
Private Sub InitializePrintPreviewControl(ByVal DocName$) 'ByVal PD As Printing.PrintDocument, ByVal DocName$)
Try
txtPage.Text = 1
' Construct the PrintPreviewControl.
Me.PrintPreviewControl1 = New PrintPreviewControl
' Set location, name, and dock style for PrintPreviewControl1.
'Me.PrintPreviewControl1.Location = New Point(88, 80)
Me.PrintPreviewControl1.Name = "PrintPreviewControl1"
Me.PrintPreviewControl1.Dock = DockStyle.Fill
docToPrint.PrinterSettings = PDI.PrinterSettings
docToPrint.DefaultPageSettings = PDI.PrinterSettings.DefaultPageSettings
' Set the Document property to the PrintDocument
' for which the PrintPage event has been handled.
Me.PrintPreviewControl1.Document = docToPrint
' Set the zoom to 25 percent.
Me.PrintPreviewControl1.Zoom = 1 '0.25
'Me.PrintPreviewControl1.
' Set the document name. This will show be displayed when
' the document is loading into the control.
Me.PrintPreviewControl1.Document.DocumentName = DocName$
' Set the UseAntiAlias property to true so fonts are smoothed
' by the operating system.
Me.PrintPreviewControl1.UseAntiAlias = True
' Add the control to the form.
Me.ToolStripContainer1.ContentPanel.Controls.Add(Me.PrintPreviewControl1)
Catch ex As Exception
ShowMessage(PDI.SourceBrowseRep.DBC, ex.Message)
End Try
End Sub
Private Sub docToPrint_PrintPage(ByVal sender As Object, _
ByVal e As System.Drawing.Printing.PrintPageEventArgs) _
Handles docToPrint.PrintPage
Try
'Me.TopMost = False
' Insert code to render the page here.
' This code will be called when the control is drawn.
PDI.DoPrint(sender, e)
'BringWindowToTop(Me.Handle)
Catch ex As Exception
ShowMessage(PDI.SourceBrowseRep.DBC, ex.Message)
End Try
End Sub
Private Sub ExportGridToExcel2007(ByVal sender As Object, ByVal e As System.EventArgs)
Try
Dim fd As New System.Windows.Forms.OpenFileDialog
fd.AddExtension = True
fd.Filter = "Excel 2007 File|*.xlsx"
fd.CheckFileExists = False
fd.CheckPathExists = True
fd.ShowDialog()
Dim FileName$ = fd.FileName
If FileName$ <> "" Then
Dim impFile As Boolean = True
If File.Exists(FileName$) = True Then
If MsgBox("File already exists, overwrite?", MsgBoxStyle.Question + MsgBoxStyle.YesNo + MsgBoxStyle.DefaultButton2) = MsgBoxResult.No Then
impFile = False
Else
Try
File.Delete(FileName$)
Catch ex As Exception
End Try
impFile = True
End If
Else
End If
If impFile = True Then
PDI.SourceBrowseRep.OutputGridToExcel2007(FileName, True)
End If
End If
Catch ex As Exception
ShowMessage(PDI.SourceBrowseRep.DBC, ex.Message)
End Try
End Sub
Sub pgButtonClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
Try
Me.TopMost = False
Dim npg As Integer
If e.Y < sender.height / 2 Then
If IsNumeric(txtPage.Text) Then
npg = CInt(txtPage.Text) + 1
If npg > PDI.PageList.Count Then
Exit Sub
End If
Else
npg = 1
End If
Else
If IsNumeric(txtPage.Text) Then
If Not CInt(txtPage.Text) > 1 Then
Exit Sub
Else
npg = CInt(txtPage.Text) - 1
If npg < 1 Then
Exit Sub
End If
End If
End If
End If
txtPage.Text = npg.ToString
PrintPreviewControl1.StartPage = npg - 1
Catch ex As Exception
ShowMessage(PDI.SourceBrowseRep.DBC, ex.Message)
End Try
End Sub
Sub ZoomAuto(ByVal sender As Object, ByVal e As System.EventArgs)
Try
Me.TopMost = False
PrintPreviewControl1.AutoZoom = True
Catch ex As Exception
ShowMessage(PDI.SourceBrowseRep.DBC, ex.Message)
End Try
End Sub
Sub Zoom500(ByVal sender As Object, ByVal e As System.EventArgs)
Try
Me.TopMost = False
Me.PrintPreviewControl1.Zoom = 5
Catch ex As Exception
ShowMessage(PDI.SourceBrowseRep.DBC, ex.Message)
End Try
End Sub
Sub Zoom200(ByVal sender As Object, ByVal e As System.EventArgs)
Try
Me.TopMost = False
Me.PrintPreviewControl1.Zoom = 2
Catch ex As Exception
ShowMessage(PDI.SourceBrowseRep.DBC, ex.Message)
End Try
End Sub
Sub Zoom150(ByVal sender As Object, ByVal e As System.EventArgs)
Try
Me.TopMost = False
Me.PrintPreviewControl1.Zoom = 1.5
Catch ex As Exception
ShowMessage(PDI.SourceBrowseRep.DBC, ex.Message)
End Try
End Sub
Sub Zoom100(ByVal sender As Object, ByVal e As System.EventArgs)
Try
Me.TopMost = False
Me.PrintPreviewControl1.Zoom = 1
Catch ex As Exception
ShowMessage(PDI.SourceBrowseRep.DBC, ex.Message)
End Try
End Sub
Sub Zoom75(ByVal sender As Object, ByVal e As System.EventArgs)
Try
Me.TopMost = False
Me.PrintPreviewControl1.Zoom = 0.75
Catch ex As Exception
ShowMessage(PDI.SourceBrowseRep.DBC, ex.Message)
End Try
End Sub
Sub Zoom50(ByVal sender As Object, ByVal e As System.EventArgs)
Try
Me.TopMost = False
Me.PrintPreviewControl1.Zoom = 0.5
Catch ex As Exception
ShowMessage(PDI.SourceBrowseRep.DBC, ex.Message)
End Try
End Sub
Sub Zoom25(ByVal sender As Object, ByVal e As System.EventArgs)
Try
Me.TopMost = False
Me.PrintPreviewControl1.Zoom = 0.25
Catch ex As Exception
ShowMessage(PDI.SourceBrowseRep.DBC, ex.Message)
End Try
End Sub
Sub Zoom10(ByVal sender As Object, ByVal e As System.EventArgs)
Try
Me.TopMost = False
Me.PrintPreviewControl1.Zoom = 0.1
Catch ex As Exception
ShowMessage(PDI.SourceBrowseRep.DBC, ex.Message)
End Try
End Sub
Sub txtPageCHg(ByVal sender As Object, ByVal e As System.EventArgs)
Try
Me.TopMost = False
If IsNumeric(txtPage.Text) Then
Dim spg As Integer = CInt(txtPage.Text) - 1
If Not spg = PrintPreviewControl1.StartPage Then
PrintPreviewControl1.StartPage = spg
End If
End If
Catch ex As Exception
ShowMessage(PDI.SourceBrowseRep.DBC, ex.Message)
End Try
End Sub
Sub txtPagekd(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs)
Try
Me.TopMost = False
If e.KeyCode = Keys.Enter Or e.KeyCode = Keys.Return Then
If IsNumeric(txtPage.Text) Then
Dim spg As Integer = CInt(txtPage.Text) - 1
If Not spg = PrintPreviewControl1.StartPage Then
PrintPreviewControl1.StartPage = spg
End If
End If
End If
Catch ex As Exception
ShowMessage(PDI.SourceBrowseRep.DBC, ex.Message)
End Try
End Sub
Sub PrintDoc(ByVal sender As Object, ByVal e As System.EventArgs)
Try
Me.TopMost = False
Dim doc As New System.Drawing.Printing.PrintDocument
doc.PrinterSettings.FromPage = 1
doc.PrinterSettings.ToPage = 1
doc.PrinterSettings.MinimumPage = 1
doc.PrinterSettings.MaximumPage = PDI.PageList.Count
Dim PDLG As New PrintDialog
PDLG.Document = doc
If PDI.PageWidth > PDI.PageHeight Then
PDLG.PrinterSettings.DefaultPageSettings.Landscape = True
Else
PDLG.PrinterSettings.DefaultPageSettings.Landscape = False
End If
'PDLG.AllowSelection = True
PDLG.AllowSomePages = True
PDLG.PrinterSettings.FromPage = 1
PDLG.PrinterSettings.ToPage = PDI.PageList.Count
'PDLG.Document.PrinterSettings.MinimumPage = 1
'PDLG.Document.PrinterSettings.MaximumPage = PDI.PageList.Count
'PDLG.PrinterSettings.FromPage = 1
'PDLG.PrinterSettings.ToPage = PDI.PageList.Count
'PDLG.PrinterSettings.MinimumPage = 1
'PDLG.PrinterSettings.MaximumPage = PDI.PageList.Count
'pdlg.PrinterSettings.
Dim result As DialogResult = PDLG.ShowDialog()
If Not (result = DialogResult.OK) Then
MsgBox("Print Abandoned", MsgBoxStyle.OkOnly, "Open Door")
Exit Sub
End If
PDI.SetPrinterSettings(PDLG.PrinterSettings)
If PDLG.PrinterSettings.ToPage = PDI.PageList.Count And PDLG.PrinterSettings.FromPage = 1 Then
PDI.PrintDocument()
Else
PDI.PrintPageRange(PDLG.PrinterSettings.FromPage, PDLG.PrinterSettings.ToPage)
End If
Catch ex As Exception
ShowMessage(PDI.SourceBrowseRep.DBC, ex.Message)
End Try
End Sub
Sub x_PrintDoc(ByVal sender As Object, ByVal e As System.EventArgs)
Try
Me.TopMost = False
Dim PDLG As New PrintDialog
If PDI.PageWidth > PDI.PageHeight Then
PDLG.PrinterSettings.DefaultPageSettings.Landscape = True
Else
PDLG.PrinterSettings.DefaultPageSettings.Landscape = False
End If
Dim doc As New System.Drawing.Printing.PrintDocument
doc.PrinterSettings.FromPage = 1
doc.PrinterSettings.ToPage = 1
doc.PrinterSettings.MinimumPage = 1
doc.PrinterSettings.MaximumPage = PDI.PageList.Count
'PDLG.AllowSelection = True
PDLG.AllowSomePages = True
PDLG.Document = doc
PDLG.PrinterSettings.FromPage = 1
PDLG.PrinterSettings.ToPage = PDI.PageList.Count
'PDLG.Document.PrinterSettings.MinimumPage = 1
'PDLG.Document.PrinterSettings.MaximumPage = PDI.PageList.Count
'PDLG.PrinterSettings.FromPage = 1
'PDLG.PrinterSettings.ToPage = PDI.PageList.Count
'PDLG.PrinterSettings.MinimumPage = 1
'PDLG.PrinterSettings.MaximumPage = PDI.PageList.Count
'pdlg.PrinterSettings.
Dim result As DialogResult = PDLG.ShowDialog()
If Not (result = DialogResult.OK) Then
MsgBox("Print Abandoned", MsgBoxStyle.OkOnly, "Open Door")
Exit Sub
End If
PDI.SetPrinterSettings(PDLG.PrinterSettings)
If PDLG.PrinterSettings.ToPage = PDI.PageList.Count And PDLG.PrinterSettings.FromPage = 1 Then
PDI.PrintDocument()
Else
PDI.PrintPageRange(PDLG.PrinterSettings.FromPage, PDLG.PrinterSettings.ToPage)
End If
Catch ex As Exception
ShowMessage(PDI.SourceBrowseRep.DBC, ex.Message)
End Try
End Sub
Protected Overrides Sub OnClosing(ByVal e As System.ComponentModel.CancelEventArgs)
MyBase.OnClosing(e)
PDI.EndPreviewPrint()
docToPrint.Dispose()
End Sub
Sub btnCloseClick(ByVal sender As Object, ByVal e As System.EventArgs)
Me.Close()
End Sub
Sub ExpRTF(ByVal sender As Object, ByVal e As System.EventArgs)
Try
Me.TopMost = False
Dim fd As New System.Windows.Forms.OpenFileDialog
fd.AddExtension = True
fd.Filter = "RTF File|*.rtf"
fd.CheckFileExists = False
fd.CheckPathExists = True
fd.ShowDialog()
Dim FileName$ = fd.FileName
If FileName$ <> "" Then
PDI.ExportRTF(FileName$)
End If
Catch ex As Exception
ShowMessage(PDI.SourceBrowseRep.DBC, ex.Message)
End Try
End Sub
Sub ExpPDF(ByVal sender As Object, ByVal e As System.EventArgs)
Try
Me.TopMost = False
Dim fd As New System.Windows.Forms.OpenFileDialog
fd.AddExtension = True
fd.Filter = "PDF File|*.pdf"
fd.CheckFileExists = False
fd.CheckPathExists = True
fd.ShowDialog()
Dim FileName$ = fd.FileName
If FileName$ <> "" Then
PDI.ExportPDF(FileName$)
End If
Catch ex As Exception
ShowMessage(PDI.SourceBrowseRep.DBC, ex.Message)
End Try
End Sub
Sub ExpPDFView(ByVal sender As Object, ByVal e As System.EventArgs)
Try
Me.TopMost = False
Application.DoEvents()
Dim xtn$ = ".pdf"
Dim tfcnt As Integer = 1
Dim fname$ = "TmpDoc" & tfcnt.ToString & xtn$
Dim full_file$ = ""
Dim fok As Boolean = True
Dim pvAppPath$ = System.Windows.Forms.Application.StartupPath & "\TempExportFiles"
If Not Directory.Exists(pvAppPath$) Then
Directory.CreateDirectory(pvAppPath$)
End If
Do
fok = True
full_file$ = pvAppPath$ & "\" & fname$
If File.Exists(full_file$) Then
Try
File.Delete(full_file$)
Catch ex As Exception
fok = False
tfcnt += 1
fname$ = "TmpDoc" & tfcnt.ToString & xtn$
End Try
End If
Loop While Not fok
If PDI.ExpPdf(full_file$, True) Then
Dim myProcess As New Process()
myProcess.StartInfo.FileName = full_file$
myProcess.Start()
End If
Catch ex As Exception
ShowMessage(PDI.SourceBrowseRep.DBC, ex.Message)
End Try
End Sub
Sub ExpWord(ByVal sender As Object, ByVal e As System.EventArgs)
Try
Me.TopMost = False
Application.DoEvents()
Dim xtn$ = ".rtf"
Dim tfcnt As Integer = 1
Dim fname$ = "TmpDoc" & tfcnt.ToString & xtn$
Dim full_file$ = ""
Dim fok As Boolean = True
Dim pvAppPath$ = System.Windows.Forms.Application.StartupPath & "\TempExportFiles"
If Not Directory.Exists(pvAppPath$) Then
Directory.CreateDirectory(pvAppPath$)
End If
Do
fok = True
full_file$ = pvAppPath$ & "\" & fname$
If File.Exists(full_file$) Then
Try
File.Delete(full_file$)
Catch ex As Exception
fok = False
tfcnt += 1
fname$ = "TmpDoc" & tfcnt.ToString & xtn$
End Try
End If
Loop While Not fok
If PDI.ExpRtf(full_file$, True) Then
Dim ldOK As Boolean = False
Dim exl As Object
Try
exl = CreateObject("Word.Application")
exl.documents.open(full_file$)
ldOK = True
Catch
End Try
If ldOK Then
Try
exl.ActiveWindow.View.Type = 3 'Print view
Catch ex As Exception
End Try
exl.visible = True
exl = Nothing
Else
Dim myProcess As New Process()
myProcess.StartInfo.FileName = full_file$
myProcess.Start()
End If
End If
Catch ex As Exception
ShowMessage(PDI.SourceBrowseRep.DBC, ex.Message)
End Try
End Sub
Sub ExpGData(ByVal sender As Object, ByVal e As System.EventArgs)
ExportData()
End Sub
Sub ExportData()
Me.TopMost = False
Application.DoEvents()
Dim mbc As nbfBrowseCtrl
For Each bc As nbfBrowseCtrl In PDI.SourceBrowseRep.BFInfo.SQLBrowseCtrls
If bc.CtlType = "Grid" Or bc.CtlType = "Report" Then
mbc = bc
End If
Next
If mbc Is Nothing Then
ShowMessage(PDI.SourceBrowseRep.DBC, "No Grid Or Report Found")
Return
End If
ExportGridData(mbc)
End Sub
Sub ExportGridData(ByVal bc As nbfBrowseCtrl)
Dim xtn$ = ".txt"
Dim tfcnt As Integer = 1
Dim fname$ = "TmpRep" & tfcnt.ToString & xtn$
Dim full_file$ = ""
Dim rec_sep As String = Chr(9)
Dim fok As Boolean = True
Dim fs As FileStream
Dim IncHead As Boolean
Dim pvAppPath$ = System.Windows.Forms.Application.StartupPath & "\TempExportFiles"
Dim ed As New nbfGridExportForm
ed.ShowDialog()
If ed.abandoned Then
Exit Sub
End If
IncHead = ed.ckIncludeHeaders.Checked
If ed.btnText.Checked Then
Dim fd As New System.Windows.Forms.OpenFileDialog
fd.AddExtension = True
'fd.Filter = "CsvF File|*.rtf"
fd.CheckFileExists = False
fd.CheckPathExists = True
fd.ShowDialog()
Dim FileName$ = fd.FileName
If FileName$ <> "" Then
If File.Exists(FileName$) Then
If MsgBox("Overwrite previous file?", MsgBoxStyle.YesNo Or MsgBoxStyle.DefaultButton2, "Existing File") = MsgBoxResult.No Then
Exit Sub
End If
Else
File.Delete(FileName$)
End If
fs = File.Open(FileName$, FileMode.CreateNew)
Else
Exit Sub
End If
If ed.btnCommaSeparated.Checked = True Then
rec_sep = ","
End If
Else
If Not Directory.Exists(pvAppPath$) Then
Directory.CreateDirectory(pvAppPath$)
End If
Do
fok = True
full_file$ = pvAppPath$ & "\" & fname$
If Not File.Exists(full_file$) Then
fs = File.Open(full_file$, FileMode.CreateNew)
Else
Try
File.Delete(full_file$)
fs = File.Open(full_file$, FileMode.CreateNew)
Catch ex As Exception
fok = False
tfcnt += 1
fname$ = "TmpRep" & tfcnt.ToString & xtn$
End Try
End If
Loop While Not fok
End If
Dim swr As New StreamWriter(fs)
Dim sqs As nbfSqlSource = PDI.SourceBrowseRep.GetSqSFromName(bc.SQLSource)
Dim cval As String = ""
Dim ov As Object
Dim rcnt As Integer
Dim ccnt As Integer
Dim builder As New System.Text.StringBuilder
If IncHead Then
For ccnt = 0 To sqs.SqlColInfos.count - 1
builder.Append(sqs.SqlColInfos.Item(ccnt).ColHeader)
If ccnt = (sqs.SqlColInfos.count - 1) Then
builder.Append(vbCrLf)
Else
builder.Append(rec_sep)
End If
Next
End If
Dim ds As nbfDB.nbfResultSet
ds = PDI.SourceBrowseRep.DBC.CreateNbfResultSet(sqs.LastValidatedSQL)
Do While ds.fetch()
Try
Dim cnt As Integer = 0
Dim RetVal As Double
Dim fmtStr As String
Dim nd As New Date
Dim dtVal As Date
Dim nbVal As Double
For cnt = 1 To ds.nocols
With sqs.SqlColInfos.Item(cnt - 1)
Select Case .ColType
Case "D"
If .ColFormat <> "" Then
fmtStr = .ColFormat
Else
fmtStr = "dd-MMM-yyyy"
End If
dtVal = ds.FetchDate(cnt)
If dtVal = nd Then
cval = ""
Else
cval = Format(dtVal, fmtStr)
End If
Case "I"
nbVal = ds.FetchDouble(cnt)
If .ColFormat <> "" Then
fmtStr = .ColFormat
cval = Format(nbVal, fmtStr)
Else
cval = CStr(Fix(nbVal))
End If
Case "Z"
nbVal = ds.FetchDouble(cnt)
If .ColFormat <> "" Then
fmtStr = .ColFormat
Else
fmtStr = "#,##0.00"
End If
cval = Format(nbVal, fmtStr)
Case "X"
nbVal = ds.FetchDouble(cnt)
If .ColFormat <> "" Then
fmtStr = .ColFormat
cval = Format(nbVal, fmtStr)
Else
cval = CStr(nbVal)
End If
Case "M"
nbVal = ds.FetchDouble(cnt)
If .ColFormat <> "" Then
fmtStr = .ColFormat
Else
fmtStr = "#,##0.00"
End If
RetVal = nbVal
If RetVal = 0 Then
cval = ""
Else
cval = Format(RetVal, fmtStr)
End If
Case "N"
nbVal = ds.FetchDouble(cnt)
If .ColFormat <> "" Then
fmtStr = .ColFormat
Else
fmtStr = "#,##0.00"
End If
RetVal = Fix(nbVal)
If RetVal = 0 Then
cval = ""
Else
cval = Format(RetVal, fmtStr)
End If
Case "P"
cval = "" '.NextPictureValue = ds.FetchStream(cnt)
Case Else
cval = ds.FetchString(cnt)
If .ColFormat <> "" Then
If IsNumeric(cval) Then
cval = Format(CDec(cval), .ColFormat)
End If
End If
End Select
End With
'(cval, ov, rcnt, ccnt)
builder.Append(cval)
If cnt = (sqs.SqlColInfos.count) Then
builder.Append(vbCrLf)
Else
builder.Append(rec_sep)
End If
Next
Catch ex As Exception
ShowMessage(PDI.SourceBrowseRep.DBC, ex.Message)
End Try
'For ccnt = 0 To sqs.SqlColInfos.count - 1
' GetCellValues(cval, ov, rcnt, ccnt)
' builder.Append(cval)
' If ccnt = (sqs.SqlColInfos.count - 1) Then
' builder.Append(vbCrLf)
' Else
' builder.Append(rec_sep)
' End If
'Next
Loop
swr.Write(builder.ToString)
swr.Flush()
swr.Dispose()
fs.Dispose()
If ed.btnExcel.Checked Then
Dim ldOK As Boolean = False
Dim exl As Object
Try
exl = CreateObject("Excel.Application")
exl.workbooks.open(full_file$)
ldOK = True
Catch
End Try
If ldOK Then
exl.visible = True
exl = Nothing
Else
Dim myProcess As New Process()
myProcess.StartInfo.FileName = full_file$
myProcess.Start()
End If
Else
MsgBox("Export Complete")
End If
End Sub
'Public Function GetMainControl() As nbfBrowseCtrl
' For Each bc As nbfBrowseCtrl In PDI.SourceBrowseRep.BFInfo.SQLBrowseCtrls
' If bc.CtlType = "Grid" Or bc.CtlType = "Report" Then
' Return bc
' End If
' Next
'End Function
End Class