Show Report Problems

edited 12:55PM in FastReport 3.0
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???

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 12:55PM
    help us help you, give more info required
    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.
    ;)
  • edited October 2006
    Sorry for the lack of detail ... I am using FastReports version 3.24 and Delphi 2005. I am loading the fast reports in an unbound mode so the with the TfrxReport control I am using the OnGetValue Event:
    [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>

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.