Wednesday, 9 July 2014

How to Use Chart Components in NAV 2013

Navision had given a facility to use Chart object. Where user can drilled down and navigate till the document level.We can take one example where user can see the overall profit in the graphical format.

For getting profit we need to create 2 Analysis Views which are updatable.
  •           Revenue
  •           Expenses
Note : User must select the proper set of accounts for Revenue and Expenses

Following are the steps to create a Chart

1. Create a Page(Profit Chart) which includes Business Chart Buffer as a source table



















2. Select the Field Business Chart


3.  Create a separate code unit for Updating and Calling the Chart

4. Following Functions Needs to be created in Code Unit
    a.  UpdateDataPL – Updating the data for Actual Revenue/Expense Profit


In the above example Initialize, SetAxis, AddColumn, SetValueByIndex are the functions of Business Chart Buffer Table. A separate Table(In This Case Job Profitablity Setup Table) and Field is used to calculate The Total Revenue and Total Expense as a flow field which is pointed to Revenue & Expense Analysis View entries.

    b.  DrillDownRevenue – Use this function for Drilling down to The Analysis View Entry Revenue



    c.  DrillDownExpense – Use this function for Drilling down to The Analysis View Entry Expense



5. All the above functions needs to call from Profit Chart Page.
6. Create a separate Function Called UpdateChart on Page. This function needs to call on OnfindRecord Event on Page.



7. We need to write a code on Datapointclicked event of the page for drilled down to the transaction level

8. Now you can attach this page to role center. Before calling the page please make sure there is a record for user id must be available in the setup table. If the user is not available then please create a user. ( In the above scenario Job Profitability Setup table which has been used which is a customized table. Useid,Revenue(FlowField),Expenses(Flowfield) are the three required fields has been taken from that table. Revenue field consist sum amount from the Analysis Entry Table for the Analysis View "Revenue". Expense field consist sum amount from the Analysis Entry Table for the Analysis View "Expenses".)





No comments:

Post a Comment