Skip to Content

Reading the duplex setting in a Crystal Reports formula?

It is easy to set a different left margin through a forumula, ie:

// Denna formel måste returnera ett värde i twips.
If Remainder (pagenumber,2) = 0 then 0 else 1440


But I only want to do this when the report is set to print duplexed. How can I detect that in a formula? There is a variable for PrinterOrientation, but not for PrinterDuplex.

CrystalReports for Visual Studio

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Nov 22, 2017 at 04:29 PM

    There is a very useful document for Crystal Reports printing:

    www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/40e40899-721e-2b10-b084-c7ed76af46f1

    It says (page 23): Crystal Reports does not control a printer's duplex printing ability. The printer driver for the
    printer handles the duplex print control.
    Add comment
    10|10000 characters needed characters exceeded

  • Nov 22, 2017 at 05:30 PM

    Hi Anders,

    If you are running the report through a custom application, you can have your application query the printer for the duplex setting. If it is printing duplex then pass a parameter to the margin formula that will trigger the formula.

    Crystal does very little communication in terms of printer settings so it has to be done external of the report.

    Good luck,

    Brian

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 23, 2017 at 07:26 AM

    OK. That is what I feared :) I will pass the duplex setting to the report, via a parameter.

    Odd though that there is a

    CrystalDecisions::Shared::PrinterDuplex
    Add comment
    10|10000 characters needed characters exceeded