Saturday, May 16, 2009

DevExpress XtraReports Tip – Managing page headings with subreports

Imagine that you need to produce a report that consists of a detail section and then a summary section that needs to start on the same page as the end of the detail section.

You could create both the detail report as separate reports and join them together with spanned page numbering.  This technique was presented in my webinar.  In this case, it is not the appropriate solution as it would always start the summary report at the top of a new page – not satisfying the same-page requirement.

Because of the same-page requirement, the summary report needs to be a Subreport element in the Report Footer of the detail report.

You will soon discover that this creates an issue with the page headings as soon as the Subreport prints on a new page.

When the Subreport prints on the last page, it will print both the Subreport report header and page header if present.  In order to get the combined detail/subreport page to look correct, you will want to leave the Subreport report header band blank and place all the heading elements in the page heading band.  The SubReport’s designer looks like this:

5-16-2009 9-24-57 PM

The page where the detail report ends and the Subreport begins looks like this:

5-16-2009 8-51-47 PM

The problem occurs when the subreport flows over to the next page.  The detail report has its column headings in its page header band and now the subreport will show its page header band too.  Without any further intervention, you will get a next page that looks like this:

5-16-2009 9-00-16 PM 

The black column headings row containing First Name  and its black line are not relevant for this page. They belong to the prior detail report which is no longer shown.  You cannot just suppress the detail report’s page header band since it contains the orange line area (typically report titles) that must be shown on all pages.

Below is the detail report’s designer page:

5-16-2009 9-16-08 PM

The solution is to change these unwanted elements’ visibility to false in the BeforePrint event of the XRSubreport1 element in the detail report.  I named each of the elements with a “ch” prefix to make them easier to find with IntelliSense.  The code looks like this:

5-16-2009 9-01-57 PM

With this single change, the Subreport overflow pages will look as desired, like this:

5-16-2009 9-05-01 PM

And there you have it.  I created this sample web application in Visual Studio 2008 and Developer Express XtraReports version 9.1 to illustrate the issue and its solution, using the Microsoft AdventureWorks sample database.  If you would like to download the full application to see it for yourself, you can download it here.

Hope that helps.

Joe Kunk
Microsoft MVP VB
Okemos, MI USA

Webinar on Developer Express XtraReports a Success

As mentioned in my previous post, I appeared in the first episode of a new DevExpress webinar series where DevExpress customers share their experiences with various DevExpress products.  XtraReports is a great tool and I wanted to show the tips that, based on my experiences, would be most helpful to a corporate report developer.

My webinar covered:

  • How to create a winforms report from scratch that calls a parameterized database stored procedure and still allows the report to be previewed in the report designer despite the requirement for a parameter value .
  • How to easily migrate the report to as ASP.Net 2.0 web application or ASP.Net website without any report changes.  This can serve as the basis for a windows-to-web reports migration strategy.
  • How to easily add calculated fields and grouping footers with summary values.
  • How to combine multiple independent reports together with consistent page numbering across the combined reports – often eliminating the need for subreports.

I am happy to report that over 1,500 people signed in to listen to the free live webinar.  Unfortunately the webinar room had a limited capacity and not everyone was able to view it live.

In case you missed it, the recording of the full webinar can be found here.

I mentioned at the beginning of the demo that I recorded it in advance with TechSmith Camtasia Studio without any audio and did a live voice-over while playing the demo video, pausing it to elaborate on key points when demonstrated in the video.  This worked very well and I would recommend this technique to anyone doing a live webinar with demos.  I was able to ensure a clean demo and I felt a lot more comfortable going over the demo during the webinar as I knew what was coming up next and did not have the fear of messing up the demo with a nervous typo.

I was not able to cover all the great features of XtraReports that I wanted to in the limited time available.  I hope to do a second webinar sometime soon to cover the next set of features.

I want to thank Ray, Kevin and everyone else at DevExpress for hosting me in their Glendale CA offices and allowing me to be a part of the gang there and in the TechEd booth on Monday and Tuesday.  I felt very welcome.  You are all great people and I really enjoyed my time with you.

Joe Kunk
Microsoft MVP VB
Okemos, MI USA

Tuesday, May 05, 2009

Appearing on Developer Express XtraReports Webinar on Friday 5/8/09 at 2pm EDT

I will be the featured guest on the first episode of the new Webinar series hosted by Developer Express. I will be speaking on using XtraReports and how it has made reporting tasks much easier and more productive for me. This will be the first episode of a ongoing series of Webinars where customers of their products discuss how they have helped them be more effective in their development efforts.

The link to the event can be found at http://community.devexpress.com/blogs/theprogressbar/archive/2009/05/04/devexpress-webinar-this-week-reporting.aspx

XtraReports - Resolving the Reporting Dilemma
Producing reports has traditionally been a tedious task at best. XtraReports resolves the reporting dilemma by providing an advanced reporting tool integrated into Visual Studio using the same techniques you are already accustomed to. This webcast demonstrates the ease of producing reports with common business requirements such as parameters, conditional formatting, calculated fields, subreports, drill-down reports, etc. The End-User report designer is examined as a way to provide reporting capabilities to the end-user, allowing you to focus on more advanced (and interesting) reporting requirements.


Joe Kunk is a Microsoft MVP and Senior Consultant at A. J. Boggs & Company of Okemos, Michigan. Joe has been developing software solutions for education, business, and government for over 25 years.

Update: The webinar was a huge success with almost 300 attendees for the live presentation. The preliminary recording can be found at https://admin.na4.acrobat.com/_a827380175/p49612419/

I will be the Developer Express vendor at TechEd 2009 both Monday and Tuesday if you would like to have a chance to see me demonstrate some of the items covered in the webinar or if you have any questions on XtraReports.


Saturday, May 02, 2009

Windows 7 RC new install over XP does not require a blank partition

Awesome! 

I can use the Custom Installation option of the Windows 7 Installer to install into my existing Windows XP partition.  It will rename the existing Windows folder to a folder named Windows.OLD, and all my applications will need to be reinstalled, but at least all my files will still be there in case I neglected to back up something important.  I did not want to bring over any inefficiencies from the prior XP install anyway, so this option is great.  Thank you Microsoft!

Hope that helps,

Joe Kunk
Microsoft MVP VB
Okemos, MI  USA

Cannot upgrade directly from Windows XP Pro to Windows 7 Release Candidate

Since the Windows 7 RC install program offered upgrade as an option when running from within Windows XP Pro, I was hopeful that I had heard wrong and it would actually upgrade directory from XP.  No such luck.

Since this laptop is only used for a single project and I have all those files backed up, I have decided to do a bare metal install after deleting my existing Windows XP partition.  Hold on baby, this could get exciting!

Joe Kunk
Microsoft MVP VB
Okemos, MI  USA

Windows 7 RC will not install if running on battery

I was trying to upgrade my Windows XP laptop to Window 7 Release Candidate while doing laundry.  The dryer buzzed and like a true geek, I did not want to hold up my Windows 7 upgrade for any reason.  I took the laptop with me on battery power with the intention of answering any installation prompts while I hung up my clothes. 

Unfortunately, after it copied all its temporary files over to the hard disk, the Windows 7 installation informed me that it could not install while on battery power.  The only option was to go back on on A/C and start the upgrade over.

So much for saving time on the upgrade.  I had similar experiences when I try to save money too ...  Apparently I am not that good at either sometimes ...

Hope that helps

Joe Kunk
Microsoft MVP VB
Okemos, MI