Passing value to textbox in report

Hi all, I want to pass value to textbox in report by fetching from the table. Docdate, Customername and Subjobno are textboxes in the report. Here comes the code, Deliverynoteheader.GET("Document No."); IF Deliverynotelines."Document No."=Deliverynoteheader."No." THEN BEGIN Docdate:=Deliverynoteheader."Document date"; Customername:=Deliverynoteheader.Customername; Subjobno:=Deliverynoteheader."Sub Job No"; END; Thanks in advance. Best regards Hari

  1. What’s the question? 2) If you use .GET(“Document No.”) and you’re basing the report on the dataitem Deliverynotelines then Deliverynotelines.“Document no.” will always be equal to Deliverynoteheader.“No.”, so the IF makes no sense there. 3) If the deliveryheader does not exists you’ll get an error on the GET. 4) You should have something like: ELSE BEGIN Docdate := 0D; Customername := ‘’; Subjobno := ‘’; END;

Hi Alfonso, Iam maintaining two tables “Delivery note header” and “Delivery note lines” and grouping is done based on the field “Document no” of “Delivery note lines” table. I have drawn a textbox in the report and named it as Docdate. I should get the value on the report(Docdate) for the corresponding “No.” field of “Delivery note header” table. I agree with your points. Best regards Hari

Hari, What is your question? If the code you have placed below is on the onAfterGetRecord trigger of a dataItem for “Deliverynotelines” then the code should work. Is the code not working? Thanks Tony

Tony, Iam not getting it. Let me explain the report iam looking for. Grouping based on “Document no”(Delivery note lines table), “Doc date”(Delivery note header table) and “Customer name”(Delivery note header table). “Document No.” and “No.” are the Primary key fields of tables Delivery note lines and Delivery note header respectively. How to achieve this? Best regards Hari