I have about 60 crystal reports designed around A4. Each Report has the page option "Adjust Automatically" checked. All reports are displayed to the user using the Crystal Report Viewer.
When the user presses the Crystal Report Viewer print button they get the print dialog and can select a different output paper e.g. Letter. This works OK and the reports scale more or less to Letter size maintaining left and right margins although you get a bigger margin top and bottom.
The problem is the program will be used in both Europe and the USA and I dont want users in the USA having to constantly change the output paper to Legal or Tabloid etc..
I have tried setting up my own print dialog button above the viewer with the following code as follows
Dim Rep As CrystalDecisions.CrystalRe
ports.Engi
ne.ReportD
ocument
Dim pd As New PrintDialog
Rep = CrystalReportViewer.Report
Source
Dim PrinterSettings As New System.Drawing.Printing.Pr
interSetti
ngs()
Dim PageSettings As New System.Drawing.Printing.Pa
geSettings
(PrinterSe
ttings)
Rep.PrintOptions.CopyTo(Pr
interSetti
ngs, PageSettings)
pd.PrinterSettings = PrinterSettings
pd.AllowSomePages = True
.... some code to do all the other things I havn't managed
pd.ShowDialog()
The intention was to show the dialog after programatically setting the Output paper (have not managed this), then copy the printdialog settings back to the report before using Rep.PrintToPrinter
As well as not having found a way to alter the print dialog object Output paper, I can't get the dialog to show the reports print range, it just shows a 0 for the start page and a 0 for end page
using pd.PrinterSettings.PrintRa
nge = PageSettings.PrinterSettin
gs.PrintRa
nge didn't do anything
So, I am not sure if I can get this to work. Is the only solution to copy all the report templates and make a set designed around Legal and the US version of A3 for a US version of the program?
(PS setting the reports paper size is not a solution! This will just cut-off the edges depending on the paper size selected, it has to be done by keeping the original paper size but outputting to different paper via printer options)
Start Free Trial