Skip to Content
0
Former Member
Jan 05, 2012 at 07:32 PM

How to handle CR Refresh with vb.net code - Coded but not working

79 Views

vs2010 sp2

cr13 sp2

reports created using cr 12 pushed to vs2010 framework web app with refresh button

Telerik Controls Framework

Programmatically, I am not able to control refreshes.

I have found that my reports print everytime if I refresh before printing.

I want to refresh pages in the viewer automatically

Can I set something in web.config?

Is the button sent to me overiding my code?

Here's snippets in use. I have placed refresh in multiple locations to

get it to work.

Try

'oCrReportDocument.Load("
DataServer64\Avista\Isaac.rpt")

oCrReportDocument.Load(reportpath, OpenReportMethod.OpenReportByTempCopy)

Me.srvReportViewer.RefreshReport()

' **********

'srvReportViewer.DataBind()

'oCrReportDocument.PrintToPrinter(1, True, 0, 0)

' ***********

oCrReportDocument.Database.Dispose()

oCrReportDocument.Close()

oCrReportDocument.Dispose()

oCrReportDocument = Nothing

Catch ex As Exception

oCrReportDocument.Database.Dispose()

oCrReportDocument.Close()

oCrReportDocument.Dispose()

oCrReportDocument = Nothing

GC.Collect()

'Finally

End Try

If Not oCrReportDocument Is Nothing Then

If oCrReportDocument.IsLoaded Then

'

oCrReportDocument.Database.Dispose()

oCrReportDocument.Close()

oCrReportDocument.Dispose()

oCrReportDocument = Nothing

GC.Collect()

End If

End If

Me.srvReportViewer.RefreshReport()

======================================

If (Page.IsPostBack = False) Then

' Remove Group Tree Before Presenting in the viewer

srvReportViewer.ToolPanelView = ToolPanelViewType.None

End If

LoadReportData()

srvReportViewer.RefreshReport()

======================================

Thanks so much in advance,

Isaac