Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ReportViewer and Timer 1

Status
Not open for further replies.

NiceArms

Programmer
May 21, 2009
105
GB
Hi all,

I have 2 SSRS reports what I want to display one after the other in a reportviewer. To explain in more detail, I want reportviewer1 to load a report while in the background reportviewer2 is loading the second report (while hidden) and then after 30 seconds show the updated report and hide the first.

I have something like....

Code:
reportviewer1.visible = true 'report1 is showing
reportviewer2.visible = false 'report2 is hidden
ReportViewer2.ServerReport.ReportPath = "/Caseflow Reports/REPORTNAME" 'the data is being generated while hidden

Wait 30 seconds 'this is the bit i cant figure out

reportviewer1.visible = false 'report2 is showing
reportviewer2.visible = true 'report1 is hidden
ReportViewer1.ServerReport.ReportPath = "/Caseflow Reports/REPORTNAME" 'the data is being generated while hidden

Rinse and repeat.

Any suggestions would be great :D

/Nice
 
You'll need to do this on the client side (i.e. via javascript and/or html) as it's not really an ASP.NET issue as to how to change rendered content.

You could try reading up on some of these examples to get you started though:

1. Meta refresh tag
2. iframes
3. AJAX content loading

Mark,

Darlington Web Design[tab]|[tab]Experts, Information, Ideas & Knowledge[tab]|[tab]ASP.NET Tips & Tricks
 
Hi ca8msm,

Thank you for your response.

I was worried you were going to say that!

I have read up on the first 2 on your list.

I'm going to try javascript to call the reportviewers.... /fingers crossed

/Nice

 
Ok, it looks like the only way to do this is to create a page for each report and call each page one after the other via an Iframe....... this seems painful tho!
 
the reason this seems painful is because what you are trying to do is awkward. I would re-evaluate this feature/workflow and find a better solution.

for starters, consider that this is a web application. your system should work with http, not against it.

html is pretty simple. generating a report should be as well. the "tricky" part is transforming the data into relevant information for the user.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
I solved this issue.

I created an ASP.NET web application and placed a reportviewer onto the page. I then place
Code:
<head>
<meta id="RefreshPeriod" runat="server" http-equiv="refresh" content="10" />
</head>
into the the page

and used vb script to call the refresh and present the reports i needed
Code:
 Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        ' Set refresh period in seconds
        RefreshPeriod.Content = "10"
 End Sub
    
    Private Sub RefreshPeriod_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles RefreshPeriod.Init

        Dim strURL As String
	'setup or update cookies
        If Not Request.Cookies("SSRS_Report_Viewer") Is Nothing Then
            strURL = Request.Cookies("SSRS_Report_Viewer").Value
        Else
            Response.Cookies("SSRS_Report_Viewer").Value = "/xx00008_00"
            Exit Sub
        End If

	'check which report is in th cookie and choose the next in the sequence
        With ReportViewer1.ServerReport
            Select Case Microsoft.VisualBasic.Mid(strURL, Microsoft.VisualBasic.Len(strURL) - 4, 2)
                Case Is = "08"
                    .ReportPath = "/XX00009_00"
                    .Refresh()
                Case Is = "09"
                    .ReportPath = "/XX00010_00"
                    .Refresh()
                Case Is = "10"
                    .ReportPath = "/XX00011_00"
                    .Refresh()
                Case Is = "11"
                    .ReportPath = "/XX00012_00"
                    .Refresh()
                Case Is = "12"
                    .ReportPath = "/XX00013_00"
                    .Refresh()
                Case Is = "13"
                    .ReportPath = "/XX00014_00"
                    .Refresh()
                Case Is = "14"
                    .ReportPath = "/XX00015_00"
                    .Refresh()
                Case Is = "15"
                    .ReportPath = "/XX00008_00"
                    .Refresh()
            End Select
            Response.Cookies("SSRS_Report_Viewer").Value = .ReportPath.ToString
        End With
    End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top