Thursday, June 19, 2008

Export Data to Microsoft Excel from Axapta Super() Fast

When using SysExcelApplication Class for write or export data to Microsoft Excel from Microsft Dynamics Axapta, it take about 15 minutes to export 4000 records (that sucks dud ~_~").

There is several ways to make it faster, this tutorial will lead you to export 4000 records in just 5 seconds (Woogggghhh cool ^_^").

This how it's work, write the data you want to export to a clipboard then open Excel application using SysExcelApplication (SysExcelApplication class just use for opening excel application ^_^") then paste the clipboard, and this is the code :





Good luck brother ;P

Monday, February 4, 2008

Integerating Fusion Chart with Dynamics Axapta 4 (Part One)

This tutorial will guide you to view beautiful Fusion Chart on Axapta. Before you follow this tutorial you need to install Flash player on our system or you can click here to download Flash.ocx then you register it to your system using regsvr32 command. You need to download Fusion Free Chart here, copy and paste Chart folder from Fusion Free Chart folder to C:\, create new folder name Data on C:\ and make sure you have this folder structure. Oouch I almost forgot, Fusion Free Chart read parameter from xml file to view data on chart that’s why we need folder Data under the Chart folder.



OK now we start to build the application by creating a Group name IntegeratigFusionChart, then create a new Group name Forms and ProjectGroupType Forms. Create new Form name CustInvoicedList then fill caption with “Integerating Fusion Chart on Axapta”.


Create new Group on Form CustInvoiceList fill the name with “GroupParameter” and Caption with “Parameters” then add new control StringEdit fill the name with “CustAccount” and ExtendedDataType with “CustAccount”, add new control DateEdit fill the name with “FromDate”, Label with “From date” and ExtendedDataType with “TransDate”, add new control DateEdit fill the name with “ToDate”, Label with “To date” and ExtendedDataType with “TransDate”.



Continue to the next step, create new Group on Form CustInvoiceList fill the name with “GroupViewer” and Caption with “Fusion chart viewer” then add new control ActiveX fill the name with “FusionChartViewer”.



Done with making the interface, now create new method on form name initChart() then insert below code to initChart() method :



First marked source mean to write empty data to DataCustInvoiced.xml file and the second marked source send some information to chart about the parameter file path and set the width and height of chart.

Next step, create new method on form name amount2str(), this method will convert amount to string format for Fusion Free Chart parameters. Insert below code to amount2str() method :



Create new method on form name writeXML(), this method will generate xml file that contains parameter for Fusion Free Chart, insert below code to writeXML() method :





Create new method on form name redrawChart(), this method will refresh the chart viewer, then insert below code to redrawChart() method :



Continue to next step by init() on form, then insert below code :



Create new ButtonGroup on Group GroupParamter, then add new control Button fill the name with “ButtonRefresh” and Text with “Refresh”.



The last step is override method Clicked() on ButtonRefresh(), then insert below code to Clicked () method :



Wooogggh try to input the parameter and see how it works.

Monday, January 21, 2008

Membuat Lookup pada Dialog yang terhubung

Aplikasi ini sangat simple tetapi sangat berfungsi, dimana suatu lookup pada dialog akan mempengaruhi lookup selanjutnya. So watch this carefully…

Buat sebuah Group dengan nama Classes dan ProjectGroupType = Classes. Pada Group terbsebut buat sebuah class dengan nama LinkedDialogLookup, kemudian tambahkan beberapa variable berikut pada method ClassDeclaration dan tambahkan sintaks extends Runbase.



Kemudian Override Method dialog dengan melakukan klik kanan pada class LinkedDialogLookup.



Kemudian ketikan sintaks berikut



Lanjutkan dengan melakukan Override Method dialogPostRun, kemudian ketikan sintaks berikut



Note : Sintaks yang di lingkari warna hijau bertujuan agar method kita dapat melakukan override pada control dialog (dalam hal ini String Edit dengan nama vendGroup dan vendAcc) dan yang dilingkari biru merupakan control yang dapat kita override.

Kemudian Override method pack pada Class LinkedDialogRun (terdapat pada Override Method – More – Pack, karena kepanjangan jadi gak keliatan ~_~”), ketikan sintaks berikut



Lanjutkan dengan melakuka Override method unpack pada Class LinkedDialogRun (terdapat pada Override Method – More – More – Pack, karena lebih kepanjangan jadi lebih gak keliatan >_<”), kemudian ketikan sintaks berikut



Sekarang buat method baru dengan nama VendAccount_lookup( ), nama method diambil dari Control String Edit yang kita tambah ke dialog dengan format #####_lookup( )



Langkah terakhir adalah membuat sebuah baru method dengan nama main( ), ketikan sintaks berikut



Kemudian jalan execute class LinkedDialogLookup, woooogh pada lookup Vendor Account yang keluar cuman yang Vendor Group 50.