Advertisement

04.17.2008 at 05:51AM PDT, ID: 23330617
[x]
Attachment Details

Crystal Reports Paper Size, Print Dialog

Asked by JeffvClayton in Microsoft Visual Basic.Net, Crystal Reports Software

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.CrystalReports.Engine.ReportDocument
        Dim pd As New PrintDialog
        Rep = CrystalReportViewer.ReportSource

        Dim PrinterSettings As New System.Drawing.Printing.PrinterSettings()
        Dim PageSettings As New System.Drawing.Printing.PageSettings(PrinterSettings)

        Rep.PrintOptions.CopyTo(PrinterSettings, 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.PrintRange = PageSettings.PrinterSettings.PrintRange 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
[+][-]04.17.2008 at 06:34AM PDT, ID: 21376824

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual Basic.Net, Crystal Reports Software
Sign Up Now!
Solution Provided By: mlmcc
Participating Experts: 1
Solution Grade: C
 
 
[+][-]04.17.2008 at 06:55AM PDT, ID: 21377048

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.17.2008 at 08:34AM PDT, ID: 21378263

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.22.2008 at 01:15AM PDT, ID: 21408937

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628