SSRS date format in Excel with localization - excel

I'm trying to export a SQL Server 2008 R2 Reporting Services report to Excel. The report has a column of dates. The date is stored as a datetime in the SQL server.
The language of the report is set to =User!Language, the format of the date-cell is d.
When exporting/rendering the report to PDF, everything is displayed in the locale of the request made by the browser (Accept-Language).
When rendering to Excel however, the format suddenly changes, for example, to General ([$-10409]M.T.JJJJ) (German Excel, locale of the OS set to de-AT, browser-locale is en-US).
This means that the Excel displays dates in a completely wrong format - the sequence of day, month and year is hardcoded and only the separator comes from the current locale. This makes sharing reports between different OS languages almost impossible since a report generated from a d-m-yyyy country will still display as day-month-year in a country with different date formatting (and vice versa). So any person expecting a m/d/yyyy formatted date will get d/m/yyyy.
This is especially dangerous if there are no dates with days above 12 - ie: it is very likely to misread the displayed date because there is no obvious error.
When manually setting the cell-format in Excel to date, everything seems fine and the format changes with the locale of the OS.
Is there any possibility to force the cell to be formatted as Date in Excel without having to edit the Excel file itself?
P.S: numbers are also not formatted as a number but as [$-10409]#.##0,00;-#.##0,00 - which is less of an issue but still potentially a source of errors. (format in the report is N2)

I've manages to solve similiar issue. Solution is rather simple.
In report editor, open Design view and select field, which you want to edit, right mouse click and choosee either Expression or Textbox properties. The rest is very intuitive as in Excel editor.

Related

Export Salesforce dates in a way that Excel Mac can use

I am exporting reports as XLS files from Salesforce. These reports have dates that I want to be able to manipulate in Excel but... Excel doesn't recognize them as dates.
The format outputted by Salesforce right now is m/d/yyyy (ie: 8/18/2022). When I go in Excel and change the format to date... the data is not recognized as a date.
It seems the only thing that Excel can consume are dates configured as yyyy-mm-dd.
I tried to play with Excel formatting date form with no luck.Excel doesn't recognize the Salesforce format, or does not propose anything similar to it
Is there a setting in Salesforce or in Excel that I need to adjust so that both apps can generate, and digest the same date configs?
I want to run these reports weekly so whatever requires the less Excel gymnastic will be the best solution (Google Docs for instance recognize dates as Salesforce spits them... - but I can't use GDocs at work).
You should use PowerQuery to import the data to Excel.
In PowerQuery change the Column-Type USING LOCAL
Select Date and English (United States)
Voila!

Excel Online - creating table changes date display to decimal

Once I create table in Excel Online
I get some side effect which is change of date display to decimal value:
To reverse this effect manually I just have to change current date format to anything else, then go back to the first one. Nothing really changes that way but date display gets back to normal.
The thing is I want to avoid this situation.
Any idea how to deal with this phenomena? Is it some bug or maybe it can be dealt with some office settings?
I was not able to replicate your problem with office365.
Setting the whole column to a specific date format before generating the table keep the formatting to the generated table.
Set specific date format:

Excel 2007: Editing a date value deletes the date format

In an Excel 2007 spreadsheet when I edit a date value the date format of the cell is deleted and I cannot re-apply it with the toolbar options, format > format cells > number > date.
Prior to editing the date value the cell is displayed in the formula bar as 2017/07/15 (for example) but after an edit it displays as ^2017/07/26.
The onset of the problem was sudden and it affects all my Excel 2007 spreadsheets, old and newly created.
I have Goggled the problem and posted a question in MS Forums but without result.
Any help would be appreciated.
Additional Information - Update Oct 3
I have found a January 6, 2016 Stack Overflow question about Excel 2013 date format changes caused by editing and one of the answers seems to be relevant to my question. The cells I am attempting to edit have typed (non-formula) dates in them.
Quote from Date Format changes when editing a cell in Excel 2013
Answer by Jeeped
… When you edit a cell with a typed (non-formula) date, you are editing the Range.Formula property which in this case is the same as the Range.Value property. The displayed (formatted) date is the Range.Text property. The Range.Formula is the same as that which is seen in the formula bar and the stored format for a typed date is taken from the computer system's regional Short Date setting. The Range.Text property is subject to a formatting mask that changes the way the Range.Value is displayed. Consider it an overlay of the actual value; e.g. if you want to change something, change the something, not a picture of the something.
If you were allowed to edit the displayed text, you would never be able to edit a formula because the values being edited would always be the formula's result (formatted appropriately) and not the formula itself.
If this is really mission critical or just obsessively annoying, change your computer system's Short Date to dd-mm-yyyy and Excel will use that as the base Range.Formula property.
End of quote
This quote gives links to the Microsoft Dev Center ,
https://msdn.microsoft.com/VBA/Excel-VBA/articles/range-formula-property-excel
I am a basic user of Excel and assuming the above information can be used to solve my editing problem then my problem now becomes how do I use this information?
It is less pressing, but I am also curious about why an editing feature I had been using for a long time suddenly stopped working.
Problem Fixed – Update Oct 20
#a-burge: Thanks for taking an interest in this problem but I have fixed the problem so I am answering my own question.
I use Windows 7 Ultimate SP1 and Microsoft Office 2007 SP3 which have always been updated automatically through Windows 7 > start > control panel > windows update.
The sequence of selections, Windows 7 > start > control panel > region and language, leads to a page with tabs that include a "formats" tab and a "location" tab. Under the former the language setting was "English (New Zealand)" and under the latter the location setting was "New Zealand".
The problem was fixed by changing the language setting to "English (United States)". The location setting was left unchanged.
This fixes the problem but I do not understand how a language setting in the control panel of Windows 7 can have the effect it does on editing a date in an Excel 2007 spreadsheet?
I think a family member who also uses the computer must have changed the language setting which would account for the sudden onset of the problem and its simple solution.
This is not the first time I have had a problem caused by a language setting in a Microsoft product. In Word 2007 the autocorrect option that I use to expand abbreviations when writing may suddenly stop working. This is caused by the variant of English changing from one part of the document to another. The solution is Word 2007 > select all > set language but that may need to be repeated several times in one document depending on the editing.
These problems raise the question of why Microsoft provides 16 variants of English in Windows 7 when the differences between them are trivial. It even provides English(Australia) and English(New Zealand) and English(United Kingdom) which is an absurd level of redundancy.

Libre Office 4.1.3.2: Import dates from text file, recognize right format

I am struggling with the different cell formatting types in Libre Office - I am aware of the manually adjustable Date formatting, but cant get Libre Office to recognise an input text string like:
" Wednesday, December 11, 2013   13:27"
where everything between the quotes is the cell content. Obviously I want the software to recognize, that this is a date and thus make a graph out of a large table, but using a manual formatter like:
" NNNN, MMMM D, YYYY HH:MM"
does not result in what I want, ie. the cell accepts my manual format but still cant cope with the content. What am I doing wrong? - any tips how I can nevertheless produce a graph with x-values with dates in this format? I dont want to awk around and manually convert these strings each time I have such a table...
Thanks a lot!
Be aware that during the import process you have a chance to set the date format during this import routine in Librecalc. Find this and use it.
I found that the fix must come while opening a CSV file to avoid being down the rabbit hole of errors and frustrations.
The preview of data on open is interactive. Who knew? :o
Do this:
Open
Select columns with dates in the preview
Change setting from Standard to Date in the dropdown

SSRS 2008 R2- Format Parameter to DD/MM/YYYY

I have SSRS 2008 R2 and am working on reports for the UK.
My report has a Date/Time data type parameter. When user opens the report the default date format is MM/DD/YYYY, but I would like to have DD/MM/YYYY format (same if user pick date from Calender drop-down date selection).
I have changed the Language settings on the reports to UK and it formats the dates within the dataset, not the parameter. I have also tried using a cdate expression but that does not work either.
One work around is just changing it to nvarchar in my SQL code however, I have a few scripts that use a > #eomdate so the nvarchar will not work in that case.
Any ideas?
Please see this post on the MSDN forums. The calendar drop down and the date format of the parameter's text box are dependent on the user's Language settings in their browser, not on the report.
If you want to force users to have the same displayed dates, you'll have to use a text field formatted as you want and then use CDate() in your code to turn that varchar into a date for performing time comparisons.
This is what I did to resolve the issue in the SQL Code to get it to work in SSRS as a hack.
declare #eomdate varchar(50)
set #eomdate = '31/01/2013'
select * from policiesEOM p
where p.eomdate >= convert(datetime, #eomdate, 105)
Then I changed the datatype to Text and it works perfectly.
The ssrs date type use the browser language in Google Chrome, Mozilla Firefox, Opera and Safari. In Edge too. IE use the windows regional date format.
If you don't want to use date drop box, you can use a text parameter and convert the value to date with ssrs built in convertion function.

Resources