"John Dunn" <jd...@sefas.com> writes:

> Where?...I can't see anywhere to change it....

You can change the display format of a date field as one of the
properties of that field in the report, or by manually formatting the
field when constructing a string field.

For simple date/time fields, use the Pattern property to select from
one of the predefined patterns.  You can also manually type in a
pattern using the appropriate letter codes.

For more elaborate formatting, you can make the field a String field,
and then use String.Format with date/time formatting codes.

For example, I have a title field defined as a string that uses:

    String.format('%tA, %<tB %<te', $F{class_date}) + ",  " +
    String.format('%tl:%<tM %<tp', $F{start_time}) + " - " +
    String.format('%tl:%<tM %<tp', $F{end_time})

where class_date is a database date field, and start_time/end_time are
database time fields.

(Note that I think the above syntax may require a groovy Report interpreter,
 so if using Java you probably need some new() calls or something)

which produces an output like:

    Monday, August 31, 9:30 am - 10:20 am


I don't think the above should be database-specific.  The JDBC
interface to the database should be returning date/time fields in an
appropriate java object, so once it's on the iReport side any of the
formatting should be possible.

-- David


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
jasperreports-questions mailing list
jasperreports-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jasperreports-questions

Reply via email to