Sie sind auf Seite 1von 2

Private _saveFileDialog As New SaveFileDialog()

Private Sub btnExportXLS_Click(ByVal sender As Object, ByVal e As EventArgs)


_saveFileDialog.FileName = String.Empty
_saveFileDialog.Filter = "Files (*.xls;*.xlsx;*)|*.xls;*.xlsx;*"
_saveFileDialog.FileName = "NotaPedido"
Dim ultraGridExcelExporter As New UltraGridExcelExporter()
If _saveFileDialog.ShowDialog() = DialogResult.OK Then
ultraGridExcelExporter.Export(Me.ugManagement,
_saveFileDialog.FileName)
UtilMessageBox.Show(Me, "Se exportaron correctamente los
datos.", "INFORMACI�N", MessageBoxButtons.OK, MessageBoxIcon.Information,
MessageBoxDefaultButton.Button1, GlobalVariable._systemName)
End If
End Sub

Private Sub btnExportPDF_Click(ByVal sender As Object, ByVal e As EventArgs)


_saveFileDialog.FileName = String.Empty
_saveFileDialog.Filter = "Files (*.pdf;)|*.pdf;"
_saveFileDialog.FileName = "NotaPedido"
Dim ultraGridDocumentExporter As New UltraGridDocumentExporter()
If _saveFileDialog.ShowDialog() = DialogResult.OK Then
ultraGridDocumentExporter.Export(Me.ugManagement,
_saveFileDialog.FileName, GridExportFileFormat.PDF)
UtilMessageBox.Show(Me, "Se exportaron correctamente los
datos.", "INFORMACI�N", MessageBoxButtons.OK, MessageBoxIcon.Information,
MessageBoxDefaultButton.Button1, GlobalVariable._systemName)
End If
End Sub

Public Class UtilMessageBox


Public Shared Function Show(ByVal owner As IWin32Window, ByVal message
As String, ByVal caption As String, ByVal buttons As MessageBoxButtons, ByVal icon
As MessageBoxIcon, ByVal defaultButton As MessageBoxDefaultButton, ByVal HeaderText
As String, Optional ByVal customImage As Image = Nothing) As DialogResult
Dim DialogReturning As DialogResult

' Create an UltraMessageBoxInfo and set all the appropriate


properties
Using messageBoxInfo As New UltraMessageBoxInfo()
' custom image
If customImage IsNot Nothing Then
messageBoxInfo.ContentAreaAppearance.Image =
customImage
End If
messageBoxInfo.TextFormatted = message
messageBoxInfo.Caption = caption
messageBoxInfo.Buttons = buttons
messageBoxInfo.Icon = icon
messageBoxInfo.DefaultButton = defaultButton
'messageBoxInfo.ButtonAreaAppearance.BackColor =
Color.LightSteelBlue;
messageBoxInfo.ButtonAppearance.FontData.Bold =
DefaultableBoolean.True
messageBoxInfo.EnableSounds =
Infragistics.Win.DefaultableBoolean.False
'messageBoxInfo.MaximumWidth = 700;
messageBoxInfo.Owner = owner
messageBoxInfo.Style = MessageBoxStyle.Default
'messageBoxInfo.HeaderAppearance.BackColor =
Color.LightGray;
messageBoxInfo.HeaderFormatted =
String.Format("<i>{0}</i>", HeaderText)
messageBoxInfo.FooterFormatted = "Link a <a
href=""http://www.frigoperu.com""> http://www.frigoperu.com</a>"
'messageBoxInfo.FooterAppearance.BackColor = Color.Gold;

'messageBoxInfo.ShowHelpButton =
Infragistics.Win.DefaultableBoolean.False;
'this.ultraMessageBoxManager1.ButtonAlignment =
HAlign.Right;
DialogReturning =
UltraMessageBoxManager.Show(messageBoxInfo)

End Using

Return DialogReturning
End Function

End Class

Das könnte Ihnen auch gefallen