jasper-reports

How to export HTML text with embedded images (base64, data uri) using the htmlcomponent?

拈花ヽ惹草 提交于 2020-01-20 08:30:30
问题 We have HTML from database, and we would like to create a Word report with this HTML. This HTML comes from users, and may contain only formatted text (bold, italic...), or text + embedded image encoded in base64 way. Example: <b>My photo :</b> <img src="data:image/png;base64,iVBORw0K... " /> We know that with textField , markup="html" , it does not work with img html tags. With Jasper Studio 6.3.1, we tried with <hc:html/> , it works with image on the hard drive, but it won't work with

Error retrieving field value from bean

半世苍凉 提交于 2020-01-19 17:35:48
问题 I have a problem I'm trying to generate a report from java using JasperReports but i get an error. public void init() throws JRException { list= ef.comisionReporte(); JRBeanCollectionDataSource beanCollectionDataSource = new JRBeanCollectionDataSource(list); String reportPath = FacesContext.getCurrentInstance().getExternalContext().getRealPath("report2.jasper"); jasperPrint = JasperFillManager.fillReport(reportPath, new HashMap(), beanCollectionDataSource); } public void PDF() throws

Error retrieving field value from bean

匆匆过客 提交于 2020-01-19 17:35:09
问题 I have a problem I'm trying to generate a report from java using JasperReports but i get an error. public void init() throws JRException { list= ef.comisionReporte(); JRBeanCollectionDataSource beanCollectionDataSource = new JRBeanCollectionDataSource(list); String reportPath = FacesContext.getCurrentInstance().getExternalContext().getRealPath("report2.jasper"); jasperPrint = JasperFillManager.fillReport(reportPath, new HashMap(), beanCollectionDataSource); } public void PDF() throws

Json array as comma separated values using JSONQL in JRXML

拟墨画扇 提交于 2020-01-16 13:58:28
问题 We have input json to jrxml as { "ID": "5c2c7662f256a1452b0ed8b2", "MarketData": { "markets": [ { "id": "1001", "name": "val1" }, { "id": "1002", "name": "Val2" }, { "id": "1003", "name": "val3" } ], "products": [ {"id": "1001", "proname": "shoe"}, {"id": "1002", "name": "bag"}, {"id": "1003", "name": "cap"} ], "location":"ABC" } } We have json that contains list of values of markets, products . We need to show values from this json as Location : ABC Markets : val1,Val2,val3 Products Sold:

JASPER REPORT: Subreport nightmare, datasource is List

夙愿已清 提交于 2020-01-16 11:09:57
问题 Cannot view main report with subreport... Main Java Class public class SubRepoExample { public static void main(String[] args) throws JRException { SubRepoExample repo = new SubRepoExample(); repo.combineMasterAndSubreport(); } public void combineMasterAndSubreport() throws JRException{ JasperReport main = JasperCompileManager.compileReport("src/subrepoexample/masterReport.jrxml"); JasperReport sub = JasperCompileManager.compileReport("src/subrepoexample/subReport.jrxml"); //create a list for

How to get jasperreport file (.JRXML) exact location to load to the system?

半世苍凉 提交于 2020-01-16 06:27:44
问题 I trying to load jasper report (.jrxml) that i created, i named the report "JREmp1.xml". but i got this error "HTTP Status 500 - Request processing failed; nested exception is net.sf.jasperreports.engine.JRException: java.io.FileNotFoundException: D:\printpdf.metadata.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\JasperExample\jasper\JREmp1.jrxml (The system cannot find the path specified)" how to got the exact location? here is my JREmp1.xml file location : and here is code in my

Font 'Trebuchet MS' is not available to the JVM

半城伤御伤魂 提交于 2020-01-16 05:43:46
问题 I am using ubuntu OS for ireport pdf generation.The exception is Trebuchet MS not found by jvm.I have not installed msfont package in ubuntu.when i added external font in (option->font) to ireport tool then it is compiling and generating pdf But when i am generating through java code it is throwing exception.I added the ttf font jar to class path but still the exception is coming.Is jvm depends on font pkg installed in OS as Trebuchet MS is windows font which is not installed in my OS. Thanks

Jasperreport CSV UTF-8 without BOM instead of UTF-8

时光毁灭记忆、已成空白 提交于 2020-01-16 04:45:10
问题 I try to export a CSV file with JasperReport, the problem is when I want to print currency like '€'. When I search for solution, I realized that it's about file encoding! I write this code! //JasperPrint is already filled HttpServletResponse httpServletResponse = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse(); httpServletResponse.setContentType("application/csv; charset="+Charset.forName("utf-8").displayName()); httpServletResponse

JasperReport table column sum for page

别来无恙 提交于 2020-01-16 04:32:08
问题 I need TO add a column sum to column footer of table object for each page. If I create variable and set sum aggregation function than sum value appear for full report. But I need sum column data for each page, not for full report. Can anyone help me solve this problem? 回答1: This is not a solution for the jr:table component since it uses a subdataset where its not allowed to set resetType="Page" , but using a subreport it can be used. I don't think there is a work around in components (jr

java.lang.ClassNotFoundException: org.apache.commons.collections.map.ReferenceMap

早过忘川 提交于 2020-01-16 01:53:08
问题 I'm using jdk7, netbeans8, jasperreport5.6.0 and libraries : jasperreport5.6.0.jar, commons-logging-1.1.2.jar, commons-beanutils-1.9.2.jar, commons-digester3-3.2.jar, commons-collections4-4.0.jar, itext-2.1.0.jar. But after running my application, i got the error, "java.lang.ClassNotFoundException:org.apache.commons.collections.map.ReferenceMap". How can i resolve it? 来源: https://stackoverflow.com/questions/35986262/java-lang-classnotfoundexception-org-apache-commons-collections-map