Help adding VAT field to already modified report

i am trying to add a plus vat (value added tax) field to the bottom of my template (marked in red) but having alot of script issues generally crashing ayanova, my latest try is attatched, with the field i want to sort in red, is there any way i can get the template itself to add the 17.5% so as to avoid adding tax back in as it seems to confuse my book-keeper and i want to only use vat on this quote

regards

richard

Hi Richard

The field in red is called xrNetTravel in the report template you sent. And it still has the script in it from what that field originally was for - which was for displaying the net travel.

If what you want to do is manually apply a % against another field, you would need to edit its OnBeforePrint script to do this.

I have attached an edited copy of your report template to this reply so that you can see what I did below:

Note that I edited the Name of the field label to xrTotalIncVat and the name of the field to the left of it to xrTotalexcVat only so that their names match more of what they do
Expand the Scripts property for this label
Open the OnBeforePrint script so that you can see the script
private void OnBeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
{
//this converts the GrandTotal that is displaying in the xrTotalexcVat label to a double type so
//that it can be multiplied by the VAT plus itself (1.175) and than displayed
//in the xrTotalincVat label
xrTotalIncVat.Text = string.Format("{0:c2}", (Convert.ToDouble(GrandTotal) * 1.175));
}

Print Preview - you will see that the field now has the GrandTotal accumulated amount multipled by 1.175

  • Joyce