Hi, I am using rdlc, reportviewer etc.
The code is like
Code:
Private Sub ctlReportViewer_RenderingComplete(ByVal sender As Object, ByVal e As Microsoft.Reporting.WinForms.RenderingCompleteEventArgs) Handles ctlReportViewer.RenderingComplete
If m = True Then
ctlReportViewer.PrintDialog()
Else
Trace.WriteLine("ReportViewer RendingComplete Error")
End If
End Sub
Public Sub PrintReconcileReport(ByVal Table1 As DataTable)
Dim rpv2 As New Microsoft.Reporting.WinForms.ReportViewer
Dim daCount As New DataAccess("Count")
ctlReportViewer = rpv2 ' CType(Me.IOTransitMediator.GetControl("ReportViewer1"), Microsoft.Reporting.WinForms.ReportViewer)
Dim ds As DataSet
ds = New DataSet
'Dim ds As New DataSet
'creating a dataset
ds.Tables.Add(Table1)
'adding the table to dataset
ctlReportViewer.Reset()
ctlReportViewer.LocalReport.DataSources.Clear()
Dim myBindingSource As New BindingSource
myBindingSource.DataMember = "T"
myBindingSource.DataSource = ds
Dim rptSource2 As New Microsoft.Reporting.WinForms.ReportDataSource("Report", myBindingSource)
ctlReportViewer.LocalReport.DataSources.Add(rptSource2)
ctlReportViewer.LocalReport.ReportEmbeddedResource = "SReconciliationReport.rdlc"
...
Try
ctlReportViewer.LocalReport.SetParameters(paramList)
Catch ex As Exception
End Try
ctlReportViewer.LocalReport.Refresh()
ctlReportViewer.SetDisplayMode(DisplayMode.PrintLayout)
ctlReportViewer.ZoomMode = ZoomMode.PageWidth
ctlReportViewer.RefreshReport()
m = True
End Sub
Everything is fine except the following.
Code:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.InvalidOperationException: Operation is not valid due to the current state of the object.
at Microsoft.Reporting.WinForms.ReportViewer.PrintDialog()
at SNT.ReportViewerTillReconcilliation.ctlReportViewerTill_RenderingComplete(Object sender, RenderingCompleteEventArgs e)
at Microsoft.Reporting.WinForms.ReportViewer.OnRenderingCompleteUI(ProcessThreadResult result, PostRenderArgs postRenderArgs)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
Microsoft.VisualBasic
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
...........
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Would you please tell me how to handle this issue?
Thanks