Formatting a Report (Reporting Services)
Format the Date
The Date field displays date and time information by default. You can format it to display only the date.
To format a date field
-
Click the Design tab.
-
Right-click the cell with the
[Date]
field expression and then click Text Box Properties. -
Click Number, and then in the Category field, select Date.
-
In the Type box, select January 31, 2000.
-
Click OK.
Format the Currency
The LineTotal field displays a general number. Format it to display the number as currency.
To format a currency field
-
Right-click the cell with the
[LineTotal]
field expression and then click Text Box Properties. -
Click Number, and in the Category field, select Currency.
-
If your regional setting is English (United States), the defaults should be:
- Decimal places: 2
- Negative numbers: ($12345.00)
- Symbol: $ English (United States)
-
Select Use 1000 separator (,).
If the sample text is: $12,345.00, then your settings are correct.
-
Click OK.
Change Text Style and Column Widths
You can also change the formatting of the header row to differentiate it from the rows of data in the report. Lastly, you will adjust the widths of the columns.
To format header rows and table columns
-
Click the table so that column and row handles appear above and next to the table.
The gray bars along the top and side of the table are the column and row handles.
-
Point to the line between column handles so that the cursor changes into a double arrow. Drag the columns to the size you want.
-
Select the row containing column header labels and from the Format menu, point to Font and then click Bold.
-
To preview your report, click the Preview tab. It should look something like this:
Format Number
=Format(CLng(Fields!MyField.Value),"###,###,###,##0")
To solve this problem we can set =Fields!MyField.Value as the Value and set ="###,###,###,##0" as the Format. You can find the "Format" under the "Appearance" of the properties window.
====================
just to clarify a little, to the way shown above:
1. right click a table cell or textbox
2. select expression
3. enter what frank suggested
the other way:
1. select a table cell or textbox
2. hit F4 (for properties)
3. in Format property type in yyyy/MM/dd HH:mm
====================
want to see my date in American format (MM/DD/YYYY) not uk (DD/MM/YYYY).
After adding "English United Kingdom" the Language Setting of the Client Browser, it is displaying date format in UK Format.
====================
Working with Dates in Reporting Services
Command | Result |
FormatDateTime(Parameters!Date.Value,1) | Tuesday, April 10, 2007 |
FormatDateTime(Parameters!Date.Value,2) | 4/10/2007 |
FormatDateTime(Parameters!Date.Value,3) | 12:00:00 AM |
FormatDateTime(Parameters!Date.Value,4) | 00:00 |
...but the better way to do it would be to use ...
2) The Format command and specify the exact format you require. For example...
Command | Result |
Format(Parameters!Date.Value,"dd-MM-yyyy") | 10-04-2007 |
Format(Parameters!Date.Value,"dd/MM/yyyy") | 10/04/2007 |
Format(Parameters!Date.Value,"MMM-dd-yyyy") | Apr-10-2007 |
Format(Parameters!Date.Value,"MMM-dd-yy") | Apr-10-07 |
So 3 M's give you "Apr" ....anyway this is quite useful if you're looking for Day/Month/Year , since the system will default to MM/DD/YYYY.
Using this you should be able to display the date format you want , or send through a particular format to a Stored Proc.
EDITED 22/08/2007 : If the Format Command doesn't work , try converting the value to a date , eg.
Format(Cdate(Parameters!Date.Value),"dd-MM-yyyy") |
====================
REF:
From: http://www.pcreview.co.uk/forums/thread-3624228.php
From: http://msdn.microsoft.com/en-us/library/cc627538.aspx
http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SQL-Server-2005/Q_22691763.html
http://forums.asp.net/p/1322727/2636885.aspx#2636885
http://www.ssw.com.au/Ssw/Standards/Rules/RulesToBetterSQLReportingServices.aspx
http://geekswithblogs.net/naijacoder/archive/2008/06/26/123422.aspx
http://www.aspose.com/community/forums/thread/164222/date-format-issues.aspx
http://thavash.spaces.live.com/blog/cns!CF6232111374DFD2!155.entry
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY