Databases Reference
In-Depth Information
SELECT Name
, ListPrice
, ProductSubcategoryID
FROM Production.Product
WHERE ProductSubcategoryID = @SubCategoryID
ORDER BY Name
4.
On the Layout tab, add a List item to the report.
5.
From the Datasets window, drag the Name and ListPrice fields into the List item and arrange
them horizontally to form a row with sufficient room for these values. Resize the list so that it is
the height of one text box and about 4 inches wide. Place two text boxes to be column headings
above the list and set their values to read Product and Price, as shown in Figure 6-45. Arrange
the text boxes and the items in the list to line up, right justify the Price heading text box, and
then resize the report body background to fit closely around the list.
Figure 6-45
6. To dress up the report a bit, set the top border style for the list to be solid (in the Properties win-
dow, select BorderStyle|Top|Solid ). Also set the Format property for the ListPrice text box
to C2 .
7. Add a new report called Product List Categories and create a new data set Product_List_
Categories using the ProductCategory and ProductSubCategory tables. Leave the join in place,
alias the name columns from both the tables, and sort by first the category name and then the
subcategory name. The resulting SQL expression should look like the following:
SELECT Production.ProductCategory.Name AS ProductCategory
, Production.ProductSubcategory.Name AS SubCategory
, Production.ProductSubcategory.ProductSubcategoryID
FROM Production.ProductCategory
INNER JOIN Production.ProductSubcategory
ON Production.ProductCategory.ProductCategoryID
= Production.ProductSubcategory.ProductCategoryID
ORDER BY Production.ProductCategory.Name
, Production.ProductSubcategory.Name
8.
On the Layout tab, add a text box to be used for the report heading and a List item. Drag and
drop the ProductCategory and SubCategory fields from the Dataset window into the list
data region, with the Product_List_Categories data set selected. Size the list item to be about
6.5 inches wide by 1.5 inches tall (about 13 cm by 4 cm). Arrange the two new text boxes in two
rows and staggered in the top area of the list. I'm going for roughly the same look as the previ-
ous report examples using two group headings.
9.
Select the ProductCategory text box, and then find the HideDuplicates property in the
Properties window. Change this property value to be True.
Search WWH ::




Custom Search