Designing RDLC Reports

Intermediate 25 min read Lesson 3 of 5

Creating a Report

Step 1 — Add Report File

  1. Right-click your project in Solution Explorer
  2. Select Add → New Item
  3. Choose Report from the Reporting folder
  4. Name it: ProductReport.rdlc

Step 2 — Design the Report Layout

Add Data Source

1. Open the report designer
2. Go to View → Report Data
3. Click New → Dataset
4. Select your dataset (ProductDataSet)
5. Choose the Products DataTable

Design the Layout

// Add a Table control
1. Drag Table from Toolbox to report
2. Configure columns:
   - ProductId
   - Name
   - Price
   - Category

// Add Headers
1. In the table, add header text
2. Format with font, color, background

Step 3 — Add Report Elements

// TextBox for title
<Textbox>Product Report</Textbox>

// Table with data
<Table>
    <TableRow>
        <TableCell><Textbox>ID</Textbox></TableCell>
        <TableCell><Textbox>Name</Textbox></TableCell>
        <TableCell><Textbox>Price</Textbox></TableCell>
        <TableCell><Textbox>Category</Textbox></TableCell>
    </TableRow>
    <TableRow>
        <TableCell><Textbox>=Fields!ProductId.Value</Textbox></TableCell>
        <TableCell><Textbox>=Fields!Name.Value</Textbox></TableCell>
        <TableCell><Textbox>=Format(Fields!Price.Value, "C")</Textbox></TableCell>
        <TableCell><Textbox>=Fields!Category.Value</Textbox></TableCell>
    </TableRow>
</Table>

Step 4 — Format the Report

// Formatting options:
- Font: Arial, 10pt
- Header background: Dark Blue
- Header text color: White
- Cell padding: 5px
- Border: 1px solid gray
- Price format: Currency ($#,##0.00)
Key Takeaway

RDLC reports are designed visually in the report designer, making it easy to create professional layouts.

Test Your Knowledge - Take Quiz