In SSRS, a Date Time parameter on Preview is not matching the deployed report

  • In SSRS, a Date Time parameter on Preview is not matching the deployed report. Is this something someone else has encountered? The RDL code is identical. Is it the fact that, sometimes, a local preview is just a simulation of functionality? Is it because the display in preview sometimes uses cached data?

  • What do you mean by "not matching", different values? Perhaps the deployed report is using a different data source, and thus when the default value is calculated a different value is returned. Just a guess, as we've not got a lot to go on here I'm afraid.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Thom A - Sunday, February 10, 2019 10:08 AM

    What do you mean by "not matching", different values? Perhaps the deployed report is using a different data source, and thus when the default value is calculated a different value is returned. Just a guess, as we've not got a lot to go on here I'm afraid.

    I have a SSRS report that, when I preview it in Visual Studio locally, the date shows as 2/10/2019 but when the RDL code is deployed on the server, the date shows as 2/7/2019. The date time variable is based on a parameter on the report, called rundate, and it has a Default Value of 2/10/2019. So I think the same thing should happen on the Report Server that happens locally in preview mode.

    The report has four datasets and, as a test, I have set each four to have the SQL line that sets the rundate value like so: SET @rundate = '2019-02-10' but on the report server, when I load the report, it throws this error: Must declare the scalar variable "@rundate". Must declare the scalar variable "@rundate". It is in a cascading tabbed error message that looks like this: An error occurred during client rendering. An error has occurred during report processing. Query execution failed for dataset 'ThirdDataset. Must declare the scalar variable "@rundate". Must declare the scalar variable "@rundate".

    So, why does it run locally and not on the server? The "ThirdDataset" is a false name I have given here. The actual name is redacted. But, I have noticed that this would be the first dataset run if they are run alphabetically. So this leads me to the question: Why doesn't the report recognize this as a parameter and why does it complain that it is not declared?

    The reason why rundate is a parameter on the main page of the report is because I want the report to be a data driven report.  Now I am thinking this is not possible to test on the report server by just pulling up the page on the report server, even if I set a default value to "2/10/2019", it does not matter.  it seems that all that is ignored without the report being fired as a data driven report.

    So my next test will be to remove the Parameters on the main page and just have them on the sub-reports.

  • wm.m.thompson - Sunday, February 10, 2019 7:18 PM

    Thom A - Sunday, February 10, 2019 10:08 AM

    What do you mean by "not matching", different values? Perhaps the deployed report is using a different data source, and thus when the default value is calculated a different value is returned. Just a guess, as we've not got a lot to go on here I'm afraid.

    I have a SSRS report that, when I preview it in Visual Studio locally, the date shows as 2/10/2019 but when the RDL code is deployed on the server, the date shows as 2/7/2019. The date time variable is based on a parameter on the report, called rundate, and it has a Default Value of 2/10/2019. So I think the same thing should happen on the Report Server that happens locally in preview mode.

    The report has four datasets and, as a test, I have set each four to have the SQL line that sets the rundate value like so: SET @rundate = '2019-02-10' but on the report server, when I load the report, it throws this error: Must declare the scalar variable "@rundate". Must declare the scalar variable "@rundate". It is in a cascading tabbed error message that looks like this: An error occurred during client rendering. An error has occurred during report processing. Query execution failed for dataset 'ThirdDataset. Must declare the scalar variable "@rundate". Must declare the scalar variable "@rundate".

    So, why does it run locally and not on the server? The "ThirdDataset" is a false name I have given here. The actual name is redacted. But, I have noticed that this would be the first dataset run if they are run alphabetically. So this leads me to the question: Why doesn't the report recognize this as a parameter and why does it complain that it is not declared?

    The reason why rundate is a parameter on the main page of the report is because I want the report to be a data driven report.  Now I am thinking this is not possible to test on the report server by just pulling up the page on the report server, even if I set a default value to "2/10/2019", it does not matter.  it seems that all that is ignored without the report being fired as a data driven report.

    So my next test will be to remove the Parameters on the main page and just have them on the sub-reports.

    Sorry, but this is too much about your frustration and not enough about exactly how this report is configured.   You've given zero details nor any pictures of what one would see, so we have no idea and would just be making; at best; scientific wild-ass guesses.   You have to be anal about including details that easily demonstrate the nature of the problem.   Remember that we can't see your RDL, and for many good reasons, you may not be able to share it.   With such limitations, we need a LOT more detail...   Take the emotion out and go for the facts.

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)

  • Preview mode  uses cached data (in the same folder with report files but with .data extension)

    Four ways to address the "issue"

    1) refresh the page (doesn't help much),

    2) delete appropriate .data file,

    3) create  external tool which will delete all .data file on demand "menu Tools > External Tools.."

    https://stackoverflow.com/questions/18210078/why-is-my-ssrs-report-showing-old-data

    4) configure Visual Studio not to cache the data

    https://www.wiseowl.co.uk/blog/s313/data-cache.htm

     

     

     

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply