Rhogar
Rhogar

Reputation: 23

Visual Studio 2013 Report RDLC with related datasets

I currently have two tables in a database "customer" and "pricelist" where a customer can have multiple pricelist items linked to their ID.

I'm trying to build a report in VS2013 where it lists all customers [alphabetically], then all of their pricelist items [alphabetically], then page break between each customer.

I've tried setting it up to use a dataset of each table, which doesn't let me group them together, and I've also tried joining the two tables into one view which was the closest I had gotten. The problem was that for each item, it printed the customer name and a page break, because of the inner join i was doing where each record has the customer name on it.

Please help me figure this out! I just want to be able to display the data as such;

CUSTOMER NAME
.........ITEM 1.....PRICE
.........ITEM 2.....PRICE
.........ETC

PAGE BREAK

CUSTOMER NAME
.........ITEM 1.....PRICE
.........ETC.

Upvotes: 0

Views: 458

Answers (1)

Quintin Botes
Quintin Botes

Reputation: 345

To group data in a report:

  1. Click the Design tab.
  2. If you do not see the Row Groups pane , right-click the design surface and click view and then click Grouping.
  3. From the Report Data pane, drag the Date field to the Row Groups pane. Place it above the row called (Details). Note that the row handle now has a bracket in it, to show a group. The table now also has two Date columns -- one on either side of a vertical dotted line. enter image description here
  4. From the Report Data pane, drag the Order field to the Row Groups pane. Place it below Date and above (Details). Note that the row handle now has two brackets in it, to show two groups. The table now has two Order columns, too.
  5. Delete the original Date and Order columns to the right of the double line. This removes this individual record values so that only the group value is displayed. Select the column handles for the two columns, right-click and click Delete Columns. You can format the column headers and date again
  6. Switch to the Preview tab to preview the report. It should look similar to the following illustration: enter image description here

The answer was retrieved from this MSDN page

Upvotes: 0

Related Questions