Results 1 to 7 of 7

Thread: [RESOLVED]Second call to CR fail

Threaded View

  1. #1

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

    Resolved [RESOLVED]Second call to CR fail

    Hi to all:

    I have this code for a report in VB6:

    Code:
    Set Report = New CRAXDDRT.Application
    Set Rpt = Report.OpenReport(App.Path & "\Ficha_Individual.rpt")
    
    If (Rpt.HasSavedData) Then Rpt.DiscardSavedData
    
    'set the section object to the Page Header section of the report.
    Set oSection = Rpt.Sections("PH")
    
    For i = 1 To oSection.ReportObjects.Count 
      If oSection.ReportObjects(i).Kind = CRAXDDRT.crOleObject Then ' if it is a CrOleObject then
          Set pic1 = oSection.ReportObjects(i) 
      End If
     Next i
     
    Rpt.ParameterFields.GetItemByName("anilha").AddCurrentValue (FrmFicha_Aves_Mortas.Text1(1))
    
    setviewersize
    
    CRViewer1.ReportSource = Rpt
    
    CRViewer1.ViewReport
    When I call the report everything work well...When I make a second call a got this error in this line:

    Error:"Object doens't support this action"

    Code:
    'set the section object to the Page Header section of the report.
    Set oSection = Rpt.Sections("PH")
    I need to refresh the report or do something?

    Thanks
    Last edited by sacramento; Aug 11th, 2008 at 11:21 PM.

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