Discussion:
[jasperreports-questions] why JasperReport print very slowly?
fei xiao
2003-05-29 08:20:04 UTC
Permalink
....
JasperPrint jpr = JasperManager.fillReport(
JasperManager.compileReport(
"E:\\Work\\orderReport1.xml"
),
(HashMap)reportParam.clone(), ds);

dori.jasper.view.JasperViewer v = new JasperViewer(
jpr, false );
v.show();
....

I must say JasperReport is wonderful software!!! But
when print the document, the printer is very slow.
Through checking printer dialog, the document size is
about 200k, pause after per 8k and then go on, looks
like looking for something else to complete print. But
other document print faster, like Word document as the
same size, why?

My printer is HP Laserjet 6L Pro.

When I report to pdf file, like :
JasperManager.printReportToPdfFile (jpr,
"c:\\test.pdf");

error occur:
ExceptionConverter: java.io.IOException: The document
has no pages.
at
com.lowagie.text.pdf.PdfPages.writePageTree(Unknown
Source)
at com.lowagie.text.pdf.PdfWriter.close(Unknown
Source)
at com.lowagie.text.pdf.PdfDocument.close(Unknown
Source)
at com.lowagie.text.Document.close(Unknown Source)
at
dori.jasper.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:345)
at
dori.jasper.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:262)
at
dori.jasper.engine.JasperExportManager.exportReportToPdfFile(JasperExportManager.java:140)
at
dori.jasper.engine.JasperPrintManager.printReportToPdfFile(JasperPrintManager.java:118)
at
dori.jasper.engine.JasperManager.printReportToPdfFile(JasperManager.java:352)
at
com.lovebay.shop.gui.order.OrderBillPrintDlg.actionPerformed(OrderBillPrintDlg.java:94)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1450)

but c:\test.pdf is produced well! Why?

BTW, how can i change the name of the printing
document in printer dialog, the default name is "java
printing".



_________________________________________________________
Do You Yahoo!?
流连网络世界的“你”是谁?
http://cn.rd.yahoo.com/mail_cn/tag/?http://cn.surveys.yahoo.com/cn_user_profile_study_may2003
Mohammad Irfan
2003-06-03 08:27:07 UTC
Permalink
Hi.
I'd like to ask question. I'm using a barcode font and I want to use
relative path by passing the value through a class which compile the xml
file. Is there a way to do this? Now, I use absolute path, but it's not
convenient.
I tried to use $P{}, but it seems not functioning if I put it in a tag.
Please help.
thanx.

<font fontName="D:/project/webapps/bimbel/WEB-INF/lib/EAN-13.TTF"
pdfFontName="D:/project/webapps/bimbel/WEB-INF/lib/EAN-13.TTF" size="36"
isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="true"
pdfEncoding ="Cp1252" isStrikeThrough="false" />
Teodor Danciu
2003-06-03 12:16:05 UTC
Permalink
Hi,

You can place your TTF files in the classpath and reference them as
resources
using the "pdfFontName" attribute.
This attribute can also contain the resource location within the classpath
instead
of the absolute path to the font file.

The font should be installed on your system , beacuse the "fontName"
attribute
does not expect a filename, but rather a font family name. For example on
Windows,
installing a font is equivalent to copying the TTF file into the
Windows/fonts directory.
Then you use the font name in the "fontName" attribute, not the filename.

This is how the provied samples work. The TTF files are loaded from
classpath.

I hope this helps.
Teodor
Subject: [jasperreports-questions] Relative font path
Date: Tue, 3 Jun 2003 17:33:24 +0700 (WIT)
Hi.
I'd like to ask question. I'm using a barcode font and I want to use
relative path by passing the value through a class which compile the xml
file. Is there a way to do this? Now, I use absolute path, but it's not
convenient.
I tried to use $P{}, but it seems not functioning if I put it in a tag.
Please help.
thanx.
<font fontName="D:/project/webapps/bimbel/WEB-INF/lib/EAN-13.TTF"
pdfFontName="D:/project/webapps/bimbel/WEB-INF/lib/EAN-13.TTF" size="36"
isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="true"
pdfEncoding ="Cp1252" isStrikeThrough="false" />
-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
jasperreports-questions mailing list
https://lists.sourceforge.net/lists/listinfo/jasperreports-questions
_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail
Mohammad Irfan
2003-06-04 03:22:08 UTC
Permalink
When I compile the xml, I use this :

String appPath = TurbineResources.getString("webappRoot");
StringBuffer sb = new
StringBuffer().append(appPath).append("WEB-INF/lib/jasperreports.jar");
sb.append(":"+appPath).append("WEB-INF/classes");
-> (additional) sb.append(":"+appPath).append("WEB-INF/lib/EAN-13.TTF");
System.setProperty("jasper.reports.compile.class.path",sb.toString());


When I look into your fonts sample in the build.xml file, the fonts are
loaded when it call export to pdf. What should I put in the
System.setProperty since i didn't use build.xml file.

thanx.
Post by Teodor Danciu
Hi,
You can place your TTF files in the classpath and reference them as
resources
using the "pdfFontName" attribute.
This attribute can also contain the resource location within the classpath
instead
of the absolute path to the font file.
The font should be installed on your system , beacuse the "fontName"
attribute
does not expect a filename, but rather a font family name. For example on
Windows,
installing a font is equivalent to copying the TTF file into the
Windows/fonts directory.
Then you use the font name in the "fontName" attribute, not the filename.
This is how the provied samples work. The TTF files are loaded from
classpath.
I hope this helps.
Teodor
Subject: [jasperreports-questions] Relative font path
Date: Tue, 3 Jun 2003 17:33:24 +0700 (WIT)
Hi.
I'd like to ask question. I'm using a barcode font and I want to use
relative path by passing the value through a class which compile the xml
file. Is there a way to do this? Now, I use absolute path, but it's not
convenient.
I tried to use $P{}, but it seems not functioning if I put it in a tag.
Please help.
thanx.
<font fontName="D:/project/webapps/bimbel/WEB-INF/lib/EAN-13.TTF"
pdfFontName="D:/project/webapps/bimbel/WEB-INF/lib/EAN-13.TTF" size="36"
isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="true"
pdfEncoding ="Cp1252" isStrikeThrough="false" />
-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
jasperreports-questions mailing list
https://lists.sourceforge.net/lists/listinfo/jasperreports-questions
_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail
-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
jasperreports-questions mailing list
https://lists.sourceforge.net/lists/listinfo/jasperreports-questions
Teodor Danciu
2003-06-04 05:04:04 UTC
Permalink
Hi,

The TTF files have nothing to do with the report compilation process.
So putting them in the "jasper.reports.compile.class.path" system property
has no effect.

They are only used by the PDF exporter and they should be available in the
classpath
when exporting to PDF.

If I were you, I would put the TTF file in a directory called:
WEB-INF/classes/fonts

and reference it like this:

pdfFontName="fonts/EAN-13.TTF"

knowing that the WEB-INF/classes directory is always part of the web
application classpath.

I hope this helps.
Teodor
Subject: Re: [jasperreports-questions] Relative font path
Date: Wed, 4 Jun 2003 12:29:03 +0700 (WIT)
String appPath = TurbineResources.getString("webappRoot");
StringBuffer sb = new
StringBuffer().append(appPath).append("WEB-INF/lib/jasperreports.jar");
sb.append(":"+appPath).append("WEB-INF/classes");
-> (additional) sb.append(":"+appPath).append("WEB-INF/lib/EAN-13.TTF");
System.setProperty("jasper.reports.compile.class.path",sb.toString());
When I look into your fonts sample in the build.xml file, the fonts are
loaded when it call export to pdf. What should I put in the
System.setProperty since i didn't use build.xml file.
thanx.
Post by Teodor Danciu
Hi,
You can place your TTF files in the classpath and reference them as
resources
using the "pdfFontName" attribute.
This attribute can also contain the resource location within the
classpath
Post by Teodor Danciu
instead
of the absolute path to the font file.
The font should be installed on your system , beacuse the "fontName"
attribute
does not expect a filename, but rather a font family name. For example on
Windows,
installing a font is equivalent to copying the TTF file into the
Windows/fonts directory.
Then you use the font name in the "fontName" attribute, not the filename.
This is how the provied samples work. The TTF files are loaded from
classpath.
I hope this helps.
Teodor
Subject: [jasperreports-questions] Relative font path
Date: Tue, 3 Jun 2003 17:33:24 +0700 (WIT)
Hi.
I'd like to ask question. I'm using a barcode font and I want to use
relative path by passing the value through a class which compile the xml
file. Is there a way to do this? Now, I use absolute path, but it's not
convenient.
I tried to use $P{}, but it seems not functioning if I put it in a tag.
Please help.
thanx.
<font fontName="D:/project/webapps/bimbel/WEB-INF/lib/EAN-13.TTF"
pdfFontName="D:/project/webapps/bimbel/WEB-INF/lib/EAN-13.TTF" size="36"
isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded
="true"
Post by Teodor Danciu
pdfEncoding ="Cp1252" isStrikeThrough="false" />
-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
jasperreports-questions mailing list
https://lists.sourceforge.net/lists/listinfo/jasperreports-questions
_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail
-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
jasperreports-questions mailing list
https://lists.sourceforge.net/lists/listinfo/jasperreports-questions
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
jasperreports-questions mailing list
https://lists.sourceforge.net/lists/listinfo/jasperreports-questions
_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail

Loading...