2016-08-09 53 views
2

我想要一個簡單的公式,它將兩個值連在一起,並用em-dash分隔開。該公式將讀取類似如下:在報告中顯示em-dash

{?PeriodFrom} & #em-dash-character# & {?PeriodTo} 

很顯然,我只是想破折號字符兩個週期值之間出現。如何才能做到這一點?

+0

我要補充...我試過沒有成功的'CHRW()'函數。我認爲複雜性可能是'em-dash'是一個Unicode字符? – cartbeforehorse

+1

發現此:在任何處理文本的軟件程序中,em短劃線都可以在增強型鍵盤上鍵入爲Alt + 0151,即按住「alternate」鍵並鍵入,使用右側的數字鍵盤鍵盤,數字0151_。 [here](http://www.getitwriteonline.com/archive/091502enem.htm)你可以從Word複製/粘貼到你的報告嗎? – Beth

+0

@Beth我在Crystal Reports中測試了這一點。它似乎工作!儘管生成的角色看起來與水平欄字符相同。 – 4444

回答

0

您可以使用 - U+2015 Horizontal Bar

enter image description here

需要使用一個公式來進行。如果你創建一個文本對象實際上你可以拖動
{?PeriodFrom}{?PeriodTo}到文本框中粘貼它們之間的單槓:

enter image description here

只要記住,你必須拖動參數字段爲
文本框中。手動鍵入「{?PeriodFrom}」將不起作用。

+1

你說得對。無需過度使用公式。我仍然在學習Crystal。感謝您的教訓:-) – cartbeforehorse

+0

不用擔心,我一直在使用它多年,我仍在學習!他們在寫Crystal時做了一些有趣的選擇。 – 4444

0

也發現了這個:

Four ways to insert an em dash in a Word document 
The easiest way to enter an em dash (—) is to let Word do it. Simply enter two hyphen characters between the two words you want to connect, and Word will turn the hyphens into an em dash. If this doesn't work for you, one of two possibilities exist: 
• You've inserted space characters between the words and the hyphen characters. When you enter spaces between the hyphens, Word formats the hyphens as an en dash (–), which is shorter than an em dash. 
• Someone has disabled the AutoCorrect option that formats hyphens as an em dash. 
Now, this default won't work for everyone every single time. If you occasionally need two hyphens instead of an em dash, you can press [Ctrl]+Z and Word willundo the em dash character and restore the hyphens. If you find yourself doing this a lot, it might be more efficient to disable the AutoCorrect option and enter an em dash, when you require it, manually. You can disable this option as follows: 
1. From the Tools menu, choose AutoCorrect Options. 
2. Click the AutoFormat As You Type tab. 
3. Uncheck the Hyphens (—) With (—) option. 
4. Click OK. 
After disabling the AutoCorrect option, you'll have to enter an em dash manually. Fortunately, there are three easy methods: 
• Press [Ctrl]+[Alt]+-. You must use the minus sign (-) on the numeric keypad; if you use the hyphen character on the alphanumeric keypad, Word will change the cursor. 
• Hold down the [Alt] key and type 0151 on the numeric keypad. 
• Choose Symbol from the Insert menu, click the Special Characters tab, highlight the em dash, and click Insert. 

formatted nicely here

+0

沒有冒犯,但問題不是如何在Word中產生一個m-dash。 – cartbeforehorse

+0

不,但如果您可以在Word中創建它,則可以將其粘貼到Crystal – Beth

+0

如果需要,我也可以從HTML頁面複製它。問題不是「我怎麼把剪貼板放在剪貼板裏?」。我已經接受了4444的答案。 – cartbeforehorse