Skip to Content
avatar image
Former Member

Invalid Index error when trying to set PrinterOptions.PrinterDuplex to Vertical

I am using VB.Net 4.0 and Crystal 13.0.2.

In code I am trying to set the reports PrinterOptions.PrinterDuplex to Duplex.Vertical but if I set it to anything but Duplex.Simplex I get an error - Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))

The line of code where it errors is -

MainReport.PrintOptions.PrinterDuplex = CrystalDecisions.Shared.PrinterDuplex.Vertical

MainReport is defined as -

Private Property MainReport As CrystalReports.Engine.ReportDocument

If the user sets it through the print dialog box then it works fine but by code it doesn't.

Any help would be greatly appreciated.

Thank you.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Nov 16, 2016 at 06:14 PM

    Hi Chris,

    Are you pointing the report to a printer first? If you set any printer settings, you have to specify which printer name and port to send the PrintOptions to. Similar to doing it through the Print Dialog, a user selects the printer and then go into the options, your code has to do the same.

    Hope this helps,


    Add comment
    10|10000 characters needed characters exceeded