Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

10.08 Report Preview

edited June 2008 in General
We're using Reportbuilder Enterprise Edition, 10.07, with Delphi 2007.

I'm just testing 10.08 and it appears that OnSaveStart is triggered when a
new report is previewed. I am certain that this never happened in 10.07.
We are storing our reports in a DB.

I'm still trying to sort out the exact timing of this problem. Has anyone
experienced this problem?

Leah

Comments

  • edited June 2008
    Hi Leah,

    Are you able to see this with a simple example? In my quick testing
    (report, designer, button on a form) I was unable to get the
    Template.OnSaveStart event to fire unless I saved the template to file/DB.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2008
    Hi Nico,

    Okay, I've figured out the problem -- it's in SaveReportToStream in
    ppDesignPreview.pas (called during Preview):

    10.08:
    ------------
    // if RAP not being used, exit
    if (lModuleClass = nil) then Exit;

    // if Delphi design-time and report does not contain RAP code, exit
    if gbDesignTime and (FReport.GetModuleForClass(lModuleClass) = nil) then
    Exit;
    ------------

    10.07:
    ------------
    if (lModuleClass = nil) or (FReport.GetModuleForClass(lModuleClass) = nil)
    then Exit;
    ------------

    So in 10.07, this is true "FReport.GetModuleForClass(lModuleClass) = nil" so
    I'm not prompted to Save.

    In 10.08, it's not gbDesignTime, so I AM prompted to Save.

    I'm not sure why this change was made? Am I correct here? Maybe it should
    be Design Time "OR" the report has no RAP?

    Leah

  • edited June 2008
    The change was made because customers complained the behavior was not
    consistent. When using the end-user designer, some reports were
    save/restored when selecting/deselecting Preview while other reports were
    not. When a report is previewed, event-handler code may fire that modifies
    the report, therefore a save/restore to an internal stream is performed.


    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited June 2008
    So you can no longer preview a report that hasn't been saved?

    Leah


  • edited June 2008


    It is saved to an internal memory stream.

    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited June 2008
    I am checking for duplicate report titles OnSaveStart, so my dialog is
    triggered on the preview. I guess I'll have to change this.

  • edited June 2008

    Tryy adding a check to your OnSaveStart event-handler code.

    uses
    ppTypes, ppComm;


    if (pppcDesignPreviewing in Report.DesignState) then
    // report is previewing




    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited June 2008
    Thanks. Worked a charm.

    Leah

This discussion has been closed.