views:

275

answers:

1

We are currently working with Delphi 2006, but we are now very ready to move on to Delphi 2010.

The problem lies in our Rave reports, though...

We just get to many string errors when running our reports with Rave 8. And they just don't make any sense. (The reports compile with no error, and we can even run them without any error in Rave 6.)

Update: The errors occurs inside the event scripts in the reports itself. The errors are related to strings and string concatenation.

For instance:

//This event causes access violation (in rtl140.bpl) at run time
{ Event for Page1.OnBeforeReport }
function Page1_OnBeforeReport(Self: TRavePage);
var
  s: String;
begin
  s := 'My text in param';
  s := s + ' and som more text';
  s := copy(s,1,length(s)) + ' and then some more';           //<-- This line causes AV
  RaveProject.SetParam('MyTestParam', s);
end OnBeforeReport;


//This event works OK
{ Event for Page1.OnBeforeReport }
function Page1_OnBeforeReport(Self: TRavePage);
var
  s: String;
begin
  s := 'My text in param';
  s := s + ' and som more text';
  s := copy(s,1,length(s));                                   //<-- This line is OK
  RaveProject.SetParam('MyTestParam', s);
end OnBeforeReport;


//This event works OK too
{ Event for Page1.OnBeforeReport }
function Page1_OnBeforeReport(Self: TRavePage);
var
  s: String;
begin
  s := 'My text in param';
  s := s + ' and som more text';
  s := copy(s,1,length(s)) + s;                               //<-- This line is OK
  RaveProject.SetParam('MyTestParam', s);
end OnBeforeReport;

We really want to stick to Rave, because we have a lot of reports (150+) with a lot of functionality (sql statements, events etc). Besides, we have customers who have designed their own custom reports as well.

Does anybody know the reason for these errors?
Is there any solution or workaround to these problems?

+1  A: 

What an accident, I do the same thing yesterday. 19 from 20 reports work fine. The problem with the one was a script using SetParam and DataMemo with ContainsRTF = True.

My solution for SetParam was to replace it with calculated fields in my DataSet. For DataMemo with ContainsRTF = True I found no solution other than switching ContainsRTF to False (but I am lucky, RTF wasn't really needed)

Heinz Z.
Thanks for this tip about ContainsRTF, but this wouldn't help much in our case. The events above is in the report itself, not in Delphi. And the AV occurs because of the string concatenation, not the SetParam method.
Jørn E. Angeltveit
The script I am talking about was also in a rave report. Have you try (for a test) to delete the SetParam? I have tested string concatenation and have no problems. And also important: When you get the first AV you have to shutdown your Application. Because after that you get always an AV even if you correct your Rave Report.
Heinz Z.
Sorry. I'm not experiencing the same behavior. :-( I've tried to delete the SetParam, but with no change in the reports behavior. And the AVs are consistent even if I restart the application or not.
Jørn E. Angeltveit
I'm starting to suspect that this is an incorrigible unicode problem that has been around since version 7.5.
Jørn E. Angeltveit