views:

66

answers:

1

I'm having a bit of trouble printing some of the forms in our Smart Client Software Factory application.

We've got a master form, which has a header showing some critical information, and underneath a list box and a DeckWorkspace. The list contains a set of categories, and when one is selected, a separate form is loaded into the DeckWorkspace showing more detailed information.

When the user selects the print button, they can select which of the categories they want to print.

To print the subforms I've found that I need to open each one, then generate the Image that needs to be printed, then construct the pages from those images.

The problem I'm encountering is that in most cases the form will print without any data in the textboxes and other controls. I've found that if the subform is opened manually before Print is selected, then the data will print. I've tried calling Application.DoEvents() before printing, but this hasn't worked.

Are there any better ways to do this? Would it be better if I were to use CrystalReports?

A: 

Reason could be,

You have used Form Load event to load values on controls, which is not fired when you create new instance of form, only constructor is calling.

Using the show method before capturing the image, may solve the problem...

Lalit