A law firm using Aderant Expert asks, “Can we produce a document that looks like our bills through Reporting Services?”. One of the reasons why some may not answer this question with a resounding “absolutely!” relates to how address data is stored in the practice management system (PMS) and how this poses a challenge to presentation and formatting. All firms using Aderant Expert should be familiar with Docudraft (DDRAFT) code that allows them to handle permutations in the data, and while some firms may have even written Basicscript code to emulate this logic in Report Writer or End User Painter, firms may only now be looking at Reporting Services to see if the same logic can be applied. The purpose of this post is to demonstrate how in Reporting Services you might accomplish it.
In Aderant Expert, all address data is stored in a table called HBM_ADDRESS. Some examples of the columns in this table are: ADDRESS1, ADDRESS2, ADDRESS3, ADDRESS4, CITY, COUNTRY_CODE, POST_CODE. Depending on the age and origination of the data (i.e. was it converted from a previous system that only stored addresses in text fields?), and the business rules now enforced at the point of data entry, some database rows may only contain data in the ADDRESS text fields (1, 2, 3, 4), while others have been populated with data in the appropriate placeholder fields (i.e. “Toronto” is populated in the CITY field, instead of ADDRESS3), and some are no doubt a combination of both. Herein lies the challenge: how can I present non-standard data in a standard format?
In DDRAFT, address data might contain logic that resembles something like this:
{If not empty(p_address1)}{p_address1 + “[Hrt]“}{END IF}{IF not empty(p_address2)}{p_address2 + “[Hrt]“}{END IF}
This code instructs the format to only return data if the field in question has a value. If it does, then it will return that value and enter a hard return in order to maintain the format. When a null or a blank is encountered, the entry is skipped, and the next field is evaluated in the same way.
In Basicscript, the same logic might look something like this (where address1$ and address2$ have already been populated with the db values):
In both examples, you would be returning the fully formatted result to a single field or table cell. In Reporting Services, it is my recommendation that the same approach be taken. So, once you have completed your data set, drag and drop a text field or table onto your report layout. Right click on the field to contain the address data and select “Expression”. Once in “Edit Expression”, you would need to enter the following (where address1 and address2 are fields in your data set):
Obviously this example is fairly simplistic, but hopefully you can see how you might extrapolate this logic to meet your more complex formatting requirements.