BattlFrog
BattlFrog

Reputation: 3397

SSRS - Print Grouped value on each page

Made a report that displays a bunch of invoices based on date range and InvoiceNumber. User can get all invoices in the range or select individual invoices. Each invoice is displayed on a new page (grouped on invoicenumber with page break).

Problem I am having is I want the invoice number displayed on each invoice. Because one of the parameters for the report is the invoice number, I had to supply available values. I tried to get them from the main dataset, but I get an invalid report parameter dependancy errorsaying InvoiceNumber has a default value that depends on the report parameter 'invoiceNumber'.

So I created a second data set with just the invoicenumbers and that got rid of the error, but then I got an ambiguous field reference error on my InvoiceNumber field due to the 2 datasets with invoicenumber. I added first(fields!InvoiceNumber.Value, 'dataset1') but now it displays the same invoice number on each page (obviouxly because of the First().

So How do i get the invoice number for each invoice to display on each page?

Upvotes: 0

Views: 183

Answers (1)

StevenWhite
StevenWhite

Reputation: 6024

A good way to handle this type of scenario is to take advantage of the scope that groups provide.

  1. Create a table with one cell.
  2. Set the cell to be grouped by invoice number.
  3. Insert a rectangle into the cell.
  4. Make the cell fill the entire page and place everything else inside it.
  5. Now any tables or textboxes on the page are naturally scoped to the invoice for each page without having to worry about individual filters. In other words, =First(Fields!InvoiceNumber.Value, "dataset1") will give the correct invoice number on each page.

Upvotes: 1

Related Questions