Bar Chart represent an exciting, new way for users to see statistical information in a graphical way in Navision. By being able to examine the relationships of statistics in a visual way, users can more quickly and easily grasp the meaning of and implications of the data on display. From a development point of view, the bar charts are a new way of using visual tools in forms by connecting then with data.
The bar charts in Navision are based on three generic bar chart subforms:
Form 630 Bar Chart 12x1 Subform (Show 12 columns of 1 value)
Form 631 Bar Chart 6x2 Subform (Show 6 columns of 2 compared values)
Form 632 Bar Chart 4x3 Subform (Show 4 columns of 3 compared values)
I would like to develop a bar chart to display salesperson performance in Quarter. Therefore, I decide to use Bar Chart 4x3 subform . 4 columns for showing months in Quarter.3 values for showing Sales Amount, Cost Amount and Gross Profit Amount. I use the code from the existing bar chart windows as a basis then I create a design for the functions I need in the main form and pass data to the subform using these functions. I refer to Opportunities Bar Chart design to look at codes more details.
Today, I try to create simple testing to call store procedure from navision using ADO. In fact, we can do a lot of thing by using ADO and store procedure in SQL. This testing only for sample ( I use Cronus Company for testing). This testing will show salesperson name after we send salesperson code parameter to the store procedure.
1. Create Store Procedure in SQL
CREATE PROCEDURE SP_Test @SName as Varchar(20) OUTPUT AS SELECT [CRONUS International Ltd_$Salesperson_Purchaser].Name as Nama from [CRONUS International Ltd_$Salesperson_Purchaser] where [CRONUS International Ltd_$Salesperson_Purchaser].Code = @SName
GO
2. Call Store Procedure from Navision
Variables: ADOConnection : 'Microsoft ActiveX Data Objects 2.8 Library'.Connection ADOCommand : 'Microsoft ActiveX Data Objects 2.8 Library'.Command ADOParameter : 'Microsoft ActiveX Data Objects 2.8 Library'.Parameter ADORecSet : 'Microsoft ActiveX Data Objects 2.8 Library'.Recordset VarActiveConnection : Variant
IF ISCLEAR(ADOConnection) THEN CREATE(ADOConnection);
We have known that treeview layout can be found in Chart of Account overview form. I try to learn the logic and how it works to create treeview layout. Therefore, I create a table and a form to test it.
The important thing that in table must has : No, Name, Type(Heading, Begin-Total, Posting, End-Total, Total), Indentation, and Totaling field.
For Creating treeview form from the table, we just follow the logic from Chart of Account Overview form. I think it's quite simple to do that. First, we create 7 functions :
InitTempTable (send parameter(Yes/No) to CopyCountryToTemp function)
ExpandAll (to expand all)
CopyCountryToTemp (Insert table data to temporary table)
GetEndTotal (get Totaling data from "End-Total" to "Begin-Tota"
HasChildren (Check whether has children or not)
IsExpanded (Check whether has already expanded or not)
ToggleExpandCollapse (toggle for expand and collapse)
Second, add codes in OnFindRecord, OnNextRecord, and OnAfterGetRecordevent
I try to create chart in Excel from Navision without using ChartWizard object because I want to control chart object in Excel from Navision (Size of chart, series collection,etc). Here the sample codes :
If we want to change Caption on field, normally we change Codeunit 1 to do that. But there is a trick how to change caption on field without modify codeunit 1.
On CaptionClass property put : 1,5,, + txtYourCaption (or you can put a function to set the caption)
Pada satu hari, si majikan bilang ama babi, “ Malam ini kita akan adain pesta, pergi siapkan biscuit untuk acara malam ini” Si babi dengan serius bikin biscuit, dengan sepenuh hati. Namun ga lama kemudian, si majikan masuk ke dapur dan bertanya ama si Babi, “ Kenapa apinya kecil begitu?? Kecil begitu kapan matangnya??” Si Babi bilang ke majikan, “ Kalo apinya terlalu besar, nanti biskuitnya gosong”. Si majikan bilang ke babi, “ Kamu ini otak babi, kamu ngerti apa? Lakukan saja apa yang aku perintahkan!”
Akhirnya biskuitnya gosong seperti perkiraan si Babi... Lalu si babi bertanya ke majikan, “apa yg harus kita lakukan sekarang?”
Kata majikan, “Kalo gitu, kita ganti menu jadi steak babi saja”
Moral of the story: “Bos selamanya tidak pernah salah, kalo ada salah pun Anda yang menanggung”
Adalah seekor babi yang serba bisa di sebuah peternakan
Setiap pagi babi itu mengikuti ayam jantan berkokok untuk membangunkan majikannya.
Dia belajar kaya kucing untuk menangkap tikus yang suka merusak.
Binatang2 yang laen bertanya ama si Babi, kenapa dia begitu "kaypo", ikut campur dalam banyak hal.
Tetapi satu hari, si Majikan datang dan babi tersebut ditangkapnya dan mau dipersiapkan untuk disembelih. Tetapi babi itu rasa2nya tidak percaya. Dan babi itupun akhirnya bertanya kepada majikannya, " Aku begitu banyak kemampuan, dan sudah banyak membantumu dalam banyak hal, kenapa Engkau mau menyembelihku?" Majikan tersebut cuma menjawab, " Ga ada alasan khusus, aku cuma pengen makan steak babi"
Moral of the Story:Majikan hanya melihat dari apa yang seharusnya anda lakukan, bukan dari apa yang bisa Anda lakukan.(Kalo bos lagi mau “sembelih” orang, kapan aja bisa dan siapa aja bisa jadi “korban”. Jadi cukup lakukan apa saja yang seharusnya Anda lakukan, karena semua itu bisa jadi ga dihargai bos)
Sunday, November 1, 2009
In June 2009, I created an application for Logistic company. There were some features of this application, such as maintain customer data, create Subsidiary Certification(SubCert), and send the certification to customer by email.
Last Year, 27 June 2008, I tried to create sample connection between Navision and Microsoft Access. This was a basic sample using ADO. You can watch my video for more detail :-)
Sometimes I find it difficult to know bitmap value in Navision. I have to try one by one to find bitmap image I need by setting bitmap value properties. Therefore, I try to create list of Navision's bitmap in a form. There is a difference bitmap value between Navision version 4 and Navision 5. Maximum bitmap value in Navision 4 is 44 and 53 in Navision 5. For my next post, I will try to create it for Navision 2009.