SyteLine – Visualize data with Graphs

Recently, I was asked to create a chart to visualize report data to the user directly in SyteLine, skipping the cumborsome report fetching tools like Crystal Report or Report Builder. The featured picture of this post shows example charts. I was anyway engaged to have an insight into this feature as I want to ease the work of the users and show the data directly to them.
It is quite straightforward to use once you had a look at the examples in the several home forms, e.g. [Controller Home] or [Customer Service Home]. Nevertheless, it required some prerequisites to finally create my own chart.

The basic ingredients are:

  • Custom Load Method (CLM) on an IDO
  • An IDO to bind the CLM to
  • The CLM itself

As you can see, you have to add a CLM. As CLMs are always more difficult to keep track of when you customize, I decided to comprise them into a single new IDO for graphs. This is also enables maximum reusability all over the forms, as you simply have to add the new IDO.
In the following I will list the customizations I have applied.


  1. Create a plain IDO table.
  2. Create the IDO from the plain table. No need yet to check the IDO in.
    NewIDOForGraphs
  3. Create your Stored Procedure with the graph data as returns values. As a hint, I would just copy a plain one from SyteLine itself like Home_MetricCashImpactSp . As an example, I will provide the rough outline of my SP:
  4. Now you can return to the newly created IDO and add the properties you will need. As the IDO will be used in a highly generic way, you should have have no too specific property names. As an example I have added the following four properties – in addition to the default SL properties – all in read-only mode:IDOPropertiesGraphs
  5. After adding you can add the CLM and define the return assignments.
    New IDO Method Graphs
  6. Check the IDO in and clear the IDO cache.
  7. Now go to the form you want to add the graph onto. In my case it’s the [Controller Home]. I have added my newly IDO. In addition, I have set the standart operations Graphs to True . I have to admit, that the help does not tell me enough about it, but I just think it might be useful when being set.GraphsIDOOntoForm
  8. One trick, before you desperatly think that you failed somewhere else: We used a CLM. Thus, you have either to refresh the collection yourself to call the CLM, use a form event handler or use the initial command of the form to refresh. I first was confused that I had no data returned from the CLM…
  9. Now one more trick: You may will see no data in the end, if you have not bound the properties to fields. So, I recommend to add a grid with columns of all the values you want to visualize. Only properties which are bound to fields will be shown!
  10. Here is an example depict of the Graph setup:Graphs In Forms

Tags

Categories

Meta

Peter Merkert Written by:

Be First to Comment

Leave a Reply