hulken
asked on
TStringlist and Tstrings
Hi!
I have just upgraded from Delphi5 and ReportBuilder 5 to
Delphi6 and ReportBuilder6
It seems to be some changes in RB6 that gives me problems.
Here is my working code for RB5:
SubReports := TStringlist.Create;
ppReportFromTreStruct.GetS ubReports( SubReports );
MainChild := TppChildReport(SubReports. ObjectsSub Reports.In dexOf('Mai nPage')]);
I get ListIndex Out Of bands when I run this.
In the help form GetSubReports :
Declaration
procedure GetSubReports(aReportList: TStrings);
Description
Returns a list of handles to all of the TppChildReport objects within a report in the Objects property of the TStrings. The Caption of the TppSubReport component is saved in the main property of the TString.
This Means that I should use TStrings instead of TstringList or?
OK I try to change to:
SubReports := TStrings.Create;
ppReportFromTreStruct.GetS ubReports( SubReports );
MainChild := TppChildReport(SubReports. Objects[Su bReports.I ndexOf('Ma inPage')]) ;
Now I get som compiler warnings:
[Warning] Report.pas(708): Constructing instance of 'TStrings' containing abstract method 'TStrings.Clear'
[Warning] Report.pas(708): Constructing instance of 'TStrings' containing abstract method 'TStrings.Delete'
[Warning] Report.pas(708): Constructing instance
of 'TStrings' containing abstract method 'TStrings.Insert'
And the program crashes with Abstract Error on the row:
ppReportFromTreStruct.GetS ubReports( SubReports );
Can someone help me out?
I have just upgraded from Delphi5 and ReportBuilder 5 to
Delphi6 and ReportBuilder6
It seems to be some changes in RB6 that gives me problems.
Here is my working code for RB5:
SubReports := TStringlist.Create;
ppReportFromTreStruct.GetS
MainChild := TppChildReport(SubReports.
I get ListIndex Out Of bands when I run this.
In the help form GetSubReports :
Declaration
procedure GetSubReports(aReportList:
Description
Returns a list of handles to all of the TppChildReport objects within a report in the Objects property of the TStrings. The Caption of the TppSubReport component is saved in the main property of the TString.
This Means that I should use TStrings instead of TstringList or?
OK I try to change to:
SubReports := TStrings.Create;
ppReportFromTreStruct.GetS
MainChild := TppChildReport(SubReports.
Now I get som compiler warnings:
[Warning] Report.pas(708): Constructing instance of 'TStrings' containing abstract method 'TStrings.Clear'
[Warning] Report.pas(708): Constructing instance of 'TStrings' containing abstract method 'TStrings.Delete'
[Warning] Report.pas(708): Constructing instance
of 'TStrings' containing abstract method 'TStrings.Insert'
And the program crashes with Abstract Error on the row:
ppReportFromTreStruct.GetS
Can someone help me out?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>use tstringlist again, and examine the list you get ...
to get the correct naming (maybe all is uppercased now)
to get the correct naming (maybe all is uppercased now)
ASKER
Thanks.... It was not uppercased but they have done som oterh (stupid) changes in ReportBuilder.
well, glad you get it work,
thanks for the points :-)
meikl ;-)
thanks for the points :-)
meikl ;-)
i guess the porblem is that
SubReports.IndexOf('MainPa
in
MainChild := TppChildReport(SubReports.
returns -1
there is no entry 'MainPage'
and -1 is out of bounds of course
meikl ;-)