Tip:
Highlight text to annotate it
X
Hi. I'm James Johnson, Product Manager at ComponentOne.
In ActiveReports 7 we've revamped our theme support from Data Dynamics Reports to change
the way colors are used, plus we added a new feature: now you can add constant strings
to themes. What is the use of a constant string in a
theme file? Well, combined with the new feature that allows
multiple themes in a single report, you can use themes one after the other to produce
copies of the report that differ only in styling and static text telling whose copy each page
is, like carbonless forms. You may have seen this when a delivery driver
has nearly identical slips; one for you, one for the driver, and one for the office.
So with the new collating feature you can print out these delivery slips or other multi-copy
documents from a single report! We'll create a basic report which uses this
feature to create the delivery slips we mentioned earlier.
Download the XML data file from the URL on your screen.
It contains the Snack and Frozen dinner orders that our truck delivers to 3 stores.
Create a new report, and set the page margins to 0in and the page size to 4.5in x 3.5in.
In the Report Explorer, right click the Data Sources node and choose Add Data Source.
Under the Type dropdown, specify "Xml Provider," and in the Connection String box, type: XmlDoc=\orders.xml Click OK to accept our data source and close
the dialog. Right click on our newly added data source
and choose "Add Data Set." Data sets in an XML data source use XPath
to pull the data out of the file, so we need to use an XPath query for the query string
to return the elements we want in our report (1 element per "row" of data) and then we
construct the fields using XPath expressions to pull the individual items from the collection
of elements returned. For our sample, we'll use the Item element,
so we can set the query string to: //orders/order/items/item Go to the Fields page and add the following
fields using the names and values shown in the table.
These fields will pull our order id, the customer's name and delivery address, the item, and how
many items to deliver. Click OK to accept our list of fields and
close the dialog. Now that our data is set up we can begin constructing
our report. Drag out the Name, Address, City, State, and
ZIP to form a nice address header near the top of the report.
Now add a table and put the Item and Count fields in it, sizing the table columns appropriately.
If you right click on the right-most column header, you can remove the whole column for
a two-column table. Set the table's FixedSize property so that
it takes up most of the height of the page, but leave room for a textbox at the bottom.
This textbox will tell the driver which of the 3 copies they are looking at, but we'll
add that in little a bit. For now, we need to set up Fixed Page grouping.
Click the white background of the report and click the "Property Dialog" action at the
bottom of the property grid. On the Grouping page, under "Group On" expression,
drop down the box and select the OrderID field. If you preview the report now you will see
3 pages in the report, one for each of the customers and their orders.
Now for the fun part, we're going to create a theme for each copy of the report we want,
one for our Driver, one for the Office, and one for the Customer, and we're going to use
a custom color in the theme that shows at a glance which copy is meant for whom.
On the Report menu, select Report Properties. Go to the Themes page and click the New button
on the toolbar. This launches the theme editor.
We'll use Accent 1 as our background color, so click on the Accent 1 color box and choose
White. Since all we're interested in is this one
color and the text, you can skip ahead to the Constants tab.
In the grid that appears, type "Copy" in the Name column and "Customer" in the Value column.
When we are using this theme, the Copy value will contain Customer.
Click OK to exit the theme editor and save the theme as Customer Slip.
Now we'll do the same thing again, only this time choose a faded yellow color for Accent
1 and specify Copy for the name, and "Driver" as the value on the Constants tab.
Click OK to exit the theme editor and save the theme as Driver Slip.
Finally, once more but choose a faded pink color for Accent 1 and specify "Office" as
the value on the constants tab. Once again, click OK and save the theme as
Office Slip. Now that we have our themes, it's time to
apply the values. Click on the white background of the report
(if your report has margins you need to click in the middle of the report--not on the margins
of the page) and specify your background color. In this case, instead of selecting a color,
below the colors we can click the 3rd icon to switch to the themes list where we can
select Accent1. Next add a textbox to the bottom of the report
in that space we saved before. Set its value to: =Theme.Constants!Copy
If we preview the report now we'll have 3 copies of the slips.
However, if you run through the pages you'll see that you get all of the Customer copies
first, followed by Driver copies, and finally the Office copies.
This doesn't resemble the normal order you see for these types of forms, where the carbonless
copies of each document are with the original, followed by the next document, and so on.
Fortunately, it's easy to get the order we want with the Collate property.
In the Report Explorer, click on the Report node at the very top. Then in the property
grid, you'll find the CollateBy property. Change this property to "Value" to print each
order's slips together! Well, thats it...we've covered a lot of things
in FPL but there is much more that you can do with ActiveReports 7.
In future videos, we'll continue to explore the rich set of features available in ActiveReports
7. Go to componentone.com/activereports to download
your free trial of ActiveReports. I'm James Johnson. Thank you for watching
and thank you for choosing ComponentOne.