Jump to content
We've recently updated our Privacy Statement, available here ×

wjones14

Members
  • Posts

    32
  • Joined

  • Last visited

wjones14's Achievements

Contributor

Contributor (5/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Collaborator Rare

Recent Badges

0

Reputation

  1. We have a graphic that is 107KB. The graphic is in the Page Header section of a PDF report. Normally this report is less than 10 pages so the graphic size is not a problem. However, occasionally the report can be 500 pages or more. What we did not realize is that the graphic is apparently embedded in each page of the PDF, so the file size of a 500 page report is ~50MB! We can definitely reduce the quality of the graphic and bring it down to 5KB or so. But is there a way that the graphic can be referenced on each page rather than embedded in each page?
  2. I actually just did the following: in iReport 3.0, added the font .ttf file to it's font folder. So, when looking at the properties of the cell, I set the Font Name = Courier New, and the PDF Font Name = Courier New (cour.ttf). checked the PDF Embedded check box. Created a jar file with the .ttf file inside it, and put this jar in the runtime classpathNow, when I run the report, the new Font is in there. Looking at the PDF file properties, I see CourierNewPSMT (Embedded Subset) and type = TrueType. And the wrapping is definitely behaving differently, but there are still missing values... What am I missing? When generating the report, we are not using the PDFExporter. Instead, we are using JasperRunManager.runReportToPdf(). Do I need to use the Exporter and force some more PDF Font properties? Thanks, Bill
  3. Can someone point to a tutorial on the steps for packaging fonts in JR v3.0? I do have the Jasper Reports Ultimate Guide Third Edition (that we actually paid for when it was not free), and I have all the demo/samples. I would love to upgrade to a newer version of Jasper Reports and iReport, but our current application has a lot of working reports, and upgrade would mean extensive regression testing that we cannot afford right now. From what I see, it is much easier to package fonts with a report after version 3.1.3 or something, but that's not an option for us at the moment. The report we want to package fonts with is a PDF report. There is only one cell in the report that is giving us problems - we populate this cell with a long string of values - anywhere from 1 to several thousand values. The values are normally the same length in a given report, and may look like this: 12345678(1000) 12345678(1001) 12345678(1002) 12345678(1003) 12345678(1004) 12345678(1005) 12345678(1006) 12345678(1007) 12345678(1008) and so forth. Most of the time, the report works and there are no issues. But certain value lengths cause problems where some values are missing in the final report. In the font properties for the cell, we are using Font Name = monospaced, and PDF Font Name = Courier. It does not seem to matter if we check the PDF Embedded box or not. I think we want to package the font Courier New in this report to use for this cell. Can someone point to a tutorial on how to do that? Thanks!
  4. I did get it to work using a Frame, but it was not as obvious as I would have thought. This is what I did: put a Frame where each cell is. Each Frame has 4 borders "Print when detail overflows" = true "Print repeated values" = true Stretch type = "Relative to tallest object" put a TextField where each cell is, on top of each Frame, but NOT inside the Frames. Each TextField has NO borders "Print when detail overflows" = false Stretch type = "Relative to tallest object"
  5. If a subreport did not override a report property specified in the main report, would the subreport inherit the property? How about Custom properties? If the main report added this Custom property, would the subreports all inherit it? net.sf.jasperreports.export.pdf.force.linebreak.policy true
  6. We have 5 textfield elements in a detail band, all stretching relative to tallest object. There is a border around all 4 sides of each cell. When the data in one cell stretches so that it causes the row to span multiple pages, the border on that cell prints for each page, but the other cell borders do not print. I can fix this by putting a frame around each cell, and having the frame print when detail overflows, but is there a way to make the textfield borders print without doing this? The report is PDF, and we are using JasperReports 3.0. Post Edited by wjones14 at 03/16/2012 21:34
  7. teodord Wrote: Hi, You no longer need the pdfFontName and isPdfEmbedded attributes at text field level, because you already specified them in the font extension config file. Only the fontName is needed. Also, the markup attribute deprecates the formed isStyledText attribute. isStyledText="true" is equvalent to markup="styled", but the markup attribute takes precedence, if present. Can you upload your JRXML file and maybe the PDF you get using it? Thank you, Teodor Okay, I modified the JRXML file, removing all the text field attributes except markup="styled" and fontName="Courier New", and now it works! So the textField properties look like this: <textElement markup="styled"> <font fontName="Courier New"/> </textElement> Thank you for the help.
  8. Thank you for the support. We have also purchased the JR Ultimate Guide 3rd Edition, and find it very helpful. Despite all this help, we are still having problems getting HTML markup (the <b> bold tag) to work within a textField. We have done the following per your advice above and the Simple Font Extension Tutorial in the guide: Upgraded to Jasper Reports 3.1.3 Created a font jar containing: 8 .ttf True Type font files (2 font families - Arial and Courier New) jasperreports_extension.properties jasperfonts.xml Used these properties on the textField: isStyledText="true" markup="html" fontName="Courier New" pdfFontName="cour.ttf" isPdfEmbedded="true" Attached are the extension.properties and jasperfonts.xml files from our fonts jar. Are we missing something else?
  9. It would be awesome if someone who has good experience with the JasperReports fonts provided an example, along with a clearly detailed explanation. I have been struggling with font problems now for a couple weeks, including the EXACT same problem you have, where only the underline HTML tags work within a PDF report. I posted that question a few weeks ago, and Lucien explained the problem with this answer: "You need to configure a bold PDF font for the text field. You can either do this by using the FONT_MAP export parameter (as seen here), or font extension on newer JR versions." You can't be any more clear than that as far as what we need to do. However, how do we do it (using font extension on newer JR versions)? :-) I have also had problems with linebreaking, where the PDF output was truncating parts of the field when dealing with large Strings of output. The answer I got for that was to look at the FAQ, and then the font example from any version of JasperReports 3.1.3 onward in the /demo/sample/fonts directory. http://jasperforge.org/uploads/publish/jasperreportswebsite/trunk/faq.html?group_id=252#FAQ25 It's all very helpful, and we have since upgraded from JasperReports and iReport version 3.0.0 to 3.1.3 just to tackle these problems. However, the example font report does not explain a lot of the questions we still have. It does not say in general how you map a PDF font to an AWT font. It does not give a "best practices" approach for including additional fonts with a deployed application. It does not say when to use embedded pdf fonts, or why. There seems to be a big mystery surrounding the details of the new font support in JR 3.1.3.
  10. Can anyone tell me why the HTML underline tag does work in my textField, but the HTML bold tag does not? <u>MyText</u> works <b>MyText</b> does not work We are using JasperReports 3.0, iReport 3.0, JDK 1.5. The properties of the textField are: Font Name = Courier New PDF Font Name = Courier Markup = HTML IsStyledText not checked PDF Embedded not checked. We are using the JasperRunManager.runReportToPDF() method to stream the report.
  11. We figured out a way to do this so I thought I would share the answer. The report output looks like this: col1 col2 col3 col4 col5 data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data So what we did was to have col1, col2, col3, and col4 be ordinary textField elements. But col5 is a subreport. In addition to the Fields declared for col1, col2, col3, and col4, we have col5 declared as a Field of class type JasperReport. The main report's subreport properties are also Fields. And the main report's DataSource is a JRMapCollectionDataSource, so each report row contains maps with the subreport's parameter map, it's data source, and the compiled subreport. The subreport's data source is also a JRMapCollectionDataSource, created with a list of maps, each with key that matches the subreport textField expression name, and a value of the actual data. The subreport is real simple. It is simply a detail band containing a single textField. The report properties have column count set to 5 and the printOutput property is horizontal.
  12. We still have an issue with a report cell, where the line breaking / word wrapping is not always working right in our PDF report, and the report sometimes is missing data. Teodor replied, saying the issue might be font related. He suggested reading this section of the FAQ for ideas: http://jasperforge.org/uploads/publish/jasperreportswebsite/trunk/faq.html?group_id=252#FAQ25 And actually, after reading that, we tried changing the net.sf.jasperreports.export.pdf.force.linebreak.policy property to true. This fixed the problem of missing data, but introduced a new problem where the data was no longer lined up in neat columns, and the line breaks were happening in the middle of words. So by trial and error, we also started changing the fontName and pdfFontName values for the textField from the iReport default of San Serif and Helvetica. We changed them to this: <textElement> <font fontName="Times New Roman" pdfFontName="Times-Roman"/> </textElement> This seems to fix the problem, although we can't test it with every possible data configuration we might have. Are the PDF font metrics equal to the Java/AWT font metrics with these two fonts?
  13. If Jasper cannot accept a List of Strings as input for a textField, can it display an HTML table in the cell? This is a PDF report.
  14. Presently, we have a textField cell where the data is a long single String. We generated the String before sending it to the report, by concatenating a list of Strings, each separated by a comma and a space. See the last column in the attached file for an example. We're wondering if it's possible to send a textField a List of Strings, and have Jasper format the list by columns? It would be similar to how Microsoft Word allows you to format using "newsletter-style" columns. Post Edited by wjones14 at 06/12/2009 15:51
  15. I said that setting the PDF linebreak property to true fixes the problem in our report, where we were previously losing data in certain cases. However, now we have another problem where the line breaks are unpredictable and happening in the middle of words. I have attached two small files, one showing our original problem of missing data, and another showing how the PDF linebreak = true property fixes the missing data, but causes line breaks in the middle of words. These reports are packing lists. The problem data is in the last column, with header: Subject(Visit) / Kit ID(Usage Seq). If you look at the pdf_linebreak_false attachment, you see that the numbers inside the parentheses are sequential, i.e. 50501, 50502, ... The first page ends at number 50788. The second page begins with 50813, so the report is missing 50789 through 50812. And the last line on the last page ends with Kit number 51286. Now, by using the PDF linebreak = true property in the pdf_linebreak_true attachment, you see that are problem is fixed and there are no more missing kits. The first kit is 50501, and the last kit is 51300, so all 800 kits are displaying. This property, however, has added a new problem where the lines are breaking unpredictably in the middle of Kit IDs. Also attached is the .jrxml file containing the subreport. The problem field is textField-7 Other details about this report: jasper reports version: 3.0 ireport version: 3.0 JVM version: 1.5.06
×
×
  • Create New...