locked
Calendar control and web page refresh :( RRS feed

  • Question

  • Hello. Is there any way to stop the web page from refreshing when selecting a date from the calendar control in SSRS 2005?  I've done some digging around, and the only 'fix' found so far is to set the default date values from a dataset; which I've done, but Im still seeing the same results.  I have a Start and End date parameter, both defined as datetime parameters, neither have any dependencies on any other report parameters,  no cascading between any parameters in the report....nothing; as generic as it comes.   I see there is an onclick Javascript event firing everytime a date is selected from this control.  Is this what is causing the page refresh?  Is there no way to turn this behavior off?

     

    Thanks 

    Wednesday, March 26, 2008 7:59 PM

Answers

  • It sounds like you have dependant parameters setup.  When a parameter is dependant on a parameter that comes before it then the entire page will be refreshed.  The parameter dependency can occur if you directly use a previous parameter in the dataset used to populate the parameter's valid value list or if a parameter contains code then it is assumed to be dependant on all previous parameters. 

     

    You may be running into the second problem, perhaps a re-ordering of your parameters will solve the problem.  If you just have a single date parameter, the entire page should not refresh when selecting a date (although you will see the IE status bar update due to the iframe being updated).

     

    -Daniel

    Monday, March 31, 2008 5:28 PM

All replies

  • The entire page should not post back when selecting a date time.  You will see the IE status bar because we are refreshing an iframe which contains the calendar.  Is this what you are seeing?

     

    There is no way to alter this behavior.  Is this causing some issue?  Perhaps there is a work around for the issue or something else we can look at.

     

    -Daniel

    Wednesday, March 26, 2008 10:41 PM
  • Hiya, thanks for getting back to me on this one!  Yes, it seems like the entire page refreshes whenever a click action is detected on a date change in the calendar Iframe. 

     

    We see a status bar ticking at the bottom of the IE browser window that looks like it is going back to the SSRS server to process the date change. It doesnt look like this is strictly a client side operation. If there is currently a report loaded in the report window and the user changes a date in the calendar control, the current report will disappear and go back to an empty report screen.  If there is no report loaded in the report window and the user changes a date in the calendar control, we still get the message it is contacting the SSRS server.

     

    It isnt causing a problem per sec....well it is, since Ive been asked to remove the calendar control which I dont want to have to do.  I like the built in validation and end user friendly interface it provides.  But we have very picky clients that dont want to see that web screen refresh happening everytime they change a date in the calendar.  Some of them have slower connections to the internet, so minor refreshes turn into a major thing for them.

     

    Do I need to just give up the good fight and not use the calendar?

     

    Thanks

     

    Thursday, March 27, 2008 5:15 PM
  • Hi,

     

    I thought I'd add to this post as I'm experiencing the same issue and it can be extremely frustrating. On some reports, the delay when changing parameters can be over 1 second. This doesn't seem like much, but when a user wants to change 4 dates, it gets to be very frustrating.

     

    Thanks

    Friday, March 28, 2008 7:10 PM
  • It sounds like you have dependant parameters setup.  When a parameter is dependant on a parameter that comes before it then the entire page will be refreshed.  The parameter dependency can occur if you directly use a previous parameter in the dataset used to populate the parameter's valid value list or if a parameter contains code then it is assumed to be dependant on all previous parameters. 

     

    You may be running into the second problem, perhaps a re-ordering of your parameters will solve the problem.  If you just have a single date parameter, the entire page should not refresh when selecting a date (although you will see the IE status bar update due to the iframe being updated).

     

    -Daniel

    Monday, March 31, 2008 5:28 PM
  • Thanks for the response Daniel. This was a big help. For others who are reading this thread, I thought I would add a bit of additional information.

    If you set default values for your date parameters using code in the reporting services parameter tool, replace it with a stored proc that performs the same calculations. eg I was previously defaulting a start date and end date to 30 days ago and yesterday (using the formulas: =DateAdd(DateInterval.Day, -30, Today) and =DateAdd(DateInterval.Day, -1, Today). I now reference a stored proc that generates the same values.

    I also had to move some parameters above the date parameters as these parameters used the report user id to determine default values.

    Monday, March 31, 2008 10:04 PM
  • Okay, just for giggles I deleted all the report parameters except for just one date field and I hardcoded all the parameter values that the datasets require (the datasets are calling stored procedures that take parameters).  Im still seeing the page send a request back to the web server every time I change a date in my one lone date parameter calendar control.  What is the IFrame trying to get from the web server?  With only this one report parameter defined on the report, any dependency issues should be eliminated, no?  Or am I possibly having some weird caching issue?  Is there a way to tell within the report definition what dependencies might still be hiding?  Thanks again for all your suggestions!

     

    Tuesday, April 1, 2008 8:42 PM
  • Yes, a request is sent back everytime you select a date (I stated that earlier).  However the whole page does not refresh if there are no dependant parameters.

     

    The request is just to ensure that the selected date falls into the middle of the calendar range on the client.  The iframe contains a 12 month calendar, where the selected date falls in the middle of that calendar.  The idea being, if you are going to change the date it will mostly likely be right around the current selected date and no refreshes will be needed while you are scrolling through the months.  When you finally select a date we refresh the iframe with a new year.  It is true that we may end up refreshing with the exact same months, we do not check on the client if the current calendar is sufficient or not.

     

    I hope that helps.

     

    -Daniel

     

    Wednesday, April 2, 2008 5:29 PM
  • I'm glad I'm not the only one with this issue.  This becomes a larger problem for me because my calendar is down the page a bit, toward the end of a long form.  When the refresh happens, it obviously reloads the page and positions you back at the TOP of the form.  Very ugly.

    Any new advice?  Anyone have any fancy smancy coding tricks, wrapping this thing somehow, something?  This is an awesome control for a user.  Beats trying to force them to type a correctly formatted date.
    Monday, April 7, 2008 5:54 PM
  • Has anyone come up with a solution to this?

     

    It is very annoying for the user when the browser does a complete refresh just because the date on the calendar gets changed.

     

     

     

     

    Friday, May 16, 2008 7:02 PM
  • Is there any solution to this problem. It is appearing in 2008 also .. It is annoying ..
    Wednesday, August 26, 2009 6:09 PM
  • For me this was resolved by disabling X-Content-Type-Options: nosniff custom header in the web.config.

    <customHeaders>
       <add name="X-Frame-Options" value="SAMEORIGIN" />
       <!-- 
       <add name="X-Content-Type-Options" value="nosniff" />
       THIS BREAKS SSRS REPORTS, causes clickable controls to immediately reload page
       -->
       <add name="X-XSS-Protection" value="1; mode=block" />
    </customHeaders>


    Wednesday, December 6, 2017 4:21 PM