|
When I call PrintPreviewDialog.ShowDialog()
I get an empty window saying: "This document does not
contain any pages"
Make sure that the PrintPreviewDialog.Document property
is set to your PrintForm control.
When I call PrintPreviewDialog.ShowDialog()
I get an unhandled exception with the following text:
"An unhandled exception has occurred in your application.
If you click Continue, the application will ignore this
error and attempt to continue. If you click Quit, the
application will be shut down immediately. The BodyContainer
property of [PrintDocument document] has not been set."
You must set the BodyContainer property of PrintForm
to the container control you wish to print (eg Form,
Panel etc), otherwise PrintForm has nothing to render
at print time and raises this exception to notify you.
How do I make my form come out
white at print (or print preview) time?
To alter the Background Color of any control at print
(or print preview) time set the BackColorWhilePrinting
property of the control to the desired color. We also
refer you to the samples provided with PrintForm for
further information.
Some of the controls on my Form
aren't displayed at print (or print preview) time, or
are 'empty'
Some controls in .NET and some third party controls
are not fully managed or are not written according to
the .NET control guidelines, as a result they need to
be marked as 'Legacy' controls in order for PrintForm
to correctly print them. To do this select the control
in question in Visual Studio .NET and set it's UseLegacyPrinting
property to true. This will resolve the problem in most
cases.
When I upgraded
to PrintForm v2 I got an error when I tried to rebuild
my project similar to the following: "Reference
required to assembly 'PrintChaining' containing the
implemented interface 'TMGDevelopment.Printing.IChainedDocument'.
Add one to your project."
PrintForm from version 2.0 onwards has a dependency
on the extra shared assembly PrintChaining.dll. To recompile
your project you must add a reference to PrintChaining
to your project: right click on 'References' in the
Solution Explorer>select 'Add Reference'>on the
.NET tab scroll down and select PrintChaining. You will
also need to deploy PrintChaining.dll with your application
that uses PrintForm.
I get a Licensing
Exception when I run a managed Visual C++ application
using PrintForm
Unfortunately C++ in Visual Studio 2003 doesn't provide
nearly as much support for the .NET component licensing
process as C# or VB.NET, with regard to creating the
licenses file for a licensed control and binding it
into the executable - you have to do most of it yourself.
Here are the steps you must follow:
1. Open a Visual Studio 2003 command prompt
2. Change directory to your project folder (where the
licenses.licx file is)
3. Run the following command to generate the .licenses
file
lc /target:<your exe filename.exe>
/complist:licenses.licx /i:PrintForm.dll
4. This generates a file called <your exe filename.exe>.licenses
in the project folder
5. In Visual Studio, right click on the project in the
Solution Explorer and select Properties>Linker>Input>Embed
Managed Resource File and enter the filename of the
.licenses file
6. When you rebuild the solution the .licenses file
will be embedded in the .exe manifest and the component
should be able to read it at runtime
Note: you only need to generate
this once for a given project, but it is specific to
the project (the licenses file contains a reference
to <your exe filename.exe> and won't work with
any other project.
|