This section describes the steps to design Product Details
report using barcode and SSRS table report item.
To present data in the table format, create a dataset and bind data to the table data region. In this designing section, the following dataset query is used for dataset creation.
SELECT TOP 100 [Order Details].ProductID, Products.ProductName, [Order Details].Quantity, [Order Details].UnitPrice, [Order Details].Discount
FROM [Order Details] INNER JOIN
Products ON [Order Details].ProductID = Products.ProductID
Refer Create Data section and create dataset using the above query. Northwind
database is used here.
Dataset
property in the table properties.
Add the required table column headers in the table as shown in the below snap.
Now, assign the required product details data fields in the Details
group row of the table cell.
Following expressions are used in the UnitPrice
and Total Price
cells of the table.
=FormatCurrency(FormatNumber(Fields!UnitPrice.Value,2))
=FormatCurrency(FormatNumber(Fields!Quantity.Value * Fields!UnitPrice.Value,2))
In the above table design, Product ID
cell is left empty, it would be better if we present the product ID using the barcode.
Product ID
column cell.
Product ID
column cell.
If we directly add barcode into table cell, the report item fill the whole cell. So, rectangle report item is used as container.
Text
property under Basic Settings
category.
Expression Builder
assign the =Fields!ProductID.Value
field value and click Ok
.
Now, the Product ID
of each product will encoded in the barcode report item on report export action.
Using the position and appearance properties, you can customize the barcode report item as shown below,
Header
to add a title to the report.
Refer Show or hide header and footer section to add or remove header/footer in the report.
A final design of Product Details report will look like below.
On report preview, the product details report will be displayed like below,
Download the above report design from the link