JackLacava
Community Manager
Community Manager

It has been a quiet Tuesday morning at Badabing Ltd. Had some decent coffee, checked all reports went out last night, and basked in the glory of a sea of green "OK" calculation statuses. As you ponder whether to dig into your third cannoli of the day, a voice booms across the office: "Hey Joey! Joey! Camhear.... Y'know the top-5-products report you sent out last night, yea? The one they built for us back in 2021, them wunderkids from the City? Boss wants to make it top-10, and to bring extra columns in it. Oh, and make it a bit different - all our reports kinda look the same, he gets confused, y'know, and we don't want him confused - he might whack the wrong thing, 'nowwattamean?"

"... Sure, am on it."

This is gonna be painful. That report uses some custom Dashboard DataSet and Member List, written by someone trying to earn their fee by looking clever. You kinda know your VB from your C#, but changing this pile of hacks looks daunting. Y'know what, fuggedaboutit - you're just going to scrap it and rebuild the report without any code!

The data - Cube View + Data Adapter

First, we'll have to find the data we need. Cube Views are great for that! So you quickly build a simple CV with all your product sales data.

JackLacava_0-1714041444319.png

 CVs don't allow for sorting by value, and without code they can only be formatted in a standard way for PDF output. That's alright; we have Dashboard Components that are much more customizable! To bring our CV data to such components, we will simply build a basic Data Adapter (on the Workspaces page for v.7.3+, or Dashboards page for older versions).

JackLacava_1-1714041596115.png

Interactive Report - BiViewer

Alright, so we got the data, how do we display it? BiViewer is the obvious choice for interactive reporting. It looks nice and it's so easy to configure. First we attach the DataAdapter and save:

JackLacava_1-1714045380642.png

Then we switch to BI Designer, create a Grid, drag and drop a few columns and boom, it's done.

JackLacava_3-1714042113210.png

Ok, but now we have too many products, and not sorted. How do we fix that? Easy:

JackLacava_4-1714042165445.png

JackLacava_6-1714042233910.png

JackLacava_7-1714042257725.png

And it's done! We can now trivally add some bells and whistles: extra columns, custom formatting, and so on.

Print-perfect Reporting - Report Component

Bi Viewer is great, but the Boss is old-fashioned: he likes paper that can be stored away, just in case something happens, y'know? How do we deal with this? Easy: with the Report Component.

We create the component and again attach the very same adapter:

JackLacava_1-1714045380642.png

We then switch to the Report Designer, and we drag and drop our fields in the Detail Band:

JackLacava_2-1714045616780.png

Next, we need to sort our records, using the Group And Sort toolview:

JackLacava_3-1714045688609.png

We select our Amount field from the Add a Sort menu

JackLacava_4-1714045738967.png

Then set it to sort in Descending order

JackLacava_5-1714045811365.png

At this point, data in the report would be sorted correctly, but it would still show too many products rather than the top 10. To cut the number of records displayed, we have to open the properties of our Report object, and select the gears icon:

JackLacava_6-1714045942464.png

We then expand "Report Print Options" to find the Detail Count value. By default it's set to zero, which means all records will be displayed. By changing that we can limit our output to the first 10 records:

JackLacava_9-1714046771752.png

(If you're wondering what the difference is between that and the "at Design Time" version: "Design Time" is when you look at the Preview tab in the Report Designer. If you know you have a lot of records and you're just testing some layout tweaks, you can set this to a low number to speed up preview generation. Like for the other version, a zero means it's disabled and all records will be displayed.)

And this is our output:

JackLacava_10-1714047015227.png

Now we'll have a bit of fun with graphics, formatting, and so on, making our report stand out. Hey - all this was so fast, there are still some cannoli left!