SSRS reports based on Getdate() function - reporting-services

I developed a report using the getdaye() function in the query. The report runs fine on SQL management Studio.
I created a report using the SQL server data tool and the report is based on the query that I wrote in SQL studio. I have established a connection using the data source and am able to connect to the SQL database. When I run the report using the tool after a couple of days the report data is different from the data that I get when I run the query using SQL management studio. Obviously the Getdate() is not fetching the right date.
The report data maches only when I copy and paste the query in the SQL server data tool and then run the report.
Am I doing anything wrong or should I use create a parameter for the date and direct the default values = Now() on the sql server data tool.
Is there any other work around for this.
Hem

I guess that did not publish the report to a Report Server but repeat to preview the result in Visual Studio (SSDT). SSDT caches data to improve the experience in SSDT and retrieves data from the database only when needed. "Needed" means that you either change the query or choose different parameters. You could of course pass a parameter to the database server, but if you don't want that, you will have to clear the cache from time to time. Look into the folder where the report is saved and delete the *.data file with the same name as the report. You can make this task very easy by adding a menu command to the tools menu as described here.

Related

Some columns in report are not showing data on SSRS server

Please Help
I'm using SQL Server 2008 R2 and SSRS to develop a report. I've created a stored procedure on the server and I am accessing it through the report. Within SSMS, the stored procedure runs and returns data just fine. Also, within Visual Studio I run the debug version of the report and it outputs data just fine.
The problem arises when I deploy the report and try to run it in the web portal. It runs without any errors and displays the report header, but there is no data in 2 columns out of 7 ! I've tried creating a new report accessing the same stored procedure and the same thing happens. What could cause this?
A few possibilities;
The SPROC does not returns this data now and the report is only working in design view because it is using cached data (you can verify this by deleting the .data files in the report file directory and seeing if it stops working in design view)
You have a Shared Datasource configured which points to a different server/database on the report server than it does in Visual Studio, in that other server/database the sproc doesn't have data for those columns

Can I see which stored procedures are used in SSRS

Is there any way to see the tables and stored procedures used in SSRS Report.
Thanks
There not an easy way that I know of. As far as I know, you would need to check the Dataset of the report and check the query tab for the SQL query of the stored procedure.
If you want to check the code, the query is in the XML < CommandText> tag.
This if you don't have access to the project:
If the report is deployed, go to Report Manager Site download the RDL file of the report and open it in visual studio. Open datasets and you can visualize the actual queries.

Reporting services error trying to access a object that isn't called in the report

have a strange one. We are running Sql Server 11.0.3000. The report is giving an error
An error has occurred during report processing. (rsProcessingAborted)
Query execution failed for dataset 'Audit_Detail'. (rsErrorExecutingCommand)
Invalid object name 'dbAudit.tblRangeReport'.
The thing is, the report uses 3 stored procs to go after data in a database called dbSalarySurvey. The three sp's do not mention the dbAudit.tblRangeReport. There are no functions or views in the 3 sp's that access that table. Further more, if i run the report in VS 2012 the report runs. If i run profiler on the dbAudit table when VS runs the report, the report does not query the dbAudit table. Only when running the report from the web browser do i get this error. This more detailed version of the error come from running the report on the Sql Server REporting services computer.
I have tried restarting the reporting services service. We have also deleted this one report from the reporting services server and republished it. Have also tried to republish the dataset. Other reports in this project that use the datasource and the same tables run.
Anyway, was wondering if anyone had any sugguestions.
Thanks
shannon
It's fixed. it was a pebkak error in the stored proc. It's really strange though. Honest to goodness, the proc was running in my dev env but not when running from a browser. I had already checked profiler like was suggested below and done the xml scan too. In the end.. just missed it i guess.
You need to trace the SQL to determine.
Are you connecting to the right database?
Are the procs you expecting to see, the ones actually being run?
The procs you are running are correct?
Open SQL Server Profiler
Start New Trace
Click Event Selection, Select the following events
Click - Show All columns
Go into Column Filters
and filter on your DB, and possibly even your login name (the login name of the SSRS server)
Once you've done that, call your report and look to make sure all the procs are called that you expect. Track issues from there.

SQL Server Reporting Services (SSRS)

I am new to SSRS. I use SSRS to access a remote data source. I can use the interface shown below to build and execute queries and produce reports:
Is there a way to build a report by specifying the SQL directly rather than using the graphical tools. I have spent some time Googling this and I have gone through a few tutorials. I am unable to find an answer.
Click the Edit as Text button in the top left-hand corner of that window and have at it.
Edit If you are only seeing XML in the query window, then you are using a Report Model data source instead of a direct database connection. Models cannot be queried directly with SQL.
In order to query with SQL, setup a Data Source using a connection string that points directly your database.

Does Microsoft SQL Report Builder require Reporting Services running at all?

I'm having trouble figuring this out.
I stopped ALL of local SQL Services, e.g. SQL Server, SQL Agent, Reporting Services. Then using Report Builder 2.0 to create a report connecting to a remote SQL Server (No SSRS running) out in the farm. When I click on "Run" button, for some odd reasons, it still render the report.
I thought you must have SSRS running in the first place. Is SQL Reporting Services even required for Report Builder?
Img
alt text http://www.freeimagehosting.net/image.php?0bf8bb1f1d.jpg
When Reporting Services runs a report, it creates a data file of the data used in the report and, if nothing changes, it uses that data the next time the report runs instead of hitting the server again. You could be seeing the cached data.
Look where the report is kept. There will be a report file, say MyReport.rdl and also the data, MyReport.rdl.data. You could delete that data file otherwise simply changing the report parameters (if you have some) will generally cause the report to disregard the cached data and make a trip to the server again.
I'm answering my own question. Here's my observation after some googling and experimenting.
Report Builder is using a stand alone report control to render report. Visual Studio.NET is probably using the same thing when preview a report. SSRS is required when developers need to incorporate web-based reporting solution, e.g. ASP.NET, as well as to manage reports.
What's really bothering me is that to author reports in VS.NET, I must be using Business Intelligence Projects. In order to do that, I must install SQL Server 2005/2008 with SSRS. Why is so when SSRS is not even required in a LOCAL environment?