![](http://content.invisioncic.com/i328763/set_resources_3/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
ge0ffrey
-
Posts
65 -
Joined
-
Last visited
Content Type
Forum
Downloads
Featured Visualizations
Knowledge Base
Documentation (PDF Downloads)
Blog
Documentation (Test Area)
Documentation
Dr. Jaspersoft Webinar Series
Security Advisories
Events
Profiles
Posts posted by ge0ffrey
-
-
Let's say I have this resultset as a datasource:
A-1 B-1 1 A-1 B-2 20 A-2 B-1 300 A-2 B-2 400 and I want this report:
Total 4321 * B-1 301 * B-2 4020 A-1 * 21 A-1 B-1 1 A-1 B-2 20 A-2 * 4300 A-2 B-1 300 A-2 B-2 400 How can I do that?
I can create a <variable> grandTotal for the total, that is easy.
I can create a <group> for the A's and a <variable> groupATotal (for line A-1/* and A-2/*)
I can show these lines directly: A-1/B-1, A-1/B-2, A-2/B-1, A-2/B-2
But how do I show the lines */B-1 and */B-2? Is there some way to create a variable that is a list or map itself?
Making a subreport for those is not really valid option, because in reality this nesting goes up to A's holds B's holds C's hold D's and there are many of each of those. A subreport would create a lot n+1 query problems.
-
The webpage
http://jasperforge.org/website/jasperreportswebsite/trunk/config.reference.html?group_id=252
has this text:
net.sf.jasperreports.jdk.glyph.fix.text.measurer.catch.empty.stakctrace
which has a typo "stakctrace", so it should be:
net.sf.jasperreports.jdk.glyph.fix.text.measurer.catch.empty.stacktrace
-
I've got a group which has a header to reprint on each page,
but I don't want to have an anchor for each page. I want an anchor only for the first page of each group.
Is that possible?
Here's my code:
<group name="a" isReprintHeaderOnEachPage="true">
...
<groupHeader>
<band height="50"><textField bookmarkLevel="1">
...
<textFieldExpression class="java.lang.String">$F{b}</textFieldExpression>
<anchorNameExpression>$F{b}</anchorNameExpression>
</textField>I've tried inserting dummy groups with an empty textfield with an anchor, but that anchor simply doesn't show.
-
Wil it, as well as the javaflow version be released on the central maven repository?
More and more projects (spring, hibernate, seam, ...) are starting to release with high quality pom.xml files which makes our lives easier :)
-
Are you using a JDBC driver that supports JDBC 4.0 (so scrollable iteration)?
-
You can pass in the current page as subreport parameter (though that will only be the first page of that subreport...)
But you can't pass in the total number of pages in a subreport => I miss this feature too :)
-
I prefer using URL's:
<subreportExpression class="java.net.URL">
getClass().getResource("/net/sf/myproject/myreport.jasper")</>
-
Declare your font as such:
Code:
<style name="myName" fontName="Times New Roman" pdfFontName="Times-Roman" ... /> -
Does the <template> tag support isUsingCache?
The documentation at
doesn't mention <template> tag.
I've create a very low priority issue to support precompiling jrtx files out of the box:
-
in the jrxml:
Code:
<parameter name="myColor" class="java.lang.String" />
...
<textFieldExpression class="java.lang.String">$P{myColor}</textFieldExpression>in your java code:
Code: [code]Map<String, Object> myMap = new HashMap<String, Object>();
myMap.put("myColor", "FF0000"«»);
...
JasperManager...fill(myJasperReport, myMap, ...); -
I have the exact same problem.
I am making a subreport called themeFooter which I use in all my reports in the pageFooter section. I can pass it the current page, but not the total number of pages of the main report.
-
Actually the jasperreports-maven-plugin puts your dependencies on the classpath automatically and you shouldn't hack it by adding them as plugin dependencies (this causes other issues).
The only problem is that there's a bug in the implementation:
http://jira.codehaus.org/browse/MOJO-1141
-
-
I did it like this:
Code:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jasperreports-maven-plugin</artifactId>
<version>1.0-beta-1</version>
<executions>
<execution>
<goals>
<goal>compile-reports</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>3.0.0</version>
</dependency>
</dependencies>
</plugin>
Though I have another issue with the plugin that I 'll probably make a patch for. -
I made a mistake in how to register the font, it should be:
Code: InputStream in = getClass().getResourceAsStream(ttfResource);
Font font = Font.createFont(Font.TRUETYPE_FONT, in);
GraphicsEnvironment.getLocalGraphicsEnvironment().registerFont(font);
in.close();The line still is missing though I 've used the exact same font in pdf as in jasperviewer, see the screenshot in the issue.
-
Even when using the exact same font, lines still disappear:
I took the liberty of making an issue:
http://jasperforge.org/sf/go/artf3235?nav=1
When trying to use an external font, AWT doesn't recognize the ttf format:
java.lang.IllegalArgumentException: font format not recognized
Code: Font font = Font.createFont(12,
getClass().getResourceAsStream("/jasperpoc/font/LiberationSans-Regular.ttf"«»));
GraphicsEnvironment.getLocalGraphicsEnvironment().registerFont(font); -
That Map is for report parameters.
One of the entry's in that report parameters Map can be the JRDataSource, but you can also provide it explicitly.
Take a look at the javabean datasource example in the examples.
-
I figured that embedding the font into pdf should solve my issue with the lines disappearing:
Code: <style name="text" fontName="Times New Roman" fontSize="12" isPdfEmbedded="true" pdfEncoding="Cp1252">
but it doesn't. What could explain the lines disappearing?
-
Are there any good libraries of open source ttf files which we can distribute in the classpath of our application?
-
Yes, it's possible:
Code: JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
If you use the ServletResponse's outputstream (after setting it to binary and mime type pdf) it should work.
-
Is there any way to do this platform independend?
My software needs to run at least on linux (Red Hat, CentOs, Ubuntu) and Windows (XP, Vista).
I don't really care which font ttf is used exactly, but I 'd like to furfill these requirements:
[/ul]
Is there anything that could explain why I only lose that line when I am using padding?
The PDF now doesn't show the line, probably because it has 1 pixel height to few to show it. Is it possible to force the PDF exporter to show as much of the line as possible anyway?
-
If I drop the pdfFontName attribute, it's definitly no longer Times New Roman in the pdf, so the default awt2pdf font mapping isn't correct (is there such a mapping out of the box?)?
If I do set the pdfFontName attribute, it turns out that awt "Times New Roman" doesn't match pdf "Times-Roman" as I lose a line.
-
It happens only in PDF, not in the JasperViewer apparently.
I've just added this to my PDFExporter
Code: exporter.setParameter(JRPdfExporterParameter.FORCE_LINEBREAK_POLICY, Boolean.TRUE);
but that doesn't solve the problem.
According to the FAQ it could be because the PDF font doesn't match the AWT font.
I declared the fonts as such:
Code: [code]<style name="base" isBlankWhenNull="true"
fontName="Times New Roman" fontSize="12" pdfFontName="Times-Roman">
<box padding="2"/>
</style>
<style name="text" style="base" isDefault="true">
</style>
<style name="textEmphasis" style="base"
isItalic="true" pdfFontName="Times-Italic">
</style>
<style name="textStrongEmphasis" style="base"
isBold="true" pdfFontName="Times-Bold">
</style>But those definitly don't match.
Removing all pdfFontName attributes (and relying on the default awt2pdf font mapping, which I 'd like to do) doesn't solve it either.
Thanks for the help :)
-
Any particular reason you're not using the facade?
Code: Take a look at the source code of that facade, it probably uses the same class as you do, but the right way :)
How to pass multiple collections thru JRDATASOURCE
in Products
Posted