List Index Out of Bounds
I'm in the process of converting reports from FastReports 2.5 over to 3.0 and for a particular master-detail report, upon trying to preview the new format in 3.0 I get the following error:
List Index Out of Bounds(0)
The preview is actually printing the first master record and 4 out of the first 5 detail records for that master record. Any idea what this error msg could be trying to tell me?
Could this be because I have some pascalscript behind some of the memo boxes that is doing a comparison, and for some rows these fields are NULL? (i.e. in the example below, SUBMITTED_DATE might be NULL for some rows)
procedure Memo21OnBeforePrint(Sender: TfrxComponent);
begin
with Memo21, Engine do
begin
IF (<detail_DataSet."SUBMITTED_DATE"> >0) THEN
Memo21.Lines[0]:='<detail_DataSet."SUBMITTED_DATE">'
ELSE Memo21.Lines[0]:='NO';
end
end;
List Index Out of Bounds(0)
The preview is actually printing the first master record and 4 out of the first 5 detail records for that master record. Any idea what this error msg could be trying to tell me?
Could this be because I have some pascalscript behind some of the memo boxes that is doing a comparison, and for some rows these fields are NULL? (i.e. in the example below, SUBMITTED_DATE might be NULL for some rows)
procedure Memo21OnBeforePrint(Sender: TfrxComponent);
begin
with Memo21, Engine do
begin
IF (<detail_DataSet."SUBMITTED_DATE"> >0) THEN
Memo21.Lines[0]:='<detail_DataSet."SUBMITTED_DATE">'
ELSE Memo21.Lines[0]:='NO';
end
end;
Comments
syntax will have to be modified to suit fr3
The converter does not actually parse every character of the block of code encountered it just places the string of code in a safe event.of the correct object.
ie
memo21.memo.lines[0]
or you could actually use an iif expression on that line in the memo
also check the settings of report component, if convert nulls is true
then you need to check for 0 or empty string if field type is numeric or string
if convert nulls is false then you can test for null.