Reporting/Printing on a Temp Table

Hi Folks…

Having a BAD Day!!

I have added some data to a temp table to enable me to summary the overall data. however I’m going wrong somewhere.

When the report is run the data is correct within the temp table.

However in the preview it shows all the data at line data level…

CurrReport.CREATETOTALS(Percent, GrossAmt);

TempDataType.DELETEALL;

Trans. Payment Entry - OnAfterGetRecord()
CLEAR(GrossAmt);

CurrReport.CREATETOTALS(Percent, GrossAmt);

CLEAR(Transaction);
Transaction.SETRANGE(“Store No.”,“Trans. Payment Entry”.“Store No.”);
Transaction.SETRANGE(“POS Terminal No.”,“Trans. Payment Entry”.“POS Terminal No.”);
Transaction.SETRANGE(“Transaction No.”,“Trans. Payment Entry”.“Transaction No.”);
Transaction.SETRANGE(Date,“Trans. Payment Entry”.Date);
Transaction.SETRANGE(Time,“Trans. Payment Entry”.Time);
IF Transaction.FIND(’-’) THEN
GrossAmt := Transaction.“Gross Amount”;

IF TempDataType.GET(“Trans. Payment Entry”.“Staff ID”,“Trans. Payment Entry”.“Store No.”,“Trans. Payment Entry”.Date) THEN
BEGIN
TempDataType.“Decimal 1” := TempDataType.“Decimal 1” + “Trans. Payment Entry”.“Amount Tendered”;
TempDataType.“Decimal 2” := TempDataType.“Decimal 2” + GrossAmt;
TempDataType.MODIFY;
END ELSE
IF NOT TempDataType.GET(“Trans. Payment Entry”.“Staff ID”,“Trans. Payment Entry”.“Store No.”,“Trans. Payment Entry”.Date) THEN
BEGIN
TempDataType.“Code 1” := “Trans. Payment Entry”.“Staff ID”;
TempDataType.“Code 2” := “Trans. Payment Entry”.“Store No.”;
TempDataType.“Date 1” := “Trans. Payment Entry”.Date;
TempDataType.“Decimal 1” := “Trans. Payment Entry”.“Amount Tendered”;
TempDataType.“Decimal 2” := GrossAmt;
TempDataType.INSERT;
END;

Percent := ABS(((TempDataType.“Decimal 1”) / (TempDataType.“Decimal 2”)) * 100);

OUTPUTING…

Store - Staff - Date - Amount -Gross -%

S079-01326-01/11/11-60-60-100% ---- Correct Line

S079-01732-01/11/11-50-450-11% -----Correct Line

S079-03104-01/11/11-30-89-34% – Not Wanted

S079-03104-01/11/11-60-178-34% – Not Wanted

S079-03104-01/11/11-80-267-30% ---- Correct Line

What’s the layout of your report? What data item / section are you creating the data? What data item are you using to output the data to the report?

Generally I do one or more data items with no sections to load the data. Then an Integer data item filtered for the number of records in the temp table with output sections.

Hi Matt.

Only using Trans. Payment Entry as a data item

But in the section reporting body using my TempDateType.fields…

are saying to add an integer dataitem after my Trans. Payment Entry (indented?)

No, not indented. Completely new Integer data item.

Cheers Matt…

Worked perfectly[Y]