Adding a Back Button to a SSRS Drill through Report.
Posted by Elon B. on July 31, 2010
Scenario
You have a Reporting Services report viewed via a browser that has a drill-through to another report. When the drill through report is opened, you would like the user to be able to “jump back” to the previous parent report page. Users can use the browsers back button to do this, but you would like to place a more obvious link on the Report.
Solution
The following report was created using BIDS for SQL Server 2008. The same method can be employed for the 2005 version, though the dialog boxes may appear slightly different.
Open your drill- through report (i.e. the report you will be drilling to, from another ssrs report) and add a text box, which you can format to look like a button, if you wish.
After Adding the Textbox, View its Properties (right-click on textbox).
In the Textbox Properties Dialog box, Select Action, and check “Go to URL”
Enter javascript:history.back(1) in the entry box, then press OK.
When you deploy the report, and view it in your browser, the user only has to click on the “button” (Go Back) to be returned to the previous browser page, which would be the parent report.
Ted Smith said
Hi.
I did exactly as you said, but absolutely nothing happens when textbox is clicked.
Maybe there are some other settings that need to be present in order for this to work?
Thank you.
LikeLike
Elon B. said
Hi Ted,
The example report shown above, is the report you have drilled through to, and assumes you have arrived at it from another ssrs report.
Is that what you have done and arrived at your report from another ?
LikeLike
Juliusz P. said
Hi,
Very good trick.
Thank you
LikeLike
Zach Stagers said
Brilliant, exactly what I needed.
Worked a treat!
Thanks!
LikeLike
Debalina Santra said
Hi Elton,
Thanks for such a wonderful solution .
i have visited lots of sites from past one month
but didnt got any fruitfull result.
finally i got the solution from here.
Thank you.
LikeLike
Chito said
HI Elon’s
Thank you very much for the trick. This is exactly what I am looking for.
LikeLike
Isaac said
Hi,
Can i have a back button to on the same report?
For example,
when i click on a chart, the chart will have drill down function. At this moment, i want a back button for this report so that i can click on it to go back to the original report which is before the drill down happen.
Is it possible to make it?
LikeLike
Elon B. said
If you want to go back two pages, try using this code:
javascript: window.history.go(-2)
LikeLike
musso007 said
Does this work with FireFox? it seems like it’s not working. Any help would appreciate. Thanks
LikeLike
MagicWallman said
Change javascript:history.back(1) to javascript:history.back(0) if you want your parameters intact, works with SSRS 2008r2
LikeLike
Reader said
I am trying to use javascript:history.back(1) as suggested. But it does not preserve the parameters in Chrome or Safari. It works fine in IE. Help is appreciated.
LikeLiked by 1 person
Kapil said
This is for web application ..if i use this trick in winform application it not works……..Please help..
LikeLike
Narmada Swain said
Thank you Elon. I searched for 2days and finally this works.
LikeLike