0

Working on .rdlc to print directly (without preview) (Reference: Print a ReportViewer Without Preview). I am able to print directly to printer without opening ReportViewer. I am stuck in a weird situation. The above mentioned solution works well in Windows 7 but generates an error "Some parameters or credentials have not been specified" in Windows 10. This error is generated on

ReportPageSettings reportPageSettings = report.GetDefaultPageSettings();

I have tested the same code that works on Windows 7. Migrating to Windows 10 generates this error.

I have tried 1)

  Dim lrpt As New LocalReport()
        lrpt.ReportEmbeddedResource = "POS-Rest.Invoice.rdlc"
        Dim rds As New ReportDataSource("InvoiceDataSet", SelfDetailsBindingSource)

        lrpt.DataSources.Add(rds)
        lrpt.Refresh()
        lrpt.ExecuteReportInCurrentAppDomain(System.Reflection.Assembly.GetExecutingAssembly().Evidence)

 Dim rpt As New ReportPrintDocument(lrpt)
rpt.Print()

2)

Dim rpt As New ReportPrintDocument(Me.ReportViewer1.LocalReport)
 rpt.Print()

Check the error screenshot !http://prntscr.com/nj4s49

  • Maybe your app isn't leveraging the user's credentials. Before you run the report try `ApplicationServices.User.InitializeWithWindowsUser()` – tgolisch May 01 '19 at 19:28
  • No Luck. I have tried to invoke the suggested method before passing my Local Report to ReportPrintDocument. But getting the same problem. Refer to Screen shots http://prntscr.com/njcph7 and http://prntscr.com/njcppz – user7386459 May 02 '19 at 05:09
  • For that exception. Could you please "View Detail". Sometimes there is an `InnerException` and sometimes the Stack Trace contains useful hints (and sometimes it doesn't). – tgolisch May 02 '19 at 13:02
  • @tgolisch InnerException is NULL. But StackTrace reveals the location ```at LocalReport.PerformBookmarkNavigation(String bookmarkis, String& uniqueName).``` Refer http://prntscr.com/njiizj – user7386459 May 02 '19 at 13:37

0 Answers0