Customise invoice report

On the standard report the VAT Identifier column is used to display the VAT code used from the Sales Invoice Line table. I want to link in the VAT Prod. Posting Group table to use the Description field to get a more user friendly version of the VAT code used.

I have added the table VAT Prod. Posting Group under the Sales Invoice Line table in report designer and linked them using the relevant fields. If I put the textbox in the Sales Invoice Line, Body (4) section of the report, nothing is printed for the VAT column. If I move the textbox into the VAT Prod. Posting Group, Body (1) section I can see the Description field but it sits one line below the rest of the text in the report.

How can I get this field into the Sales Invoice Line, Body (4) section?

Hi T…

is your VAT Prod. Posting Data Item is indented below sales Invoice line.?

what you can do is that you can write a code in On After Get record of Sales Invoice line & use the same filters for VAT Prod. Posting to link with sales Invoice Line & then you can use the field to display in Body of sales invoice line bot for that you have to write like that VAT Prod. Posting.Description



Hi Ashish,

Thanks for your reply.

I have indented the VAT Prod. Posting Data Item to level 4 just under the Sales Invoice Line (which is indented to level 3). It is all linked etc in the Data Item Properties.

So what code do I need to put in the On After Get Record to link to the VAT Prod. Posting data item?

I have set my textbox SourceExpr to VAT Prod. Posting.Description already, so I think it’s just the code that missing.




First of all you can not use Recordvariable.Fieldname to display the things in the section of the dataitem above it.

so in your case you can not use simply the VAT Prod. Posting.Description in section of Sales Invoice Line which is already above in Indentation.

so what u have to do is that create a global record variable of the ex. recvariable pointing to VAT Prod. Posting table & then u have to do coding using the filter & then u have to find the record variable. u have to use this code on after getrecord of sales invoice line


recvariable.setfilter(…u have to use setfilter & setrange based on the link of this table with sales invoice line


if recvariable.findfirst then

now u have to use recvariable.description


I used some code from another post ( to resolve the issue and it now displays to our satisfaction.

Basically I put the following code in the OnAfterGetRecord:

“VAT Product Posting Group”.GET(“Sales Invoice Line”.“VAT Prod. Posting Group”);

and then the SourceExpr is “VAT Product Posting Group”.“Description”

Thanks for your help.