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

Resetting Report for new values.

edited July 2002 in General
Sorry I think I went brain dead.
I have Delphi 5, Reportbuilder 6.x
The report runs fine the first time, but when I change values in the data
set and rerun the report
it still has the previous data. I tried doing report.reset but to no
avail.
I know it is something simple, but I guess I can't see the tree for the
forest.
Thanks for any help.

--
Walt Kersten
Walt@wkersoft.com

Comments

  • edited July 2002
    Hi Walt,

    try 'Report.Engine.Reset'.

    HTH,
    Chris Ueberall;

  • edited July 2002
    Tried this ... same result.
    It seems that if I close the form and then go back I can get report to print
    with new values the first time.. but then
    it retains those values until I close the form.

    --
    Walt Kersten
    Walt@wkersoft.com
  • edited July 2002
    Walt,

    I don't know how you are changing the data, can you refresh your dataset
    components before calling 'Reset'?

    HTH,
    Chris Ueberall;

  • edited July 2002
    Ok ... here is what I am doing.
    I have a form ... I added a report. (no pipeline)
    Listbox.
    Button (called Print)
    Double click on report .... setup query for table, ect and sort .
    I run the program ...
    I select the data in the list box that I want created.
    when I click on print ... the table is emptied of previous data ... and new
    data is inserted.
    The report should then display the data. (it does the first time)
    If I then select (from the list box) other data .... the table is emptied
    and the new data is inserted.
    But the report still shows. the old data.

    Note :
    if I add a dbpipeline to the form and associate to the report then the data
    does change on new selection but the sorting is all wrong.

    I must be missing something ... I,m sure this is extremely simple.

    Buy the way RB is the greatest invention since the wheel.

    --
    Walt Kersten
    Walt@wkersoft.com
  • edited July 2002
    You actually need to go through the dataviews and reset them to force them
    to reretrieve data. Here is a method which will accomplish this for you. You
    still should call Report.Reset, especially if you are caching pages.

    procedure RefreshDataForReport(aReport: TppReport);
    begin

    lModule := daGetDataModule(aReport);

    for liIndex := 0 to lModule.DataViewCount - 1 do
    lModule.DataViews[liIndex].OutOfSync;

    end;

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

  • edited July 2002
    Ok .... now I really feel stupid.
    What type is lModule.
    I have searched for daGetDataModule with no results.
    Do I need to add something to my uses clause.

    --
    Walt Kersten
    Walt@wkersoft.com
    "Alexander Kramnik (Digital Metaphors)" wrote
  • edited July 2002
    Walt,

    uses daDataModule;

    regards,
    Chris Ueberall;

  • edited July 2002
    Sorry, it is of type TdaDataModule in the unit daDataModule.

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

This discussion has been closed.