需要在我的水晶報表中顯示序列號爲羅馬字母(i,ii,iii,iv等)。我的序列號被記錄爲記錄號(1,2,3,4 ...),所以我必須在晶體報告中爲它做這件事。在水晶報表中以羅馬字母顯示序列號
6
A
回答
1
我不能接受很多信用;我簡單地移植的代碼this VB Helper article成水晶,但它是一個有趣的練習:
NumberVar iCounter := 0;
Local StringVar ch := "";
Local NumberVar result := 0;
Local NumberVar new_value := 0;
Local NumberVar old_value := 0;
Local StringVar temp := "";
temp := UpperCase({[email protected]});
old_value = 1000;
For iCounter := 1 To Len(temp) do
(
// See what the next character is worth.
ch := Mid(temp, iCounter, 1);
if ch = "I" then new_value := 1
else if ch = "V" then new_value := 5
else if ch = "X" then new_value := 10
else if ch = "L" then new_value := 50
else if ch = "C" then new_value := 100
else if ch = "D" then new_value := 500
else if ch = "M" then new_value := 1000;
// See if this character is bigger
// than the previous one.
If new_value > old_value Then
// The new value > the previous one.
// Add this value to the result
// and subtract the previous one twice.
result := result + new_value - 2 * old_value
Else
// The new value <= the previous one.
// Add it to the result.
result := result + new_value;
old_value := new_value;
);
// Format the number without commas or decimals
ToText(result, 0, "");
只需用您的變量替換我{[email protected]}
參數佔位符,你所有的設置。
1
只需使用Crystal Report提供的Roman()函數
相關問題
- 1. 水晶報表不顯示在水晶報表查看器WPF
- 2. ASP.NET水晶報表 - 顯示25列
- 3. 在水晶報表中顯示空格
- 4. 水晶報表序列字段
- 5. 只顯示水晶報表中的最後一個序列
- 6. 水晶報表 - 在陣列
- 7. 在水晶報表中顯示數據在列
- 8. 在報表查看器中顯示水晶報表控件
- 9. 在水晶報告中顯示消息
- 10. 字母數字排序的水晶報表
- 11. 在水晶報表中顯示兩列產品的總和?
- 12. 要在水晶報表中顯示的新字段
- 13. 顯示水晶報表有條件
- 14. 水晶報表行沒有顯示
- 15. 水晶報表不顯示從查詢
- 16. 提取/從水晶報表顯示SQL
- 17. 水晶報表未顯示使用Asp.net
- 18. 如何從GridView顯示水晶報表?
- 19. 水晶報表顯示記錄
- 20. 部署後不顯示水晶報表
- 21. 確定是否水晶報表顯示
- 22. 顯示水晶報表沒有分頁
- 23. 水晶報表顯示空白圖像
- 24. 水晶報表顯示的條件
- 25. 記錄在子報表不會顯示在水晶報表
- 26. 以羅馬數字顯示日期
- 27. 水晶報表列問題
- 28. 水晶報表隱藏列
- 29. 水晶報表
- 30. 如何在水晶報表中製作項目符號列表?