Results 1 to 5 of 5

Thread: Error in CR

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    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

  2. #2
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    Re: Error in CR

    You can take out this line --->
    Code:
    CRViewer1.ReportSource = rpt

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    Re: Error in CR

    So simple no...

    Thanks a lot

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    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

  5. #5
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    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
  •  



Click Here to Expand Forum to Full Width