We help IT Professionals succeed at work.

Crystal reports causes an error invalid index after being opened and having "any" change applied and saved

1,382 Views
Last Modified: 2013-12-25
I have a windows service written in vb.net 1.1 using vs 2003. I also have a crystal reports template version 8.0. I have recently been asked to modify this report by shifting a text object on the report about a centimeter over. I have done this and now the application throws an invalid index error on the following line of code :

.ReportObjects("TrayDisclaimerUpper").SetText(strUpper)

The code in the service simply refrences report objects by name and sets text string for those text objects on the report template. I have not changed anything on the report. On the developement machine I have both crystal 8 and crystal 10 installed. the exact error I get is:  
Run-time exception thrown : System.Runtime.InteropServices.COMException - Invalid index
If mReportType = mdlGlobalVariables.rptReportType.rptCarton Then
            'TIM 11780 cmj 9/8/05 - removed subreport code
            With mReport.Sections("D")
                .ReportObjects("TrayDisclaimerUpper").SetText(strUpper)
                .ReportObjects("TrayDisclaimerLower1").SetTex(strLower1)
                .ReportObjects("TrayDisclaimerLower3").SetTex(strLower3)
End With
        Else
            mReport.Sections("Header1").ReportObjects("TrayDisclaimerUpper").SetText(strUpper)
            mReport.Sections("DisclaimerTrayLower1").ReportObjects("TrayDisclaimerLower1").SetText(strLower1)
            mReport.Sections("DisclaimerTrayLower2").ReportObjects("TrayDisclaimerLower2").SetText(strLower2)
            mReport.Sections("Footer").ReportObjects("TrayDisclaimerLower3").SetText(strLower3)
        End If

Open in new window

Comment
Watch Question

Mike McCrackenSenior Consultant
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2013

Commented:
Are you changing the report in the CR8 designer or inside the VB.Net application?
If inside the application, make sure it is referencing the V CR8 dlls and not the CR10 dll.

mlmcc

Author

Commented:
I am changing the report from within crystal 8.0. I checked the dlls refrenced and I have CRAXDRT which is crystal design time run library ver8.0. The application seems to work fine as long as I don't open the report and save from crystal 8. I did read something in our documentation to open up the crystal designer in VB6 but I don't know what they mean by that. Thanks.
Mike McCrackenSenior Consultant
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2013

Commented:
DO you have Crystal installed on your machine?

Look for SEAGATE SOFTWARE in Program Files

mlmcc

Author

Commented:
Yes I have seagate installed and it's version 8.0. Thanks
Senior Consultant
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2013
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Thanks a lot for the help, this was very fraustrating. I have found the designer and changed the reports and then saved it to crystal.

Author

Commented:
The crystal report was designed using the designer from vb6. You can see if you have this by opening a standard form project, right click form and go to add and you should see crystal reports 8 as an option. Although I could view the report from within seagate crystal 8 and change it. I had to open the report from VB6 crystal designer and modify the report there and then export the report to crystal format. Otherwise I would loose all my refrences to the text objects in the report if I save in any other application. Thanks.
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.