Jump to content
Fórum Script Brasil
  • 0

Função Preview no Crystal reports


Luiz Melo

Question

Ola senhores do Conselho! Boa tarde.

Uma pequena ajuda...

Tenho um relatorio conforme abaixo e gostaria de emiti-lo sem que aparecesse o preview. Gostaria que, ao clicar em Imprimir já fosse direto para a impressora padrão. Tem como? Do jeito que esta ai, ele vai direto para a impressora MAS mostra o preview na tela...

Obrigado pela ajuda.

VS Basic 2005

Crystal/

   Private Sub ImprRecEntrega(ByVal IDPED As Integer, ByVal IDCES As Integer, ByVal IDCLI As Integer, ByVal QTDCES As Integer)
        Dim xAprov As String = " "
        Dim xReprov As String = " "
        Dim xPor As String = " "
        Dim xQuando As Date = Nothing
        Dim stringConexao As String = My.Settings.Caminho.ToString
        Dim conn As New OleDbConnection(stringConexao)

        Dim daClientes As New OleDbDataAdapter("Select * from Clientes Where ID_CLI = " & IDCLI, conn)
        Dim daItemCes As New OleDbDataAdapter("SELECT ITEMCES.ID_ITC, ITEMCES.CODPRODU, ITEMCES.QTDCESTA, " & _
                                            "PRODUTO.DESCRICAO, PRODUTO.UNIDADE, ITEMCES.CODCESTA " & _
                                            "FROM ITEMCES INNER JOIN PRODUTO ON ITEMCES.[CODPRODU] = PRODUTO.[ID_PRO] " & _
                                            "WHERE (((ITEMCES.CODCESTA)=" & IDCES & "))", conn)


        Dim dsRelatorio As New dsRecEntrega
        conn.Open()
        daClientes.Fill(dsRelatorio.CLIENTES)
        daItemCes.Fill(dsRelatorio.ITEMCES)

        conn.Close()

        If dsRelatorio.ITEMCES.Count > 34 Then
            Dim relatorio As New crReciboEnt35
            relatorio.SetDataSource(dsRelatorio)
            relatorio.SetParameterValue("NROPED", IDPED)
            relatorio.SetParameterValue("QTDECES", QTDCES)
            relatorio.PrintToPrinter(1, True, 0, 0)
            Dim f As New frmRelatorio(relatorio)
            f.Show()

        Else
            Dim relatorio As New crReciboEnt
            relatorio.SetDataSource(dsRelatorio)
            relatorio.SetParameterValue("NROPED", IDPED)
            relatorio.SetParameterValue("QTDECES", QTDCES)
            relatorio.PrintToPrinter(1, True, 0, 0)
            Dim f As New frmRelatorio(relatorio)
            f.Show()
        End If

    End Sub

Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

TENHO O SEGUINTE CODIGO E O MESMO TEM O PROBLEMA DE EXIBIR SEMPRE O PREVIEW  , OBS , NÃO USO DATASOURCE alguém AJUDA

 

Dim report As New ReportDocument

            report.PrintOptions.PrinterName = "Argox OS-214 plus series PPLA"
            report.Load("../../CrystalReportEtiqueta.rpt", OpenReportMethod.OpenReportByDefault)
            report.SetParameterValue(0, FormPrincipal.TextBoxOperador.Text)
            report.SetParameterValue(1, FormPrincipal.TextBoxInspetores.Text)
            report.SetParameterValue(5, FormPrincipal.TextBoxLoteA.Text)
            report.SetParameterValue(3, FormPrincipal.TextBoxClienteA.Text)
            report.SetParameterValue(4, FormPrincipal.TextBoxProdutoA.Text)
            report.SetParameterValue(2, FormPrincipal.ComboBoxTurno.Text)
            report.SetParameterValue(6, FormPrincipal.TextBoxCodAltA.Text)
            report.SetParameterValue(7, FormPrincipal.TextBoxQuantEmbA.Text)
            report.SetParameterValue(8, Date.Now())
            report.PrintToPrinter(1, False, 0, 0)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Cloud Computing


  • Forum Statistics

    • Total Topics
      148863
    • Total Posts
      644886
×
×
  • Create New...