è necessario visualizzare il numero di serie come lettere romane (i, ii, iii, iv ecc.) Nei report di cristallo. Ho il numero di serie catturato come numero di record (1,2,3,4 ...). Quindi cosa devo fare per questo nel report di cristallo.Visualizza numero di serie come lettere romane in Crystal Reports
6
A
risposta
1
Non riesco a prendere gran parte del merito; Ho semplicemente il porting del codice da this VB Helper article in cristallo, ma è stato un esercizio divertente:
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, "");
Basta sostituire il mio {[email protected]}
parametro segnaposto con la variabile, ed è tutto pronto.
1
Basta usare la funzione Roman() fornita da Crystal Report
Problemi correlati
- 1. Crystal Reports in MVC
- 2. in Crystal Reports VS2010
- 3. Crystal Reports campi incrociati
- 4. Tabelle pivot in Crystal Reports?
- 5. Crystal Reports localizzati
- 6. Come allineare le linee in Crystal Reports
- 7. Come inserire immagini dinamiche in Crystal Reports
- 8. Crystal Reports vs. SQL Query
- 9. banca dati con Crystal Reports
- 10. Crystal Reports nella distribuzione ClickOnce
- 11. VS2010 Crystal Reports: "Invalid Keycode"
- 12. Business Objects vs Crystal Reports
- 13. Qualcosa come Crystal Reports per PHP?
- 14. Nidificato anche se in Crystal Reports
- 15. Come ignorare i valori zero decimali in Crystal Reports
- 16. Allineamento verticale del testo in Crystal Reports?
- 17. Crystal Reports Assemblea distribuzione sul AppHarbor
- 18. Crystal Reports supporta immagini protette (HTTPS)
- 19. Anteprima Crystal Reports e Visual Studio 2013
- 20. Refresh Crystal Reports senza "Valori parametri" dialogo
- 21. Come allineare correttamente i campi numerici in Crystal Reports 2008?
- 22. Come posso ottenere Crystal Reports in VS 2012?
- 23. Un buon libro per Crystal Reports?
- 24. Assegnare più valori a un parametro in Crystal Reports
- 25. Problemi di esportazione di un file Excel da Crystal Reports
- 26. Come faccio a puntare Crystal Reports su un nuovo database
- 27. Crystal Reports Wrapping campo di testo dal set di dati
- 28. Cambia dinamicamente il percorso file XSD in Crystal Reports
- 29. Formula per sopprimere il campo se duplicato in Crystal Reports
- 30. Connessione di Crystal Reports a un server SQL