Search code examples
c#vb.netreportviewerrdlc

ReportViewer grouping header in report header section?


enter image description here

Hi, I'm working on a report which uses reportviewer in VS2010.

It is an invoice report. It has some accounts in the system, for each account, it has some orders. Now, in each month, we need to send the invoice to each account.

In the report, at the top, we need to list "Bill To" (the address for each account) and "Invoice#", for each account, it is different, and it is continouous. Then, at the center, it should list the details of the orders for this account. Obviously, each account should have an invoice.

See the attached screen shot. I used grouping and created the invoice shown in screen shot.

But, it has a problem. The "Account address", "Terms", and "Invoice #", I could not put them in the grouping (those are the same within the group). Thus, for different groups, they are shown as the same values, although in the rdlc file, I put their fields there.

Anyone knows how to solve the problem?

One possibility is: instead of creating the invoice for all accounts in one report (i.e. 20 pages, each page is an invoice for an account), create a report for each invoice for each account (so total 20 files), then print the invoice directly. This will work since we can manipulate all the data, and use reportviewer parameters for Account Address, Terms, ...

However, it means we could not browse the reports before print (withint the software). Any suggestions?

thanks

reader


Solution

  • What you can do is , since for each account there is an address, invoice# and invoice details or orders in your case,

    So what you can do is :

    EDIT : Let me go in some detailed fashion ! (Please zoom in to see the image details clearly)

    1.Create a new report and add a Tablix to it
    --Tablix has the property , it can iterate through your data
    and create dataset which will get data for Account address, invoice, and Terms. Then :
    enter image description here



    if you are not able to view the image properly ..here is the same presented for you

    This is the way I did my reports with similar requirements...sub-reports would ease the tasks to a much extent ..

    p.s:

    • Edit: No need to go for a Header.. as you say in your subject of question. jus the main report and a sub-report should do what you need !
    • I jus saw yours is crystal report.. but the concept is over all the same