Avatar of mbarazi
mbarazi
Flag for United States of America asked on

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

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

Visual Basic ClassicVisual Basic.NETCrystal Reports

Avatar of undefined
Last Comment
mbarazi

8/22/2022 - Mon
Mike McCracken

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

mbarazi

ASKER
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 McCracken

DO you have Crystal installed on your machine?

Look for SEAGATE SOFTWARE in Program Files

mlmcc
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
mbarazi

ASKER
Yes I have seagate installed and it's version 8.0. Thanks
ASKER CERTIFIED SOLUTION
Mike McCracken

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
mbarazi

ASKER
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.
mbarazi

ASKER
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.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.