müssen Seriennummern wie römische Buchstaben (i, ii, iii, iv usw.) in meinen Crystal Reports anzeigen. Ich habe die Seriennummer als Record Nummer (1,2,3,4 ...) erfasst, also was ich dafür im Crystal Report machen muss.Seriennummer als lateinische Buchstaben in Crystal Reports anzeigen
6
A
Antwort
1
Ich kann nicht viel von dem Kredit nehmen; Ich portierte einfach den Code aus this VB Helper article in Kristall, aber es war eine nette Übung:
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, "");
einfach meinen {[email protected]}
Parameter Platzhalter durch Ihre Variable ersetzen, und Sie sind alle gesetzt.
1
Verwenden Sie einfach die Funktion Roman(), die von Crystal Report
bereitgestellt wirdVerwandte Themen
- 1. Anzeigen von Crystal Reports-Formularabstürzen in Build
- 2. Bild in Crystal Reports mit URL anzeigen
- 3. Crystal Reports als Bild exportieren
- 4. Crystal Reports
- 5. Crystal Reports Optionaler Parameter
- 6. Lokalisierte Crystal Reports
- 7. Auto Refresh Crystal Reports
- 8. Hochgestellt in Crystal reports Formel
- 9. Legen Sie Berichtsfeld Wert in Crystal Reports
- 10. Crystal Reports-Parameter ändern
- 11. Crystal Reports - inkonsistente Formatierung
- 12. crystal reports Bild zerquetscht
- 13. Crystal Reports-Bericht - Kopfunterdrücken
- 14. Crystal Reports Datumsfunktionen
- 15. Crystal Reports-Datenquellendiagramm verschwindet
- 16. Crystal Reports DateTime-Formatierung
- 17. Crystal Reports-Konfigurationstool
- 18. Crystal Reports-Datenbankverbindungsprobleme
- 19. Crystal Reports Summieren
- 20. Crystal Reports + Asp.net 2.0
- 21. Crystal Reports: Sumarize Formelfeld
- 22. Crystal Reports Layout
- 23. Crystal Reports Framework
- 24. Crystal Reports Css-Klasse
- 25. Crystal Reports Crosstab Hervorhebung
- 26. Pivot-Tabellen in Crystal Reports?
- 27. mehrere Gruppen in Crystal Reports
- 28. Vertikale Textausrichtung in Crystal Reports?
- 29. XML-Dataset in Crystal Reports
- 30. Crystal Reports Formel in Textobjekt