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

Report Reset/Regenerate

edited June 2003 in General
Hi

I have created a report called Customer Statement which prints the customers
transactions from a given input date in the autosearch field. This only
prints these transactions but does not show any figures for the customer
prior to this date and it only shows those customers who have had
transactions in this period and not all the customers with outstanding
balances. I needed to show an opening balance in the group header and print
the report for customers with outstanding balances.

I have suceeded in doing this with the code shown below and when I click the
preview button the preview shows the correct information, but if I click the
preview print or close the preview screen and click print, it reverts back
to a point that shows all transactions instead of those after the input
date.

I need to know how to retain the coding I have created or completely
regererate the report when I click the print buttons.

I have seen a procedure called 'RegereateReport' but I don't know how or
where to use it. Could you help me with this problem.

//----------------------------------------------------------
PassDate and Operator are global variables.

//-----------------------------------------------------------
procedure ReportOnGetAutoSearchValues;
begin

PassDate := Report.AutoSearchFields[0].Value;
Operator := Report.AutoSearchFields[0].SearchOperator;
Report.AutoSearchFields[0].SearchExpression := '';


end;
//-----------------------------------------------------------
procedure DetailBeforePrint;
begin

If Operator = 4 then {GreaterThan search operator}
If (SQL['IssueDate'] > Passdate) then
Detail.Visible := True
Else
Detail.Visible := False;

If Operator = 5 then {GreaterThanOrEqualTo search operator}
If (SQL['IssueDate'] >= Passdate) then
Detail.Visible := True
Else
Detail.Visible := False;

If not Detail.Visible then
begin
TotalDebit := TotalDebit + SQL['AmtDebit'];
Variable3.Value := TotalDebit;
TotalCredit := TotalCredit + SQL['AmtCredit'];
Variable2.Value := TotalCredit;
end;

end;

Thank You.

Comments

  • edited June 2003
    Allan,

    Every time you generate the report, it will refresh itself. Be sure that
    your data is not being changed at any time during generation. If this does
    not help, please send an example to support@digital-metaphors.com and we'll
    find a solution for you.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.