Hi everybody

I want to use velocity to create a "let's say" table. Therefore I have a created a simple template.

================================================================================
ENGINE STATE
================================================================================
Jobname | Execution State | Duration --------------------------------------------------------------------------------
#foreach( $jobinfo in $infoList )
$jobinfo.localNameOfJobInXml | $jobinfo.executionState | $jobinfo.executionDuration
--------------------------------------------------------------------------------
#end
================================================================================

Everything allright so far, but now I want to align the strings. The inserted values for the variables in the template don't
have the same length. So the generated output looks like this

....
Jobname | Execution State | Duration --------------------------------------------------------------------------------
CheckDclStatusJob | EXECUTED_WITH_ERRORS | 00:00:00
--------------------------------------------------------------------------------
PcImportJob | NOT_EXECUTED_FAILED_DEPENDENCY | --:--:--
--------------------------------------------------------------------------------
OeImportJob | NOT_EXECUTED_FAILED_DEPENDENCY | --:--:--
--------------------------------------------------------------------------------
....

Looks like crap! Thats why I want to align the strings. Is there anything like String.format("%-20s",test) which reserves a number of columns of a String?


Output should be something like this

....
Jobname | Execution State | Duration --------------------------------------------------------------------------------
CheckDclStatusJob      | EXECUTED_WITH_ERRORS              | 00:00:00
--------------------------------------------------------------------------------
PcImportJob            | NOT_EXECUTED_FAILED_DEPENDENCY    | --:--:--
--------------------------------------------------------------------------------
OeImportJob            | NOT_EXECUTED_FAILED_DEPENDENCY    | --:--:--
--------------------------------------------------------------------------------
....


Thx for sugestions

--
B.Sc. Johannes Homuth

-------------------------------------------------------
SOURCEPARK GmbH
Helmholtzstr. 2-9, Gebäude M
10587 Berlin
Tel.:   +49 (0) 30 / 39 80 68 30
Fax:    +49 (0) 30 / 39 80 68 39
e-mail: [email protected]
www:    www.sourcepark.de
------------------------------------------------------
SOURCEPARK GmbH
Sitz der Gesellschaft: Berlin / Amtsgericht Charlottenburg
HRB 80254
Geschäftsführung: Matthias Barmeier, Harald Dürr
------------------------------------------------------


Diese Email kann vertrauliche und/oder rechtlich geschützte Informationen
enthalten. Wenn sie nicht der richtige Adressat sind oder diese E-Mail irr-
tümlich erhalten haben, informieren Sie bitte sofort diesen Absender und ver-
nichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte
Weitergabe dieser E-Mail ist nicht gestattet.




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to