We store our date/time information in UTC format on our SQL Server.
When using SQL Reporting Services, we'd like to display this data in the time zone of the client workstation, but it appears that using an expression like;
System.TimeZone.CurrentTimeZone.ToLocalTime(Fields!DateStarted.Value)
... converts into the time zone of the server, not of the client workstation?
Is there any way of performing this conversion locally, or passing the local time zone to the server for conversion?
Thanks in advance
Matt
If your reports are standalone I can't see other option than add timezone report parameter.
But if you using reports inside web application, you can Determine Timezone from Request Variables with JavaScript and send time zone value back in hidden fields, urlparameter or postback.
You can also add timezone to user registration info (or figure it out from Country and City fields).
Also you may try Target Your Visitors Using GeoIP and .NET.
Related
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.
Shortly, is it possible to recover the report that was generated by SSRS when SMTP fails?
Sometimes we have network problems with SMTP and even the report was generated it couldn't be sent. We can send them manually later, but the problem is that most reports needs to be generated at a specific time, otherwise data my not be correct (for example, end of day reports needs to be generated at 12:00am, otherwise some updated numbers may not be correct. But we want to resend the report generated at 12:00am when we come to work in the morning)
I considered sending these reports though snapshots but some report subscriptions have parameters, and I couldn't find how to take snapshot for each subscription.
Any ideas?
Thanks in advance,
Onur
You could capture the data each day at 12am using a sql agent job which executes a stored procedure to populate a table/tables with the data.
If this is a report which can also be run live, you would run the report based on a hidden parameter #extract_type indicating whether or not this is live or snapshot. The default would be "live" and the subscription would pass "snapshot" for this parameter. The code in each dataset would filter based on #extract_type, perhaps through a view.
This way, the subscription could be re-run at any time of day with the same report results.
well, first you're not alone. i had issues with smtp errors in all places i worked.
there is a LastStatus column in [dbo].[Subscriptions] table. you can make a job that runs every few minutes, checks this table and restarts all subscriptions which have smtp errors.
like SQLDiver, i think it's a good idea to store the data behind reports in a table. it's not a job for a reporting tool to store your data.
I am wanting to create a one-time SSRS shared schedule that can be altered once run, to execute again at a future point in time. The reason I am having to set-up a subscription in this way is because I need to email a set of reports based on a bespoke accounting calendar; we don't have enterprise so data-driven is not an option.
I have tested this method in the ReportServer.dbo.Subscription and Schedule tables, but have so far not managed to get it to work. I have updated the NextRunTime and StartTime columns of the Schedule table to the time I require the reports to be sent, and this appears to update on the Report Server Shared Schedules page (Next Run) but the email does not send.
Is there another table on the ReportServer database that I need to update, or is this simply not possible?
Thanks
Andy
I suggest taking a look at the article below. It details how to set up data driven subscriptions on SQL Server Standard Edition, and goes through manually activating subscriptions via SQL Server Agent.
http://www.sqlservercentral.com/articles/Development/datadrivensubscriptions/2432/
I've used if for a couple of clients and it generally works pretty well. The only thing I've since altered is increasing the timer to 10 seconds between running each data driven report.
Regards,
Jason
In reading up on this, messing abound in the tables is not supported by Microsoft. USE AT YOUR OWN RISK!
I attempted the very same thing. When you change a subscription on the front end, the ReportServer.dbo.Schedule.StartDate column changes with each edit. I tried just altering this value, but adding a value here made no difference. There was no email and when I went back to my subscription in the SSRS webpage, the original datetime value was there. So that datetime must be stored elsewhere.
I did a SQL Trace and found these Sproc's were being called. I copied out the lines that looked promising. By changing the time value #active_start_time=160400 in the last one and running the entire batch, I could get an emailed report at the desired time. But I am not content with this; because when I go back and view My Subscriptions webpage, the original datetime is still listed.
exec msdb.dbo.sp_delete_job #job_name=N'D478A346-ED05-422D-A73E-023080AD56DD'
exec msdb.dbo.sp_add_job #job_name=N'D478A346-ED05-422D-A73E-023080AD56DD',#description=N'This job is owned by a report server process. Modifying this job could result in database incompatibilities. Use Report Manager or Management Studio to update this job.',#category_id=101
exec msdb.dbo.sp_add_jobserver #job_name=N'D478A346-ED05-422D-A73E-023080AD56DD',#server_name =N'(LOCAL)'
exec msdb.dbo.sp_add_jobstep #job_name=N'D478A346-ED05-422D-A73E-023080AD56DD',#step_name=N'D478A346-ED05-422D-A73E-023080AD56DD_step_1',#command=N'exec [ReportServer$instanceDB].dbo.AddEvent #EventType=''TimedSubscription'', #EventData=''db7d7b08-3eee-4bb8-b354-b58c653b8ab6'''
exec msdb.dbo.sp_add_jobschedule #job_name=N'D478A346-ED05-422D-A73E-023080AD56DD',#name=N'Schedule_1',#freq_type=1,#active_start_date=20180405,#active_start_time=160400,#freq_subday_type=1
I have a SQL Server 2008 database with an Access front-end. My problem is that Access does not recognise SQL Server's dates as they are in a different format.
SQL Server-s format is YYYY-MM-DD
Access' format is DD-MM-YYYY
When the date is displayed in a text-box, it is displayed as a string (without the little calendar icon next to it).
Is there anyway I can configure my Access front-end so that it recognises SQL Server's dates?
Cheers.
If you are storing the dates in SQL server as the data type “Date” or “Date2” try changing them to “DateTime” I had this problem linking data from SQL server 2008R2 to access 97, access did not see it as a date and treated it like text
The Microsoft SQL Server Migration Assistant for Access does move the dates over as a Date format. The problem the user has encountered is with a Driver. Microsoft has a new DLL that must be put on a client workstation (or server in the case of Citrix).
Once that is done, all the dates in MS Access will work properly.
My lastest experience with Access 2010 was exactly the same as Access 2003. It required a DLL.
From there, investigate using a DNS-Less connection string.
I just ran in to this, thanks everyone for your input.
I'm also developing an Access UI for a SQL Server backend (Access 2010/SQL Server 2014) and just encountered this problem. The Date datatype takes 3 bytes of storage, and since I didn't need a time component, that's what I wanted. Personally I'm using SmallDateTime, it takes 4 bytes compared to DateTime's 8. There's also DateTime2 that takes 6-8 bytes.
I created a four field table using each of the date datatypes to experiment with input formats, I think SmallDateTime will do the trick for me.
I have my application working fully on my development machine and storing data all okay on a SQL 2008 database, how every when I deploy the application to my server, which is running SQL 2008, and the model is stored in the database the date fields do not accept an English date format.
e.g.
13/08/2009
fails
Sounds like you are running with a different culture on the machine you have deployed to, where that date format (US) is not valid. First place to look is the culture set in the Windows Control panel.
If you can't change the machine settings in ASP.NET you can do this through the Web.config file.
CodeProject has an article describing one way to do this for Windows forms.