Skip to main content

Working with Graph in AX12012

Hi friends,
              Generally graph acts as easy to understand like a diagram and 3D design also to displays information basis on the variants. Microsoft AX also supports this functionality. For that we have to follow below process.
  • Create table and add fields as below,
                  Table name : AkkMatchScore
                  Fields          : 
                                        Name                          Type
                                      OverRuns                    String15
                                      Overs                           String15
                                      RunsQty                      RealBase
  • Create Form and add new control ManagedHost in design  one dialog will open , you have select Client control for chart tool box. See below image for more.
                     

                         NOTE : Change ManagedHost control property

                                      Name             : "ChartToollBox"
                                      RTLCapable : No

                                      Width             : Column width
  • Add another new one ManagedHost Control and add chart control (see below image) and click OK.

                            
                               NOTE : Change ManagedHost control property

                                      Name             : "GraphControl"
                                      RTLCapable : No

                                      Width             : Column width

  • Add new method updateGraph()  method into form and write this logic,

  •         void updateGraph()
           {
                   #MACROLIB.ChartFx
                   AkkMatchScore              AkkMatchScore;       //Table buffer
                   graphics    = new Graphics();
                   graphics.ManagedHostToControl(GraphControl);

                   graphics.parmCreateType(#CT_LEGEND | #CT_3D);

                   graphics.create();

                  graphics.parmTitle("@SYS95906");
                  graphics.parmTitleXAxis("Overs");
                  graphics.parmTitleYAxis("Runs");

                 while select  AkkMatchScore
                        order by Overs
                {
                          graphics.loadData(AkkMatchScore.Overs, 
                                        AkkMatchScore.OverRuns,
                                        AkkMatchScore.RunsQty);
                }

           graphics.showGraph();
          }


    • Override init() method into form and write this logic,


              public void init()
             {
                    super();

                   chartToolBox    = ChartToollBox.control();
                   chartToolBox.set_ChartControl(GraphControl.control());

                    this.updateGraph();
             }


       Finally, output will look like as,




    Comments

    Popular posts from this blog

    export excel file through batch job in ax 2012

    Friends,                      Microsoft Dynamics AX 2012 have a strong batch job functionality that run on periodic time as per user requirement. I have created one batch job that will export invent table data from AX 2012 to excel file. Go through given steps and get this functionality. Step 1 :  Create Contract Class  AkkInventTableDataContractBatch [DataContractAttribute] class AkkInventTableDataContractBatch {     ItemType          itemType; } Step 2 :  Add  parmItemType()  method to  AkkInventTableDataContractBatch  class and write this               logic, [DataMemberAttribute] public ItemType parmItemType(ItemType  _itemType = itemType) {     itemType  = _itemType;     return itemType; } Step 3 :  Create ServiceClass  AkkInventTableBatchService class AkkInventTableBatchService extends SysOperationServiceBase { } Step 4 : Add exportExcel() method to AkkInventTableBatchService  class and write this                     logic, [SysEntryPointAttribute(

    Drag and drop functionality in AX 2012

    Friends,            Now a day every person wants drag-drop functionality i.e., No more steps, easy and fast. Yes, I have tried this functionality on ListView Control . Try this steps Step: 1          Create one form and add two new List view control in Design named ListView, ListView1. Step: 2           Open ListView Property change,                      SingleSelection : No                       ViewType : Report                       DragDrop : Manual                  NOTE : Change property in two ListView control. Step: 3            Override method init() method in form and write this code,             public void init()        {                 FormListControl listControl;                 FormListColumn  column;                 CustTable       custTable;                              super();                ListView.addColumn(1, new FormListColumn("Customer Account"));                ListView1.addColumn(1, new FormListColumn("Custom