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

OnCustomSaveDoc

edited November 2008 in End User
?Hello,

I'm using RB11.01 with Delphi 7 and we've extended EndUsr to make a custom
Designer.

The issue I'm having is that I can't get the OnCustomSaveDoc event to
fire. From what I've read, just having events assigned to that should fire
them, but we have a method assigned to it and it's never getting fired.

Thanks



--- posted by geoForum on http://delphi.newswhat.com

Comments

  • edited November 2008
    Hi Yottskry,

    Are you able to recreate this with one of the end-user demos located in the
    \RBuilder\Demos\3. EndUser\... directory? In my quick testing, the
    OnCustomSaveDoc event fired successfully when trying to save a report.

    What customizations are you making to the designer?

    --
    Regards,

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

    Best Regards,

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

    Seems OK on the others. We don't really make many customisations to the
    designer, other than the addition of some 'register' statements to make it
    a design time component available on a pallette and the addition of three
    new 'show...' methods: 'ShowQueryWizard', 'ShowReportWizard' and
    'ShowPageSetup'.

    What I can say, from tracing through, is that the 'SetOnCustomSaveDoc'
    method IS being called and it in turn calls:

    FDesignerWindow.EventHub.EndUserEvents.mcCustomSaveDoc.AddNotify(ehLayoutManager_CustomSaveDoc).

    However the ehLayoutManager_CustomSaveDoc method itself is never called.

    Thanks,

    Steve




    --- posted by geoForum on http://delphi.newswhat.com
  • edited November 2008
    Having looked a second time, I'm not sure that this particular event is
    the problem. On RB7 the report is saved to database (table is called
    REPORTS_USERS, field is called REPORT) and that has nothing to do with
    OnCustomSaveDoc, it seems to get saved as soon as the report designer
    becomes visible. Perhaps I'm missing something in the set up in RB11? What
    do I need to have set for the report to save itself or in other words, how
    do I go about getting a report to save to database once the user has made
    some changes or when the window is closed?

    Thanks



    --- posted by geoForum on http://delphi.newswhat.com
  • edited November 2008
    Hi,

    Try setting the Report.SaveAsTemplate property to True. This will ask the
    user if he/she would like to save if the report has been altered.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited November 2008
    Well...now it gives me a ETemplateLoadError and refuses to create my form!

    There must be something changed in the way RB11 loads its end user forms
    to the way RB7 did it, because I have the exact same properties set on our
    EU implementation as we had for RB7, but that works and this doesn't...

    On the report->template we have databasesettings->pipeline (and all other
    values) as blank. Template->Format is stASCII, Template->SaveTo is stFILE.
    I realise those last two seem counterintuitive when we want to save to
    database, but that's how they're set on the old version - the values we
    want are set at run time. I think maybe RB11 and RB7 do something subtle
    in a different order.



    --- posted by geoForum on http://delphi.newswhat.com
  • edited November 2008
    This is infuriating! It's going off and doing its own thing before the
    form that owns my custom report designer gets its FormCreate method
    called! It's also giving me ETemplateLoadError despite the fact that I
    haven't told it to load a template, haven't given it a template name and
    haven't even connected it to a pipeline!

    Help!



    --- posted by geoForum on http://delphi.newswhat.com
  • edited November 2008

    Open the .dfm file and modify the property setting for Report.SaveAsTemplate
    to False. Then save. Now try opening the .pas file.

    I recommend setting Report.SaveAsTemplate at False for design-time, then set
    it to True in code like this...

    myReport.SaveAsTemplte := True;
    myDesigner.ShowModal;




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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.