470,568 Members | 1,578 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,568 developers. It's quick & easy.

Report Viewer Asynchronous thread abort error

Hi All

I have a VB.net 2005 app which uses MS Report Viewer to create reports

Occassionally I get the following error when changing to a different report

User code running on thread 196 has attempted to abort thread 3560. This may
result in a corrupt state or resource leaks if the thread being aborted was
in the middle of an operation that modifies global state or uses native
resources. Aborting threads other than the currently running thread is
strongly discouraged.

The error occurs in
ReportViewer1_RenderingComplete event. Code below....

Try

Me.ReportViewer1.SetDisplayMode(Microsoft.Reportin g.WinForms.DisplayMode.PrintLayout)

Me.ReportViewer1.ZoomMode = Microsoft.Reporting.WinForms.ZoomMode.Percent
******** line where error occurs

mypath = ReportViewer1.LocalReport.ReportPath

If mypath = reportpath & "DailyCashFlow.rdlc" Or mypath = reportpath &
"Staff.rdlc" Or mypath = reportpath & "rebookings.rdlc" Or mypath =
reportpath & "SalesbyPaymentType.rdlc" Then

Me.ReportViewer1.ZoomPercent = 80

Else

Me.ReportViewer1.ZoomPercent = 90

End If

Catch ex As Exception

mymsgbox(ex.Message)

End Try

Any ideas

Regards

Steve
Dec 1 '06 #1
3 5327
Hi Steve,

Based on my understanding, you get an error occassionally when changing a
different report for a ReportViewer control in your VB.NET 2005 WinForms
application. If I'm off base, please feel free to let me know.

You have mentioned that it is when you're trying to change a different
report in the ReportViewer that you get an error. But the sample code you
demonstrate doesn't change the current report in the ReportViewer control
at all.

I have performed a test based on your sample code but didn't reproduce the
problem you described.

FYI, to change the report in a ReportViewer control, you could set the
ReportViewer. LocalReport.ReportPath property to the file path of a
different .rdlc file. Note that you must call the ReportViewer control's
Reset method to reset the ReportViewer before you attach a different report
to it.

If the problem still exists, you may send your sample project that could
just reproduce the problem to me. To get my actual email address, remove
'online' from the displayed email address.
Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Dec 4 '06 #2
Hi Linda

Sorry about the lack of detail

In another routine I reset the the Reportviewer then set it to a local path
..rdlc then populate the datasource e.g
ReportViewer1.Reset()

ReportViewer1.ProcessingMode =
Microsoft.Reporting.WinForms.ProcessingMode.Local

If ReportViewer1.LocalReport.DataSources.Count 0 Then

ReportViewer1.LocalReport.DataSources.RemoveAt(0)

End If

sql = "SELECT * from customers order by surname"

dtsales = getdata(sql)

dtsales.Columns.Add("myheading", GetType(System.String))

If dtsales.Rows.Count 0 Then

dtsales.Rows(0)("myheading") = "All Customers"

End If

ReportViewer1.LocalReport.DataSources.Add(New
Microsoft.Reporting.WinForms.ReportDataSource("Gee PosDataSet_Customers",
dtsales))

ReportViewer1.LocalReport.ReportPath = reportpath & "Customers.rdlc"

ReportViewer1.RefreshReport()

I only get the error on 1 computer and I beginning to suspect it may have
some hardware issues. I also only get the error when running the code from
within VB IDE not from running the application .exe

Regards

steve

"Linda Liu [MSFT]" <v-****@online.microsoft.comwrote in message
news:Fm*************@TK2MSFTNGHUB02.phx.gbl...
Hi Steve,

Based on my understanding, you get an error occassionally when changing a
different report for a ReportViewer control in your VB.NET 2005 WinForms
application. If I'm off base, please feel free to let me know.

You have mentioned that it is when you're trying to change a different
report in the ReportViewer that you get an error. But the sample code you
demonstrate doesn't change the current report in the ReportViewer control
at all.

I have performed a test based on your sample code but didn't reproduce the
problem you described.

FYI, to change the report in a ReportViewer control, you could set the
ReportViewer. LocalReport.ReportPath property to the file path of a
different .rdlc file. Note that you must call the ReportViewer control's
Reset method to reset the ReportViewer before you attach a different
report
to it.

If the problem still exists, you may send your sample project that could
just reproduce the problem to me. To get my actual email address, remove
'online' from the displayed email address.
Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no
rights.

Dec 6 '06 #3
Hi Steve,

Thank you for your reply and the detailed information.

Since the problem only exists when it is run under VS IDE on one pc, you
may check what the differences are in the particular machine and other
machines.

Hope this helps.

Sincerely,
Linda Liu
Microsoft Online Community Support

Dec 7 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Morris | last post: by
1 post views Thread by Natalia DeBow | last post: by
22 posts views Thread by Brett | last post: by
reply views Thread by Chris | last post: by
5 posts views Thread by matt | last post: by
reply views Thread by Tumurbaatar S. | last post: by
8 posts views Thread by Richard Maher | last post: by
1 post views Thread by livre | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.