Partners are embracing the ease of use and drill down capabilities of Easy Reports to move their existing Reporting Services reports to the platform. Here we will show you how you can build your reports on our Platform.
Data Model
First start by creating a data model (dataset). Start a new report and choose the Table option. Add your tables and fields to the report. Link the tables (by selecting related fields in the same column). Go to Table Options and give your report a Logic Function Id. This can be any integer value. We recommend you use your current SSRS report number. This is the unique identifier you will use later in your code to route execution to the correct implementation code unit. So far the report is no different than any other report. If you need help creating a data model, click here.
OnAfterGetRecord Event
Subscribe to the OnAfterGetRecordEvent and build your report logic. The OnAfterGetRecord event passes a dataset and allows you to do calculations and return an updated dataset. The event fires each time a new row is retrieved for the inner most table. Currently up to three tables can be nested and a reference to all three tables is passed. The event is often used to populate a column but you can also change the value of existing columns or tell the system to skip printing the row entirely.
Logic Action and Routing
The main mechanism to execute your logic is by mapping a route to a logic action. The logic action can be any name you want as long as you map it to a function in your router. Logic Actions show to the user as (virtual) fields when creating a report. These virtual fields can incorporate any logic and return a value. In the OnAfterGetRecord event your "Action" function populates the column with a value.
A second mechanism is available at the report level that extends the Logic Action functionality. Say that you are writing a report that is best suited to have its own logic contained in a separate codeunit. In this scenario you can assign the report a "Logic Function Id" and use that in your router to redirect your code to the dedicated codeunit. These two concepts can be combined to build powerful reports in a fraction of the time required to build regular reports.
Replacement Values
Replacement Text Field Values is a dictionary variable of type integer and text. The integer represents the column number and the corresponding text is the value to use on the report. Use this variable to change any column value. It is also how you return the result of logic action fields. A typical use case is the sales line table "No." field. The number field can be an item, resource or g/l account, but what if you wanted to print the item description. Alternately, what if you want a separate column for Item Description and Resource Name. You can add a virtual field "Item Description" and attach it to the sales line table. In the designer the user will place the field where he / she wants, the "logic action" associated with the field will route the event to your function which will use the Replacement Text Field Value variable to return the value to print.
Contact us and we will send you our template visual studio code project to get you started faster. We will also work closely with you developer and guide them as they learn to use our tools.
Comments