Show Report Problems
I have a embedded report in my Delphi 2005 program which is giving me an odd error. When I open the the report (freport3Presentation.ShowReport) initially it opens fine and I have no errors. But when I close the preview window down and call the report to open a second time I get two errors and the report opens blank.
The errors are "Access violation address 009255A9" followed by a "Undeclared Identifier" error.
I have never seen an error like this in the past with other FastReports I've used in this application ... does anyone have any ideas what I may be doing wrong???
The errors are "Access violation address 009255A9" followed by a "Undeclared Identifier" error.
I have never seen an error like this in the past with other FastReports I've used in this application ... does anyone have any ideas what I may be doing wrong???
Comments
frversion and level? ie 3.24 pro
the code where you load the report and call showmethod, and what comes after,
are you in a custom preview?
is report stored in dfm?
is this a report converted from a previous version?
the more info the better.
[code]
<span style='color:blue'>procedure TformMainMDIParent.freport3PresentationGetValue(const VarName: string; var Value: Variant);
begin
try
if AnsiCompareText(VarName, 'ReportDate') = 0 then
Value := Trim(QISResearchMDIChild.mdgPresentationData[freport3dsPresentation.RecNo,0])
else if AnsiCompareText(VarName, 'SourceName') = 0 then
Value := Trim(QISResearchMDIChild.mdgPresentationData[freport3dsPresentation.RecNo,1])
else if AnsiCompareText(VarName, 'ReportName') = 0 then
Value := Trim(QISResearchMDIChild.mdgPresentationData[freport3dsPresentation.RecNo,2])
// Graph ... Please See freport3PresentationBeforePrint Procedure
else if AnsiCompareText(VarName, 'Title') = 0 then
Value := Trim(QISResearchMDIChild.mdgPresentationData[freport3dsPresentation.RecNo,4])
else if AnsiCompareText(VarName, 'Description') = 0 then
Value := Trim(QISResearchMDIChild.mdgPresentationData[freport3dsPresentation.RecNo,5]);
except
on E: Exception do
begin
MessageDlg(E.Message,mtError,[mbOK],0);
end;
end;
end;</span>
... and with the tfrxUserDataSet control (that is associated with the report) I am using the OnCheckEOF Event:
[code]
<span style='color:blue'>procedure TformMainMDIParent.freport3dsPresentationCheckEOF(Sender: TObject; var Eof: Boolean);
begin
if msqlQISUserdb.GetRowCount >= 1 then
Eof := freport3dsPresentation.RecNo >= (msqlQISUserdb.GetRowCount)
else
Eof := freport3dsPresentation.RecNo >= 0;
end;</span>
I am calling the report to display via the following code (I have the report preview window opening as a MDIChild):
[code]
<span style='color:blue'>freport3Presentation.ShowReport;</span>
This is the same type of code I use with other report modules in this program which I can open and close multiple times without any problems. With this report (as stateted in the earlier post) I get a number of errors if I try to open/close and then reopen.
The only other items which are unique to this report verses the other reports I'm using is:
1. This one is a two page report rather than just one
2. I utilize the OnBeforePrint Event in the TfrxReport control to specify some graphics which are used in the report
[code]
<span style='color:blue'>procedure TformMainMDIParent.freport3PresentationBeforePrint(Sender: TfrxReportComponent);
begin
if Sender.Name = 'GraphIn' then
TfrxPictureView(Sender).Picture.LoadFromFile(QISResearchMDIChild.mdgPresentationData[freport3dsPresentation.RecNo,3]);
end;</span>