I solved my problem, and I am posting the findings here for future
reference.

Assuming you have reached the point where you are able to retrieve and
display Unicode with dbforms, the next step is getting it to work with
jasper reports.
1) Look at the bookstore/howto/howtoPrintaJasperReport.jsp  sample code
2) use the WEB-INF/web.xml and WEB-INF/reports/book.xml as a template
for your project

3) copy book.xml to WEB-INF/reports/city.xml ('city' is the table I'm
using). 

change <jasperReport name="city" ...> to match the name used on your jsp
page

update <queryString>,<field> and <textFieldExpression> settings.

use a <font> setting like this.
<font fontName="Angsana New" pdfFontName="c:\fonts\ANGSA.TTF"  size="12"
isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded
="true" pdfEncoding ="Identity-H" isStrikeThrough="false" />

Note: c:\fonts\ANGSA.TTF is a Thai Language Font. Find another font for
your languge. Double click on the TTF file to see the "fontName". You
must set isPdfEmbedded="true". pdfEncoding ="Identity-H" was the
trickiest part, I'm not sure what "Identity-H" means...but it works (UTF
and Cp1252 did NOT work).

4) jsp page
<db:gotoButton  caption="print all" destTable="city" 
singleRow="false" destination="/reports/city"  />

5) web.xml
<servlet>
    <servlet-name>startreport</servlet-name>
 
<servlet-class>org.dbforms.servlets.StartReportServlet</servlet-class>
    <init-param>
      <param-name>reportdirs</param-name>
 
<param-value>/WEB-INF/custom/reports/,/WEB-INF/reports/</param-value>
    </init-param>
  </servlet>
<servlet-mapping>
    <servlet-name>startreport</servlet-name>
    <url-pattern>/reports/*</url-pattern>
  </servlet-mapping>

6) use a <font> setting like this.
<font fontName="Angsana New" pdfFontName="c:\fonts\ANGSA.TTF"  size="12"
isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded
="true" pdfEncoding ="Identity-H" isStrikeThrough="false" />

Note: c:\fonts\ANGSA.TTF is a Thai Language Font. Find another font for
your languge. Double click on the TTF file to see the "fontName". You
must set isPdfEmbedded="true". pdfEncoding ="Identity-H" was the
trickiest part, I'm not sure what "Identity-H" means...but it works (UTF
and Cp1252 did NOT work).

Hope this helps someone.

Neal

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Shawn
Sent: Tuesday, March 16, 2004 12:43 PM
To: neal
Cc: dbf interest
Subject: Re: [dbforms] dbforms and jasperreports

On Tue, 16 Mar 2004 10:43:36 +0700, neal <[EMAIL PROTECTED]> wrote:

> I am trying to generate a PDF file using dbforms and jasperreports
> (0.5.0)  that contains UTF8 strings (in this case Thai). Currently I
> only see "?" for Thai characters.
>
Are your Thai characters coming through fine in the dbforms pages.  I am

not using jasperReports just yet so can't help with that.  First things 
first though, are your Thai characters coming through fine in the
dbforms 
pages

If not, I use:
<[EMAIL PROTECTED] contentType="text/html;charset=Shift_JIS"%>
on all my pages (Thai food is better that Japanese food by the way, um
set 
the charset to the appropriate one for Thai).

And then I need to use the SetCharsetEncodingFilter that comes with
Tomcat 
(I think that is where I got it).  Let me know if you need it or need to

know how to configure it.

<rest of message on using UTF8 with jasper reports deleted, please see 
original message about that part if you can help>
-- 
Shawn

Happily using M2, Opera's revolutionary e-mail client: 
http://www.opera.com/m2/


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
DbForms Mailing List

http://www.wap-force.net/dbforms



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
DbForms Mailing List

http://www.wap-force.net/dbforms

Reply via email to