how do i accomplish this ?

hi, i got a problem i had a report dealing with sales header and sales invoice line. i did the relationship data model but the user wants the first record of the sales line displaying only the “description” field after the sales header details are shown. how do i accomplish this?

U can have a global variable named counter in function OnAfterGetRecord of dataItem Sales Line. Assign field No. of table Sales Line to global variable Id. If Counter = 1 Then Id := ‘’ Else Id := “No.”; Counter := Counter + 1; Have fun…[;)]

can u kindly explain what counter variable is trying to do?

Create a text box variable named Id. Put that on Body of Sales Line. The counter variable will tell the system that on the first occurence, Id is blank and subsequent lines will assign “No.” to Id. Hope that my explaination is clear to you now. [:)]

but i want description to be placed on the form not id → the user wants the first record of the sales line displaying only the “description” field after each record of sales header is shown. how do i accomplish this?

i dont see anywhere where u set Counter value to be 0…i meant intialise the value. where can i do it?

Please send me an email and I’ll give you a sample on this.

whats your email?

As i understand ur problem…you want the sales header alongwith the description of the first sales line for that header. Create the report with dataitem Sales Header & Sales Line. Also set the relationship between the 2 dataitems. then dor the Sales Line - set the MaxIteration propery as 1 & the report will work fine.

Hi Han, Sorry for the delay as I was caught up by my assignment. Here’s the code and I hope it can help you. [;)] OBJECT Report 70001 Report Test { OBJECT-PROPERTIES { Date=10/28/02; Time=[ 9:18:13 PM]; Modified=Yes; Version List=; } PROPERTIES { } DATAITEMS { { PROPERTIES { DataItemTable=Table36; } SECTIONS { { PROPERTIES { SectionType=Header; SectionWidth=12000; SectionHeight=846; } CONTROLS { { 1000000001;Label ;600 ;0 ;1500 ;846 ;ParentControl=1000000000; VertAlign=Bottom; FontSize=8; FontBold=Yes; FontUnderline=Yes; MultiLine=Yes } { 1000000003;Label ;2700 ;0 ;2400 ;846 ;ParentControl=1000000002; VertAlign=Bottom; FontSize=8; FontBold=Yes; FontUnderline=Yes; MultiLine=Yes } } } { PROPERTIES { SectionType=Body; SectionWidth=12000; SectionHeight=846; } CONTROLS { { 1000000000;TextBox;600 ;0 ;1500 ;423 ;SourceExpr=“No.” } { 1000000002;TextBox;2700 ;0 ;1500 ;423 ;SourceExpr=“Bill-to Customer No.” } } } } } { PROPERTIES { DataItemIndent=1; DataItemTable=Table37; DataItemTableView=SORTING(Document Type,Document No.,Line No.); OnPreDataItem=BEGIN nSalesLine := 0; END; OnAfterGetRecord=BEGIN IF nSalesLine < 1 THEN SalesLineNo := ‘’ ELSE SalesLineNo := FORMAT(“No.”); nSalesLine += 1; END; DataItemLink=Document Type=FIELD(Document Type), Document No.=FIELD(No.); } SECTIONS { { PROPERTIES { SectionType=Header; SectionWidth=12000; SectionHeight=846; } CONTROLS { { 1000000005;Label ;1200 ;0 ;1500 ;846 ;VertAlign=Bottom; FontSize=8; FontBold=Yes; FontUnderline=Yes; MultiLine=Yes; CaptionML=ENU=No. } { 1000000007;Label ;3450 ;0 ;4500 ;846 ;ParentControl=1000000006; VertAlign=Bottom; FontSize=8; FontBold=Yes; FontUnderline=Yes; MultiLine=Yes } } } { PROPERTIES { SectionType=Body; SectionWidth=12000; SectionHeight=423; } CONTROLS { { 1000000006;TextBox;3450 ;0 ;4500 ;423 ;SourceExpr=Description } { 1000000008;TextBox;1200 ;0 ;1500 ;423 ;SourceExpr=SalesLineNo } } } } } } REQUESTFORM { PROPERTIES { Width=9020; Height=3410; } CONTROLS { } } CODE { VAR nSalesLine@1000000000 : Integer; SalesLineNo@1000000001 : Text[20]; BEGIN END. } }

hi, Ask user to enter only description in first line of sales Line sub form. U dont have to modify anything. Regards Bobby