reports using Array...

SilvaSilva Member Posts: 281
Hi,

Im making a reports,that will get the data from Sales (Purchase Invoice header and Lines) the. and I use the Array to Show the header of the reports..consist only the Item that in the Purch. Inv. Line....and Base on that item in Header...I will display all the quantity that Sales inv Line.

ex. Header: Item001 Item002 Item03 Item04
Body:
Sales Inv. No.1 Qty. Item001 Qty. Item002 Qty Qty.1
Sales Inv. No.2 Qty = 1 0 0 Qty. = 2


I use the Array to Show the Header=Item No., and the Body= Qty of the item in the header.but the Quantity of item base on item On HEADER is not display corectly Any Idea..?

This Is my Code:


Header Text 100
ColumnQuantity Decimal
i Decimal
tempItemNo Code 100
recItem Record Item
TempItemLine Record Item
DataBody Decimal
recSalesInvoiceLine Record Sales Invoice Line
MaxCount Integer
CompanyInfo Record Company Information

DATA ITEM
Sales Invoice Header,Sales Invoice Line,Integer

Sales Invoice header - Onafterget Records()


IF "Sales Invoice Line".FIND('-') THEN
REPEAT
IF NOT TempItemLine.GET("Sales Invoice Line"."No.") THEN
BEGIN
TempItemLine.INIT;
TempItemLine."No." := "Sales Invoice Line"."No.";
TempItemLine."Unit Price" := "Sales Invoice Line".Quantity;
TempItemLine.Description := "Sales Invoice Line".Description;
TempItemLine.INSERT;
// MESSAGE('%1',TempItemLine."No.");
END;
UNTIL "Sales Invoice Line".NEXT =0;

i := 1;
IF TempItemLine.FIND('-') THEN
REPEAT
Header := FORMAT(TempItemLine.Description);
//Header := TempItemLine."No.";
i := i + 1;
UNTIL TempItemLine.NEXT =0;

Sales Invoice Line - onafterGetrecords()

//CLEAR(DataBody);

MaxCount := TempItemLine.COUNT;

FOR i := 1 TO MaxCount DO BEGIN
IF "Sales Invoice Line".Description = Header THEN
DataBody := "Sales Invoice Line".Quantity;
END;

i := 1;
IF "Sales Invoice Line".Description = Header THEN BEGIN
REPEAT
DataBody := "Sales Invoice Line".Quantity;
i := i + 1;
UNTIL "Sales Invoice Line".NEXT = 0;
END ELSE
DataBody := 0;

Integer -Onpredataitem()

Integer.SETRANGE(Integer.Number,"Sales Invoice Line".COUNT);

That is My code...I hope any can help me...about this...thanks a lot.

Comments

  • BeliasBelias Member Posts: 2,998
    FOR i := 1 TO MaxCount DO BEGIN
    IF "Sales Invoice Line".Description = Header THEN
    DataBody := "Sales Invoice Line".Quantity;
    END;

    You are not specifying what element of Header array are you using...

    You have to use header i think (i didn't read a lot what do you want to do :oops: )
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • SilvaSilva Member Posts: 281
    I use the Databody to show the Quantity base in the header which is Header..and when I test the reports the quantity is misarrange.. ](*,)
Sign In or Register to comment.