How To: Creating simple reports in Tattoo Management Studio Express Edition, Part II

July 18, 2010 at 12:56 AMrev23dev

In How To: Creating simple reports in Tattoo Management Studio Express Edition we showed you how to create a simple report showing your customers names & e-mail addresses as a list. The report is useful, but it could still use some work. For example, we should sort the list by the customer’s name, and only display customers that actually have an e-mail address.

Adding a sort

To get started, select the newly created “Customer E-mail List” report and click the “Show Report Designer” button on the ribbon toolbar to open the Report Designer.

Report Designer

With the Report Designer open you’ll see the “Group and Sort” dock panel. If you don’t, from the toolbar select View –> Windows –> Group and Sort.

groupandsort

Click the “Add a Sort” button in the “Group and Sort” toolbar. From the popup menu select Customer –> Full Name.

groupandsort2

Full Name now appears in the Group and Sort list.

If you click the “Preview” button, below the Report Designer’s design surface, you can see the sort in action. Click the “Designer” button again to return to the design surface.

Filtering customers with no e-mail address

The report is shaping up nicely. Now, it makes sense to remove customers that have no e-mail address, so the list isn’t longer than it needs to be.

To get started, look for the Property Grid. If you don’t see it, make the window visible from the toolbar by selecting View –> Windows –> Property Grid.

propertygrid

Make sure the report is selected in the controls dropdown. It should say “xafReport1”, but it’s possible that it doesn’t. You can also select the report by clicking the space above or below white portion in the design surface. The white portion represents the page, clicking off the page surface will select the report property.

In the Property Grid, scroll down until you see “Filtering.” Expand it, and you will see more properties. Click your mouse into the “Filter” box and you’ll see the ellipsis (…) button. Click it to open the Filter Builder.

propertygridfilter

Filter Builder

Next to the word “And” you’ll see a plus button. Click it.

You will see a criteria line added to the list.

Filter Builder (2)

In the above images, our criteria is “Full Name begins with.” We need to change this to “Email is not blank.”

Click the property (“Full Name” in this case) to open the Object Model. There you can select the “Email” property. Select “Email” and click the “Add” button.

Object Model

Click the criteria operator (“Begins with” in this case) and select “Is not blank” from the resulting menu.

Our criteria should now say “Email is not blank.” Perfect!

Filter Builder (3)

We’re not done! Click the plus button again to add one more bit of criteria. We also need to make sure the e-mail address is not empty.

Repeating the previous steps, select “Email” as the property once again, and select “Does not equal” as the criteria operator. Now we need to enter a value. Click the “enter a value” prompt to see a text editor. This part is important, press the SPACEBAR on your keyboard, and then press the BACKSPACE key. Now hit ENTER. Your filter should look like the one in the image below.

Filter Builder (4)

Click OK, and you’ll return to the report designer.

Save the report and close the dialog. If you run the report, you’ll now see a list of customers, that have e-mail addresses, sorted by name!

HINT: If you’re wondering why it didn’t show you the filter when you clicked the “Preview” button below the report designer, it’s because the “Design Time Preview” is different from when you run the report. If you’d like to see the filter work in preview, you need to repeat the previous steps for the “FilterForDesignPreview” property in the Property Grid. If you’ve just finished your filter, and you click into that text box, it should pre-fill. if it does not, you can follow the previous steps, or copy the text from the “Filter” property and paste it in the “FilterForDesignPreview” property textbox.

Conclusion

The Report Designer is a very powerful tool that can be used to put together nearly any report you can think of, but it also takes patience and time to learn. Don’t get discouraged, but always remember, if there is a custom report that you would rather we design for you, we offer those services as well.

Posted in:

Tags: , ,