Hi,
There is more than one way to handle (manipulate) the Contract percentage value in the scripts.
Will tell you the easy way –
In the Contract Subreport (your custom report) –
- Add the standard (Bound) fields (payment type, billing percentage, etc) into the group section where do you want to display the calculated values.
- Hide the standard (bound) values by setting Visible property to false. Also include Unbound textbox to display your calculated values.
- In the script side Read the standard values (payment type, billing percentage, etc) in the respective group’s format event procedure.
- Do your custom calculation based on readed values and reassign the calculated values into the unbound textbox respectively.
How to do the above stuff?
For example sake let us consider we are reading the contract billing Amount and incremented that value by 100 and reassign that incremented value to the unbound textbox.
- In the contract subreport include the BillingAmount (Bopund textbox) in to the group let us called as “grpContract” and billingamount textbox named it as “txtBillingAmount”.
- Add one more unbound textbox (DataField property set to empty) and named it as “txtBillingAmount2” to show calculated value.
- Hide the standard billing amount by setting the Visible property of “txtBillingAmount” to False.
- In the script side include “grpContract_Format” event procedure.
- In the format event procedure read the billing amount value by using ReturnTextBoxValue method of ReportUtilities.
o ReportUtilities.ReturnTextBoxValue(rpt, “grpContract”, “txtBillingAmount”)
- Increment the grabbed (readed) billing amount value by 100.
- Reassign the incremented value to the into the “txtBillingAmount2” by using SetTextBoxValue method of ReportUtilities.
Final Code will look like this –
Sub grpContract_Format
Dim billingamount As Double
billingamount = Double.Parse(ReportUtilities.ReturnTextBoxValue(rpt,"grp Contract","txtBillingAmount"))
billingamount = billingamount + 100
ReportUtilities.SetTextBoxValue(rpt, "grpContract","txtBillingAmount2", billingamount)
End Sub
This post is just to give you an idea and its not the solution to your problem
Hope it helps.