Strange AR exception

Posted by: softcomlimited on 28 May 2020, 9:08 am EST

    • Post Options:
    • Link

    Posted 28 May 2020, 9:08 am EST

    Hello,

    I have a v12 XML-based section report in an application that several of my customers have run except one and I don’t know the cause and I can’t yet duplicate it in my development environment. I am hoping you might give me a clue. The exception is

    System.ComponentModel.Win32Exception (0x80004005): The data is invalid

    at System.Drawing.Printing.PrinterSettings.GetHdevmodeInternal(String printer)

    at System.Drawing.Printing.PrinterSettings.GetHdevmodeInternal()

    at System.Drawing.Printing.PrinterSettings.GetHdevmode()

    at System.Drawing.Printing.PageSettings.get_PaperSource()

    at GrapeCity.ActiveReports.Viewer.Win.Controls.CustomPrintDialog.RunDialog(IntPtr hwndOwner)

    at System.Windows.Forms.CommonDialog.ShowDialog(IWin32Window owner)

    at System.Windows.Forms.CommonDialog.ShowDialog()

    at GrapeCity.ActiveReports.Viewer.Win.Printing.PrintImpl.#zs(#q0B documentPrintAdapter, Action

    1 action, Boolean useStandardDialog, Boolean useXpStyleDialog)    at GrapeCity.ActiveReports.Viewer.Win.Printing.PrintImpl.Print(#q0B documentPrintAdapter, Boolean showPrintDialog, Boolean showPrintProgressDialog, Boolean usePrintingThread, Boolean useStandardDialog, Boolean useXpStyleDialog, Action
    1 action)

    at GrapeCity.ActiveReports.Viewer.Win.Printing.PrintImpl.Print(DocumentModel documentModel, ReportModelBase reportModel, IApplicationContext context, Boolean showPrintDialog, Boolean showPrintProgressDialog, Boolean usePrintingThread, Boolean useStandardDialog, Boolean useXpStyleDialog)

    at GrapeCity.ActiveReports.Viewer.Win.Printing.PrintImpl.Print(DocumentModel documentModel, ReportModelBase reportModel, IApplicationContext context, PrintingSettings settings)

    at #1sz.#RiL.Print(DocumentModel documentModel, ReportModelBase reportModel, IApplicationContext context, PrintingSettings settings)

    at GrapeCity.Viewer.Common.ViewModel.ToolbarViewModel.<>c__DisplayClass3e.#9kz()

    Regards

    Brian

  • Posted 28 May 2020, 11:09 pm EST

    Hello,

    How are you! long time no hear !

    It is possible workaround for this error to implement a custom print dialog such as below:

    
    Using dlgPrint As PrintDialog = New PrintDialog()
                    If dlgPrint.ShowDialog() = DialogResult.OK Then
                        sectionDocument.Printer.PrinterSettings = dlgPrint.PrinterSettings
                        GrapeCity.ActiveReports.PrintExtension.Print(sectionDocument, False, False, False)
                    End If
                End Using
    
    

    Thanks,

    Mohit

  • Posted 28 May 2020, 11:18 pm EST

    Mr Mohit,

    All is well except this customer with this weird error.

    Do you know what exactly is the cause of the error? It is only this one user getting the issue.

    Thanks a lot

    Brian

  • Posted 28 May 2020, 11:31 pm EST

    Hello,

    In my understanding, this error problem occurs when there is a compatibility issue with the installed printer driver

    Also, you can try after using the standard dialog: Document.Print(GrapeCity.Viewer.Common.PrintingSettings.UseStandardDialog);

    Thanks,

    Mohit

  • Posted 29 May 2020, 12:45 am EST

    Mr Mohit,

    Ok, I was talking to the customer and the problem is coming from the Print icon on the Win.Viewer form after they see the preview on the screen. So I am going to try using

    Me.rptViewer.PrintingSettings = CType((((GrapeCity.Viewer.Common.PrintingSettings.ShowPrintDialog Or GrapeCity.Viewer.Common.PrintingSettings.ShowPrintProgressDialog) _

    Or GrapeCity.Viewer.Common.PrintingSettings.UsePrintingThread) _

    Or GrapeCity.Viewer.Common.PrintingSettings.UseStandardDialog), GrapeCity.Viewer.Common.PrintingSettings)

    on the preview form and see if it helps.

    Thanks

    Brian

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels