Print Page | Close Window

Error in CR

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=4624
Printed Date: 20 May 2024 at 1:37am


Topic: Error in CR
Posted By: sacramento
Subject: Error in CR
Date Posted: 25 Oct 2008 at 2:55pm
Hi to all:
 
Hi have this code to print a report without see the report:
 
Private Sub Command11_Click()
 
Dim rpt As CRAXDRT.Report
Set Report = New CRAXDRT.Application
Set rpt = Report.OpenReport(App.Path & "\Ficha_Inscricao.rpt")
If (rpt.HasSavedData) Then rpt.DiscardSavedData
 
rpt.EnableParameterPrompting = False
nomeclube = frmopcoesgerais.Text5(1).Text
morada = (frmopcoesgerais.Text5(2).Text) + "  " + (frmopcoesgerais.Text5(3).Text) + "  " + (frmopcoesgerais.Text5(4).Text)
nomeexposicao = frmopcoes.Text1(8).Text
dataexposicao = frmopcoes.Text1(10).Text

Dim myTextObject As CRAXDRT.TextObject
Set myTextObject = rpt.Sections("PH").ReportObjects("Text1")
myTextObject.SetText (nomeclube)

rpt.ParameterFields.GetItemByName("secao1").AddCurrentValue (frmgestaoexposicao.Combo2(1))
rpt.ParameterFields.GetItemByName("secao2").AddCurrentValue
 
CRViewer1.ReportSource = rpt
rpt.PrintOut False
End Sub
 
I can print the report just one time,because the second time,i try to print,i got this error:
 
Run time error:
Method 'ReportSource' of object  'ICrystalreportviewer11' failed
 
 
Anyone know why this happen?
 
Thanks
 
 



Print Page | Close Window