Option Strict Off
Option Explicit On
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared


Friend Class frmViewRelatorios
    Inherits System.Windows.Forms.Form

    Public rpt As ReportDocument
    Public Orientation As PaperOrientation = PaperOrientation.DefaultPaperOrientation

#Region "Propriedades"

    Private Sub frmViewRelatorios_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load

        Try
            Me.WindowState = FormWindowState.Maximized
            CRViewer.ReportSource = rpt
            rpt.PrintOptions.PaperOrientation = PaperOrientation.Portrait
            CRViewer.Show()

        Catch ex As Exception
            MessageBox.Show("Ocorreu o Erro: " & Err.Description & " - Rotina: frmViewRelatorios_Load" & "", "Aviso de Erro", MessageBoxButtons.OK, MessageBoxIcon.Error)
            'MessageBox.Show("Ocorreu um Erro Inesperado. Favor, Contate o Administrador do Sistema ou a Equipe de Suporte de sua localidade! ", "Fatal - Erro", MessageBoxButtons.OK, MessageBoxIcon.Error)
            Exit Sub
        End Try

    End Sub

    Private Sub frmViewRelatorios_Resize(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Resize

        Try

            CRViewer.Top = 0
            CRViewer.Left = 0
            CRViewer.Height = ClientRectangle.Height
            CRViewer.Width = ClientRectangle.Width

        Catch ex As Exception
            MessageBox.Show("Ocorreu o Erro: " & Err.Description & " - Rotina: frmViewRelatorios_Resize" & "", "Aviso de Erro", MessageBoxButtons.OK, MessageBoxIcon.Error)
            'MessageBox.Show("Ocorreu um Erro Inesperado. Favor, Contate o Administrador do Sistema ou a Equipe de Suporte de sua localidade! ", "Fatal - Erro", MessageBoxButtons.OK, MessageBoxIcon.Error)
            Exit Sub
        End Try

    End Sub

    Private Sub frmViewRelatorios_FormClosed(sender As Object, e As FormClosedEventArgs) Handles MyBase.FormClosed
        Me.Dispose()
    End Sub

#End Region

End Class