Sunday 17 August 2014

How to Use Chart Components in NAV 2013


Navision had given a facility to use Chart object. Where a user can drill down and navigate till the document level. We can take one example where user can see the overall profit in a 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
clip_image002
2. Select the Field Business Chart
clip_image004
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
clip_image006
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
clip_image008
    c.  DrillDownExpense – Use this function for Drilling down to The Analysis View Entry Expense
clip_image010
5. All the above functions need to be called from Profit Chart Page.
6. Create a separate Function Called UpdateChart on Page. This function needs to call on OnfindRecord Event on Page.
clip_image012
7. We need to write a code on Datapointclicked event of the page for drill down to the transaction level
clip_image014
8. Now you can attach this page to role centre. 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".)
clip_image016

Written by:Mr. Abhijit Kadulkar - More than 16 years of experience in Information Technology across multiple technology solutions.Presently working as Delivery Manager- Microsoft Dynamics NAV at Direction Software Solutions, Mumbai, India