Report UI for Vaadin Framework 8

This was the question of number of records - if I take just 30 records report is made in a sec.

i am getting error while using your component
MY ENV > Vaadin 8 with Java 8

java.lang.NoSuchMethodError: net.sf.jasperreports.engine.base.JRBaseStyle.setFontSize(Ljava/lang/Float;)V
at ar.com.fdvs.dj.domain.Style.setJRBaseStyleProperties(Style.java:279)
at ar.com.fdvs.dj.domain.Style.transform(Style.java:232)
at ar.com.fdvs.dj.core.layout.AbstractLayoutManager.addStyleToDesign(AbstractLayoutManager.java:296)
at ar.com.fdvs.dj.core.layout.AbstractLayoutManager.applyStyleToElement(AbstractLayoutManager.java:586)
at ar.com.fdvs.dj.core.layout.AbstractLayoutManager.generateHeaderBand(AbstractLayoutManager.java:521)
at ar.com.fdvs.dj.core.layout.ClassicLayoutManager.generateHeaderBand(ClassicLayoutManager.java:1275)
at ar.com.fdvs.dj.core.layout.ClassicLayoutManager.startLayout(ClassicLayoutManager.java:120)
at ar.com.fdvs.dj.core.layout.AbstractLayoutManager.applyLayout(AbstractLayoutManager.java:152)
at ar.com.fdvs.dj.core.DynamicJasperHelper.generateJasperReport(DynamicJasperHelper.java:529)
at ar.com.fdvs.dj.core.DynamicJasperHelper.generateJasperReport(DynamicJasperHelper.java:504)
at ar.com.fdvs.dj.core.DynamicJasperHelper.generateJasperPrint(DynamicJasperHelper.java:241)
at ar.com.fdvs.dj.core.DynamicJasperHelper.generateJasperPrint(DynamicJasperHelper.java:218)
at org.vaadin.reports.PrintPreviewReport.buildJasperPrint(PrintPreviewReport.java:240)
at org.vaadin.reports.PrintPreviewReport.setItems(PrintPreviewReport.java:103)

Does anybody succeеd to use some other fonts? for example I need cyrillic but I couldn’t “import” it in report

Hello Alejandro,

I am trying to compile the report-ui in my project but it fails to compile my project. Following error is displayed:
I am using Vaadin 10 for my project.

* What went wrong:
Could not resolve all files for configuration ':compileClasspath'.
> Could not resolve org.vaadin.reports:report-ui:2.0.
  Required by:
      project :
   > Could not resolve org.vaadin.reports:report-ui:2.0.
      > Could not parse POM http://maven.vaadin.com/vaadin-addons/org/vaadin/reports/report-ui/2.0/report-ui-2.0.pom
         > Could not find com.vaadin:vaadin-bom:10.0.0.beta10.

I would really like to try the report-ui for my project. Can you please rectify the vaadin version in pom.xml and re-release?

Regards,
Deepak

Deepak Chainani:
Hello Alejandro,

I would really like to try the report-ui for my project. Can you please rectify the vaadin version in pom.xml and re-release?

Thanks for reporting this issue. Version 2.0.1 should work with Vaadin 12.0.3. Cheers.

Hi Alejandro,

I am using report-Ui add-on 1.1 version in my application, when I am downloading Pdf format it’s not getting download and other format like xls, docx, xml etc. I am able to download. what may be the root cause ? can you please help me.

If any other guys have any idea, your most welcome.
Thanks in advance.

Vishwanath Patel:
Hi Alejandro,

I am using report-Ui add-on 1.1 version in my application, when I am downloading Pdf format it’s not getting download and other format like xls, docx, xml etc. I am able to download. what may be the root cause ? can you please help me.

If any other guys have any idea, your most welcome.
Thanks in advance.

Hi,

Can you provide more details? A reduced test case to reproduce the issue and any relevant logs would help.

Alejandro Duarte:

Vishwanath Patel:
Hi Alejandro,

I am using report-Ui add-on 1.1 version in my application, when I am downloading Pdf format it’s not getting download and other format like xls, docx, xml etc. I am able to download. what may be the root cause ? can you please help me.

If any other guys have any idea, your most welcome.
Thanks in advance.

Hi,

Can you provide more details? A reduced test case to reproduce the issue and any relevant logs would help.

Alejandro, I am getting following error while downloading pdf report.

ava.lang.NoSuchFieldError: APPDEFAULT
at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:717)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:537)
at org.vaadin.reports.PrintPreviewReport.getStream(PrintPreviewReport.java:212)
at org.vaadin.reports.PrintPreviewReport.getPdfStream(PrintPreviewReport.java:174)
at org.vaadin.reports.PrintPreviewReport.lambda$downloadPdfOnClick$17bdf362$1(PrintPreviewReport.java:121)
at com.vaadin.server.StreamResource.getStream(StreamResource.java:143)
at com.vaadin.server.FileDownloader.handleConnectorRequest(FileDownloader.java:167)
at com.vaadin.server.ConnectorResourceHandler.handleRequest(ConnectorResourceHandler.java:90)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1601)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:445)

I am using following maven dependency

	<dependency>
		<groupId>org.vaadin.reports</groupId>
		<artifactId>report-ui</artifactId>
		<version>1.1</version>
	</dependency>
	
	<dependency>
		<groupId>org.apache.poi</groupId>
		<artifactId>poi-ooxml</artifactId>
		<version>3.10-FINAL</version>
	</dependency>

I am using below code snippet.

Button pdf = new Button(“Pdf”);
report.downloadPdfOnClick(pdf, “call-report.pdf”, itemsSupplier);

According to Google :wink: it seems like a conflict with iText versions but I cannot reproduce the issue. If you can provide a reduced test case, I could have a look.

“JasperReport requires the use of the iText.jar version to upgrade to iText-2.1.7.jar it”

Alejandro Duarte:
According to Google :wink: it seems like a conflict with iText versions but I cannot reproduce the issue. If you can provide a reduced test case, I could have a look.

“JasperReport requires the use of the iText.jar version to upgrade to iText-2.1.7.jar it”

Thanks a lot Alejandro, iText dependency version was the conflict. Now it’s working fine.
Thank you again.

Hi Alejandro Duarte,

could you please provide code snippet for adding multiple sub-reports.

If any one have any idea, your most welcome. Thanks in advance.

Vishwanath Patel:
could you please provide code snippet for adding multiple sub-reports.

I don’t have any atm. Please check [DynamicJasper’s documentation]
(http://dynamicjasper.com/documentation-examples/). They have a bunch of examples there.

Alejandro Duarte:

Vishwanath Patel:
could you please provide code snippet for adding multiple sub-reports.

I don’t have any atm. Please check [DynamicJasper’s documentation]
(http://dynamicjasper.com/documentation-examples/). They have a bunch of examples there.

Alejandro Duarte, You mean to say that, if I want to generate sub reports than I have to use dynamic Jasper right.

Report UI uses DynamicJasper. So you can use it to do anything that the library allows you to do.

If I have an entity that contains a list of objects such as Addresses how can I show the attributes of that object such as “City” or “ZipCode”.

Michael Messenger:
If I have an entity that contains a list of objects such as Addresses how can I show the attributes of that object such as “City” or “ZipCode”.

I would probably have a DTO for that. You can check DynamicJasper documentation to see if there’s a way to do that though: http://dynamicjasper.com/documentation-examples.

With Vaadin 8 and Java 11 I got this error

java.lang.RuntimeException: net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
1. java.lang.Boolean cannot be resolved to a type
                value = new java.lang.Boolean(((Number)((java.lang.Integer)variable_PAGE_NUMBER.getValue())).doubleValue() == 1); //$JR_EXPR_ID=8$
                            <--------------->
2. java.lang.Boolean cannot be resolved to a type
                value = new java.lang.Boolean(((Number)((java.lang.Integer)variable_REPORT_COUNT.getValue())).doubleValue() % 2 == 0); //$JR_EXPR_ID=12$
                            <--------------->
3. java.lang.Boolean cannot be resolved to a type
                value = new java.lang.Boolean(((Number)((java.lang.Integer)variable_PAGE_NUMBER.getOldValue())).doubleValue() == 1); //$JR_EXPR_ID=8$
                            <--------------->
4. java.lang.Boolean cannot be resolved to a type
                value = new java.lang.Boolean(((Number)((java.lang.Integer)variable_REPORT_COUNT.getOldValue())).doubleValue() % 2 == 0); //$JR_EXPR_ID=12$
                            <--------------->
5. java.lang.Boolean cannot be resolved to a type
                value = new java.lang.Boolean(((Number)((java.lang.Integer)variable_PAGE_NUMBER.getEstimatedValue())).doubleValue() == 1); //$JR_EXPR_ID=8$
                            <--------------->
6. java.lang.Boolean cannot be resolved to a type
                value = new java.lang.Boolean(((Number)((java.lang.Integer)variable_REPORT_COUNT.getEstimatedValue())).doubleValue() % 2 == 0); //$JR_EXPR_ID=12$
                            <--------------->
6 errors
.
	at org.vaadin.reports.PrintPreviewReport.setItems(PrintPreviewReport.java:116)

Is this problem from java 11?

But more likely the problem is this

        <dependency>
           <groupId>org.eclipse.jdt.core.compiler</groupId>
           <artifactId>ecj</artifactId>
           <version>4.6.1</version>
        </dependency>

Without it got this error:

[ERROR]
 Failed to execute goal com.vaadin:vaadin-maven-plugin:8.8.3:compile (default) on project prati: Command [[
[ERROR]
 /bin/sh -c '/usr/lib/jvm/java-11-oracle/bin/java' '-Xmx1G' '-Dgwt.persistentunitcache=false' 'com.google.gwt.dev.Compiler'

How to avoid it since I need ecj for google map add-on?

I have done it but with 5.1.2 version of DynamicJasper, export to xls doesn’t work

java.lang.NoSuchMethodError: org.apache.poi.hssf.util.HSSFColor.getTripletHash()Ljava/util/Map;
	at net.sf.jasperreports.engine.export.JRXlsExporter.<clinit>(JRXlsExporter.java:157)
	at org.vaadin.reports.PrintPreviewReport.buildXlsExporter(PrintPreviewReport.java:254)
	at org.vaadin.reports.PrintPreviewReport.getXlsStream(PrintPreviewReport.java:178)
	at org.vaadin.reports.PrintPreviewReport.lambda$downloadXlsOnClick$17bdf362$1(PrintPreviewReport.java:125)
	at com.vaadin.server.StreamResource.getStream(StreamResource.java:143)
	at com.vaadin.server.FileDownloader.handleConnectorRequest(FileDownloader.java:167)
	at com.vaadin.server.ConnectorResourceHandler.handleRequest(ConnectorResourceHandler.java:90)
	at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1602)
	at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:445)
[WARNING]
 /APP/connector/0/165/dl/istorija_TEST+GB451.xlsx

any ideas?

Hi all there!
How can I use custom fonts to create a report?
What I use:

  • Intellij IDEA for development;
  • Vaadin 14.0.5;
  • Jetty 9.4.8.v20171121 for test;
  • Wildfly 10.1.0.Final for mass use;
    How is the project build:
mvn
install (for testing on Jetty)
package -Pproduction (for Wildfly)

What I tried
First try:

  1. Create .JAR file with TIBCO Jaspersoft Studio 6.6.0;
  2. Build project (clean package -Pproduction);
  3. Put it in target/*[project]
    */WEB-INF/lib;
  4. Build project (install -Pproduction);
    This way I manage to place the JAR file in the lib folder of the .war file. But it doesn’t work.

Second try:
Put fonts and necessary settings files in the /recourses/ folder without packing them in a JAR.
This works when building a project using a mvn install and launch in Jetty only.
When I tried build it using a mvn clean package -Pproduction this does not work.

Third try:
I tried to create dependencies pointing to a JAR file but this also does not work

What can you advise for successfully connecting my own fonts?