Alpha Anywhere boasts powerful, built-in tools for building reports in business database applications. Alpha's report writer let's you produce business reports with data charts and analytics. Database reports are generated dynamically, pulling data from corporate databases on demand. Below, independent Alpha Anywhere developer Doron Farber details one of his techniques for building reusable reports. Often, developers will develop a new report for each app. However, with Farber's technique, you can design a business report once and re-use it for multiple apps.I am going to show you a technique that can save you precious development time and effort when creating reports in Alpha Anywhere. Instead of creating a unique report for every new app, I am going to show you how to create a versatile report that can be used across a variety of scenarios.
The report will be built with minimal code in Alpha Anywhere, while the majority of controlling will be done via MS SQL Stored Procedures or any other database of your choosing. It creates data on the fly based on the values selected in the parameters’ form.
Creating Reports Overview Video
The idea is to create groups that cover all scenarios and assign fields to these groups based on different conditions. If no field is assigned to a group then its value should be NULL.This technique provides the flexibility to assign fields dynamically to any group.
Below is an example of how you can assign fields to groups. These 2 IIF() statements show different conditions of different fields that are dynamically assigned to groups. This provides the user tremendous flexibility.
IIF(EaDisplay > 0, EaDisplay,EaAcctDescription) AS Grp2 ,
IIF(EaOrigAppr IS NOT NULL,EaOrigAppr, (EaCurrAppr + EaPyWApp)) AS Grp3 ,
In our example below there are 7 groups and your logic may use Group1 and Group7 which will be dynamically assigned fields. This means Group 2 to Group7 should be NULL and will not be shown in the report.
See an example of the report’s body below:
All fields in each group should be warped around with a Conditional Object so each space will be shrunk if the Group value is NULL. In the Condition Expression of the Conditional Object add this code for each group. Seg7<>"" so the label for each NULL group will not be shown. Seg7 is for Group 7 in my case, or you can enter any name that works for you for the group’s label.
About Doron Farber
Doron is an independent Alpha Anywhere developer and the owner of the The Farber Consulting Group, Inc. who builds database applications and websites for desktop and mobile devices. Doron's entire development business relies on Alpha Anywhere for custom software development and commercial software products. Doron’s firm also provides database optimization and remote DBA services for MS SQL and MySQL databases.Doron can be reached at:
Comment