Option Strict Off
Option Explicit On
Friend Class frmVisualizaRel
	Inherits System.Windows.Forms.Form
	Private iintZoom As Short
	Private ifrmQuemChama As System.Windows.Forms.Form
	'Public icrdAux As New crdAuxiliar
	
	Private Sub cmdConfiguraImpressora_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdConfiguraImpressora.Click
		'Call icrdAux.PrinterSetup(Me.Hwnd)
	End Sub
	
	Private Sub cmdExportar_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdExportar.Click
		'Call icrdAux.Export
	End Sub
	
	Private Sub cmdFechar_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdFechar.Click
		Call Me.Close()
	End Sub
	
	Private Sub cmdImprimir_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdImprimir.Click
		CRVRelatorio.PrintReport()
	End Sub
	
	Private Sub cmdPaginaAnterior_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdPaginaAnterior.Click
		CRVRelatorio.ShowPreviousPage()
	End Sub
	
	Private Sub cmdPaginaPrimeira_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdPaginaPrimeira.Click
		CRVRelatorio.ShowFirstPage()
	End Sub
	
	Private Sub cmdPaginaProximo_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdPaginaProximo.Click
		CRVRelatorio.ShowNextPage()
	End Sub
	
	Private Sub cmdPaginaUltima_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdPaginaUltima.Click
		CRVRelatorio.ShowLastPage()
	End Sub
	
	Private Sub CRVRelatorio_DblClicked(ByVal eventSender As System.Object, ByVal eventArgs As AxCRVIEWERLib._ICRViewerEvents_DblClickedEvent) Handles CRVRelatorio.DblClicked
		If iintZoom >= 1 Then iintZoom = iintZoom + 1
		If iintZoom > 2 Then iintZoom = 1
		Call CRVRelatorio.Zoom(iintZoom)
	End Sub
	
	Private Sub CRVRelatorio_DownloadFinished(ByVal eventSender As System.Object, ByVal eventArgs As AxCRVIEWERLib._ICRViewerEvents_DownloadFinishedEvent) Handles CRVRelatorio.DownloadFinished
		Me.lblPaginas.Text = "Página: " & CRVRelatorio.GetCurrentPageNumber
	End Sub
	
	Private Sub frmVisualizaRel_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
		iintZoom = 1
		'Me.CRVRelatorio.ReportSource = icrdAux
	End Sub
	
	'UPGRADE_WARNING: Event frmVisualizaRel.Resize may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="88B12AE1-6DE0-48A0-86F1-60C0686C026A"'
	Private Sub frmVisualizaRel_Resize(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Resize
		Me.CRVRelatorio.Top = VB6.TwipsToPixelsY(900)
		Me.CRVRelatorio.Left = 0
		Me.CRVRelatorio.Height = VB6.TwipsToPixelsY((VB6.PixelsToTwipsY(Me.ClientRectangle.Height) - 900))
		Me.CRVRelatorio.Width = Me.ClientRectangle.Width
	End Sub
	
	Public Sub SetParametros(ByRef afrmQuemChama As System.Windows.Forms.Form)
		ifrmQuemChama = afrmQuemChama
		ifrmQuemChama.Enabled = False
	End Sub
	
	Private Sub frmVisualizaRel_FormClosed(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
		ifrmQuemChama.Enabled = True
	End Sub
End Class