Can I use TstringList in script? with FastReport pro 6.8 ,RadStudio 10.4.2

Hi,I am watanabe nobuo.

I use FastReport pro 6.8 with RadStudil 10.4.2.

AccessViolation occured one of two showreport;

Button1 have onClick Event;

like,

procedure Tform1.button1Click(Sender:tObject);

begin

 FastReport.showReport();

end;

1st button1click go well;

2nd button1click occures accessViolation;

3rd button1click go well;

4th button1click occures accessViolation;

5rd button1click go well;

6th button1click occures accessViolation;

.......

In FastReport Script,i use variable typed TStringList;

And I Create it,and Free it.

Maybe the accessviolation is occured when I use it.

Not When I create it or Free it.


When I use array of string,instead of TStringlis,

No error is occured.


Can't I use TStringList in FastReport Script?

Sincerely.


<sample code>

var

 slName:tStringList;


procedure GroupHeader1OnBeforePrint(Sender: TfrxComponent);

var

 i:integer;                                              

begin

 for i:=slName.count -1 downto 0 do// Maybe error is occured here

 begin

   if slName[i]=inttostr(<frDBu."name">)

   then begin

     dispData := slPages[i];   

     exit;                 

   end;             

 end;           

end;


procedure frxReport1OnStartReport(Sender: TfrxComponent);

begin

 if engine.FinalPass then exit;

 slName := tStringList.create;

end;


procedure frxReport1OnStopReport(Sender: TfrxComponent);

begin

 slName.Free;         

end;

begin

end.

Comments

  • Maybe debug your script to see if GroupHeader1OnBeforePrint is still being used in final pass?

    The delphi debugger should still help you find out where the A/V is coming from or EurekaLog

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.