report - to show field that is not in temporary temp

Hello,

I do have “Item No.” field in a temp table. But, I’d need to also show Item.Description on the report in the Integer area.

There is no any available field with a needed length in the temp table I could use for it.

I was trying:
IF Item.GET(tblTemp.“Item No.”) THEN
Item_Description:=Item.Description

It’s working good I could get a correct value in the code but how to show it on the report? I did also try to use Item_Description[i] as an array lopping through it in the AfterGetRecord()but no success for now.

I’m sure there should be a way. Please, advise.

Thanks

Where did you write above code and in which section did you add Item_Description text box?

I do have several nested temp tables that seems as working well as Integers in DataItem and on the Report.

On a one of the integer in the DataItem I was trying to use this GET , in OnPreDataItem when I was doing REPEAT … UNTIL for the Temp table and I also tried the GET in AfterGetRecord for the same Integer when I’m doing

OnAfterGetRecord()

IF Number = 1 THEN
  tmpTable.FIND('-')
ELSE 

tmpTable.NEXT;.

On the report I’d need to show it in the Integer section where I show other relevant data such as “Item No,” there, So, I’d need to show the Item.Description there too.

Thanks

Did you try by writing Item_Description caluclation in OnAfterGetrercord trigger after above code…

Thanks, I’ll try it tomorrow at work. I just thought it should be in a loop somehow otherwise it could show the last value only but I’ll try it.

No need to loop in OnAfterGet Record trigger again as you are using above code to get next record each time…

you simply get the item record and use its description in sections…

Ok, I tried the code below but it shows the last value only for all Items when I put Item_Description on the TempIntTSE section of the report. So, I have a list of different Items there but the Description is the same for all Items that is actually the last value of the variable Item_Description.

Could you please take a look what could be wrong?

TempIntTSE - OnAfterGetRecord()

IF Number = 1 THEN

TempTSE.FIND(’-’)

ELSE

TempTSE.NEXT;

IF Item.GET(TSE.“Item No.”) THEN

Item_Description:=Item.Description

ELSE

Item_Description:=’’;

Just sent a question and found an answer right after that.

I did change IF Item.GET(TSE.“Item No.”) THEN to IF Item.GET(TempTSE.“Item No.”) THEN

and it’s working now.

Thank you so much

Welcome [:)]