在 SSRS 报告中显示上标

发布于 2024-11-15 04:55:21 字数 142 浏览 5 评论 0 原文

我正在研究 SSRS 2008。 我想将日期显示为 2011 年 1 月 1 日。 但“st”应该在上标中.. 不像“第一”。

有没有办法在 superscipt 中显示“st”、“nd”、“rd”和“th”而无需安装任何自定义字体类型(其他字体类型)。

I m working on SSRS 2008.
i want to display date as 1st January 2011..
but "st" should be in superscipt ..
not like "1st".

is there any way to display "st", "nd","rd" and "th" in superscipt without installing any custom font type(other Font Type).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

書生途 2024-11-22 04:55:21

只需从以下列表中复制并粘贴:

ABC⁰ 1 2 3 ⁴ ⁵ ⁶ ⁷ ⁸ ⁹ ⁺ ⁻ ⁼ ⁽ ⁾
ABC₀ ₁ 2 ₃ ₄ ₅ ₆ ₇ ₈ ₉ ₊ ₋ ₌ ₍ ₎

ABCᵃ ᵇ ᶜ ᵈ ᵉ ᶠ ᵍ ʰ ⁱ ʲ ᵏ ˡ ᵐ ⁿ ᵒ ᵖ ʳ ˢ ᵗ ᵘ ᵛ ʷ ˣ ʸ ᶻ

ABCᴬ ᴮ ᴰ ᴱ ᴳ ᴴ ᴵ ᴶ ᴷ ᴸ ᴹ ᴺ ᴼ ᴾ ᴿ ᵀ ᵁ ᵂ

ABCₐ ₑ ᵢ ₒ ᵣ ᵤ ᵥ ₓ

ABC½ ¼ 3/4 ⅓ ⅔ ⅕ ⅖ ⅗ ⅘ ⅙ ⅚ ⅛ ⅜ ⅝ ⅞ № ℠ ™ © ®

ABC^ ± ¶

just copy and paste from the following list:

ABC⁰ ¹ ² ³ ⁴ ⁵ ⁶ ⁷ ⁸ ⁹ ⁺ ⁻ ⁼ ⁽ ⁾
ABC₀ ₁ ₂ ₃ ₄ ₅ ₆ ₇ ₈ ₉ ₊ ₋ ₌ ₍ ₎

ABCᵃ ᵇ ᶜ ᵈ ᵉ ᶠ ᵍ ʰ ⁱ ʲ ᵏ ˡ ᵐ ⁿ ᵒ ᵖ ʳ ˢ ᵗ ᵘ ᵛ ʷ ˣ ʸ ᶻ

ABCᴬ ᴮ ᴰ ᴱ ᴳ ᴴ ᴵ ᴶ ᴷ ᴸ ᴹ ᴺ ᴼ ᴾ ᴿ ᵀ ᵁ ᵂ

ABCₐ ₑ ᵢ ₒ ᵣ ᵤ ᵥ ₓ

ABC½ ¼ ¾ ⅓ ⅔ ⅕ ⅖ ⅗ ⅘ ⅙ ⅚ ⅛ ⅜ ⅝ ⅞ № ℠ ™ © ®

ABC^ ± ¶

所有深爱都是秘密 2024-11-22 04:55:21

也许...

您只能使用 String.Format。字体大小和间距也指整个文本框。所以它不是“原生”

但是, superscript is unicode 所以你也许可以这样做它带有一些连接字符的奇特表达式。我建议自定义代码。

我还没有尝试过这个,但是这些文章提到了它

Maybe...

You are limited to what can be done with String.Format. Font size and spacing also refer to the whole text box. So it isn't "native"

However, superscript is unicode so you may be able to to do it with some fancy expression that concatenate characters. I'd suggest custom code.

I haven't tried this, but these articles mention it

茶底世界 2024-11-22 04:55:21

我不是在这里寻找功劳,因为上面的解决方案已经为您解答了,但为了初学者的缘故,我在报告中使用了代码函数。

所以在我的 SQL 中说我有 Number 字段,然后我添加一个新字段 OrdinalNumber:

SELECT ..., Number, 
       CASE WHEN (Number % 100) BETWEEN 10 AND 20 THEN 4
            WHEN (Number % 10) = 1 THEN 1
            WHEN (Number % 10) = 2 THEN 2
            WHEN (Number % 10) = 3 THEN 3
            ELSE 4 END AS OrdinalNumber,
...

然后我的代码函数:

Function OrdinalText(ByVal OrdinalNumber As Integer) As String
    Dim result As String
    Select Case OrdinalNumber
        Case 1
            result = "ˢᵗ"
        Case 2
            result = "ⁿᵈ"
        Case 3
            result = "ʳᵈ"
        Case Else
            result = "ᵗʰ"
    End Select
Return result

End Function

然后在报告文本框中我使用表达式:

=CStr(Fields!Number.Value) & Code.OrdinalText(Fields!OrdinalNumber.Value)

I am not looking for credit here as above solution has answered it for you but for beginners sake, I use a code function within my report.

So in my SQL say I have Number field, then I add a new field OrdinalNumber:

SELECT ..., Number, 
       CASE WHEN (Number % 100) BETWEEN 10 AND 20 THEN 4
            WHEN (Number % 10) = 1 THEN 1
            WHEN (Number % 10) = 2 THEN 2
            WHEN (Number % 10) = 3 THEN 3
            ELSE 4 END AS OrdinalNumber,
...

Then my code function:

Function OrdinalText(ByVal OrdinalNumber As Integer) As String
    Dim result As String
    Select Case OrdinalNumber
        Case 1
            result = "ˢᵗ"
        Case 2
            result = "ⁿᵈ"
        Case 3
            result = "ʳᵈ"
        Case Else
            result = "ᵗʰ"
    End Select
Return result

End Function

Then in the report textbox I use the expression:

=CStr(Fields!Number.Value) & Code.OrdinalText(Fields!OrdinalNumber.Value)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文