Question

I am using ReportViewer in VS 2010 to port certain legacy MS Access reports to a C# application. I need to create a report header that is shown at the very top of the first page above the page header much in the same way that it's done in Access, but I'm not having any luck.

Surely there's a way to do this?

Edit Here's my progress so far.

Attempt #1: Put the report header elements in the page header and have them turn hidden for every page other than the first one. Unfortunately this leaves a big empty space in subsequent pages because the page header height cannot be adjusted on a per-page basis based on the content.

Attempt #2: Put the report header elements in the report body. This can work if the page header only contains the column headers for a table. You can set the column header row to appear for every page. However you cannot have other things like the page number appear since it cannot be displayed in the report body.

Attempt #3: Use a master report to display the report header and a subreport to display everything else. This fails miserably since you can't use the page header or footer of a subreport.

At this point I'm out of options. Is there something I haven't tried or do I need to switch to another reporting platform?

Was it helpful?

Solution

In the end I had to get creative. I placed my report header data on the report body. Underneath that I put the items that should be on the page header. I also copied those on the actual page header but set the header so it wouldn't show up on the first page. This works well for simple static text although it'd need more work if the page header contained any short of aggregate data.

It's a horrible hack, but it gets the job done until I can move to a better reporting platform.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top