【问题标题】:vb6 print Crystal report without preview and click print buttonvb6打印没有预览的水晶报表并点击打印按钮
【发布时间】:2015-10-19 03:31:03
【问题描述】:

我正在使用 VB6 和 Crystal Report 8.5,我想直接使用默认打印机打印我的报表,无需预览并单击打印按钮。我有这段代码,但是当我尝试打印时,它会显示预览,我必须单击打印按钮才能进行打印 这是我的代码

With MAIN.CR
    .Reset: MAIN.InitCrys
    .ReportFileName = App.Path & "\Reports\rptCashInvoice.rpt"
    .Connect = "POS"

    strTitle = "Cash Invoice"

    strSelFormula = "{Cash_Sales.InvoiceNo} ='" & InvoiceNo & "'"

    .SelectionFormula = strSelFormula

            .WindowTitle = strTitle

            .ParameterFields(0) = "prmCompany;" & CurrBiz.BUSINESS_NAME & ";True"
            .ParameterFields(1) = "prmAddress;" & CurrBiz.BUSINESS_ADDRESS & ";True"
            .ParameterFields(2) = "prmContactInfo;" & CurrBiz.BUSINESS_CONTACT_INFO & ";True"

            .PrintReport
            .DiscardSavedData = True
End With

【问题讨论】:

    标签: printing crystal-reports vb6


    【解决方案1】:

    尝试类似:

    Dim crxApp As CRAXDRT.Application
    Dim crxRpt As CRAXDRT.Report
    
    Set crxApp = New CRAXDRT.Application
    Set crxRpt = crxApp.OpenReport("C:\MyReport.rpt")
    
    crxRpt.PrintOut False, NoCopies 
    

    如果您需要在非默认打印机上打印报告,请尝试使用 SelectPrinter。

    Look at this page.

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-08-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多