|
-
Oct 27th, 2008, 05:54 PM
#1
Thread Starter
Frenzied Member
Error in CR
Hi to all:
Hi have this code to print a report without see the report:
Code:
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
-
Oct 27th, 2008, 08:24 PM
#2
Re: Error in CR
You can take out this line --->
Code:
CRViewer1.ReportSource = rpt
-
Oct 28th, 2008, 04:34 AM
#3
Thread Starter
Frenzied Member
Re: Error in CR
So simple no...
Thanks a lot
-
Oct 29th, 2008, 05:18 AM
#4
Thread Starter
Frenzied Member
Re: Error in CR
Just one more question...
Do you know why,when printing without viewer, the settings of the printer defined by windows are not accepted?
Thats because i have my printer defined just for printing in black & white but when I print with this mode the print sort in coulours!!!strange no?
Thanks
-
Nov 3rd, 2008, 01:58 AM
#5
Re: Error in CR
Not tested by myself but ... probably it is taking the properties of the printer definitions when the rpt was designed... try in Crystal Reports : File / Printer SetUp / Check No Printer
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|