PDA

View Full Version : مشکل در چاپ با متد PrintReport در vb6



mgh64120
یک شنبه 25 آذر 1386, 16:56 عصر
سلام خدمت شما دوستان گرامی
من در ویژوال بیسیک 6 با متد PrintReport دستور چاپ روبه کرستال ریپورت 10 به شرح ذیل صادر کردم ولی Error داد. ممنون میشم دلیل Error رو برام ذکر کنید .
Private Sub cmdprint_Click()
Dim crApp As New CRAXDRT.Application
Dim crRept As New CRAXDRT.Report
Dim Date_SH As New Class1

Set crRept = crApp.OpenReport(App.Path & "\RptDaryaft.Rpt") 'Report File
crRept.RecordSelectionFormula = "{Qdaryaft.date_sabt} = " & Val(dateprint)
frmprint.CrystalReport.ReportSource = crRept
frmprint.CrystalReport.Refresh
frmprint.CrystalReport.PrintReport
Set crApp = Nothing
Set crRept = Nothing

End Sub

Error مربوط به ویژوال بیسیک :
run-time error 2147418113 8000ffff
method printreport of object ICrystalReportViewer 10 Failed

ممنون میشه اگه اشکال کد رو بگیرید.

sm
دوشنبه 26 آذر 1386, 10:18 صبح
بهتره مشکلتون رو توی بخش VB6 مطرح کنین.

موفق باشید

behrang_viper
یک شنبه 21 آذر 1389, 00:43 صبح
سلام خدمت شما دوستان گرامی
من در ویژوال بیسیک 6 با متد PrintReport دستور چاپ روبه کرستال ریپورت 10 به شرح ذیل صادر کردم ولی Error داد. ممنون میشم دلیل Error رو برام ذکر کنید .
Private Sub cmdprint_Click()
Dim crApp As New CRAXDRT.Application
Dim crRept As New CRAXDRT.Report
Dim Date_SH As New Class1

Set crRept = crApp.OpenReport(App.Path & "\RptDaryaft.Rpt") 'Report File
crRept.RecordSelectionFormula = "{Qdaryaft.date_sabt} = " & Val(dateprint)
frmprint.CrystalReport.ReportSource = crRept
frmprint.CrystalReport.Refresh
frmprint.CrystalReport.PrintReport
Set crApp = Nothing
Set crRept = Nothing

End Sub

Error مربوط به ویژوال بیسیک :
run-time error 2147418113 8000ffff
method printreport of object ICrystalReportViewer 10 Failed

ممنون میشه اگه اشکال کد رو بگیرید.

شما باید از crRept به این صورت استفاده کنید crRept.PrintOut False