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

C-Box

Members
  • Posts

    910
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by C-Box

  1. Hi, the StrechType " RelativeToTallestObject " should be used carefully - i seldom use this, mostly just for rendering some "pseudo" border lines or anything like this. So it seems that your textfield grows because of the self stretching table (when I understood your problem right). So try to disable this stretchtype or post some screenshots of your layout and also of the wrong result. regards C-Box
  2. Well I just created a sample 4 u just with a simple static parameter and a link within the text (it's either if parameter or fields. both handle dynamic content) <?xml version="1.0" encoding="UTF-8"?><jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="TestURL" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="0c81e6db-3b5f-4d36-a45c-f33d0da5643e"> <property name="ireport.zoom" value="1.0"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <parameter name="parameter1" class="java.lang.String"> <defaultValueExpression><![CDATA["This is a Test for <a href=http://wiki.selfhtml.org/wiki/href">The Link within </a> the Text]]></defaultValueExpression> </parameter> <background> <band splitType="Stretch"/> </background> <title> <band height="79" splitType="Stretch"> <textField> <reportElement x="0" y="21" width="555" height="45" uuid="c4db0c7d-3c14-4f1a-9da1-aa3e6f33dc1f"/> <textElement markup="html"/> <textFieldExpression><![CDATA[$P{parameter1}]]></textFieldExpression> </textField> </band> </title> <pageHeader> <band height="35" splitType="Stretch"/> </pageHeader> <columnHeader> <band height="61" splitType="Stretch"/> </columnHeader> <detail> <band height="125" splitType="Stretch"/> </detail> <columnFooter> <band height="45" splitType="Stretch"/> </columnFooter> <pageFooter> <band height="54" splitType="Stretch"/> </pageFooter> <summary> <band height="42" splitType="Stretch"/> </summary></jasperReport>[/code]When you export this to PDF, you can click onto the words "The Link within" ... or also see the mouse pointer changing to hand cursor: The built-in Preview-Module in iReport can't handle these "inline" links within a text, as this doesn't implement the correct hyperlink listener methods. Not sure whether the JasperSoftStudio Preview will do that also. But as you see, the PDF-Exporter (and also the html-exporter do handle that correctly) So perhaps this helps you a bit. If you wan't to color the inline link , you also can use the font-color html tags for that purpose. regards C-Box
  3. You coud use the normal href anchor syntax for html hyperlinks (<a href ....> </a> ) within your whole text for certain passages. Then you set the TextFieldProperty Markup to HTML, so that the enginge just renders the link text and not the html-tags + URL. Should work (but not in default (ireport)viewer when I remember right, just in Html/PDF outout, when I remember right) hth + regards C-Box
  4. Be aware that you DON'T use any transparent images in your jrxmls! These are forbidden in PDF/A conformance! Also the colorspace is important. Not sure whether CMYK images were allowed but we had some troubles with certain customer logos some years ago. But I guess (!) it is because of the transparency hth + regards C-Box
  5. Well I wrote at "REPORT - LEVEL" not at band level... so see here: http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/design/JasperDesign.html#PROPERTY_COLUMN_DIRECTION hth + regards C-Box
  6. Have you already tried to set the Report-Property "ColumnDirection" to "RightToLeft" instead of the default one "LeftToRight" ? hth+ regards C-Box
  7. Not sure, whether I understood correctly but it seems that you could use a group with (concated) Expression $F{ColA}+$F{ColB} then you but both fields from ColumnA and ColumnB into the groupHeader-Band and the other two fields from ColC and ColD into the detail-Band with a slight indention. For numbering the groups you could just create a simple variable "MyGroupNumber" and add just 1 with calculation time group. (e.g. for variable expression $V{MyGroupNumber} +1) just give it a try or post if I missunderstood the problem hth + regards C-Box
  8. You could perhaps use the COALESCE sql function?!? see here: https://www.sqlshack.com/using-the-sql-coalesce-function-in-sql-server/ or also here https://stackoverflow.com/questions/194852/how-to-concatenate-text-from-multiple-rows-into-a-single-text-string-in-sql-serv perhaps this could help to concat your notes as a SubQueryResult instead of joining them. hth + regards C-Box
  9. What about grouping by Date? Just create a Group with Expression $F{YourDateField} and create internal Variables for summing up /average or anything you want for aggregate your current columns (e.g. $V{SumNumberDiffVehicles} with calctype SUM and expression $F{YourNumberFieldOfDifferentVehicles} and ResetType group) The variables have to be placed in GroupFooterBand and your detailband could be removed if just the sums are enough So just a basic feature of JasperReports :-) hth + regards C-Box
  10. Have you already tried to create two groups with the same group-expression instead of one group with two footerbands? At the "outer" group for "TermsAndConditions" you could then set "StackToBottom" or whatever you wan't to appear at the page and the "inner" groupfooter for "SubTotals" is just printing right after the last detail. just give it a try - should work. Otherwise you could also use a SubReport for your TermsAndConditions and set the Flag "RunToBottom" - should also work. Many ways are leading to Rome! :-) hth + regards C-Box
  11. I've such used the search function.... Have you already checked, whether all libraries are also within your tomcat classpath? https://community.jaspersoft.com/wiki/error-when-running-reports-could-not-initialize-class and https://stackoverflow.com/questions/4998762/could-not-initialize-class-net-sf-jasperreports-engine-util-jrstyledtextparser hth + regards C-Box
  12. No you don't need any VARIABLE just to filter dynamically based at the date-parameter that is also given from "outside". What I suggested was just at PARAMTER level. So that your (new) "hidden" select parameter internally just differs beetwen the two fields in database SV_SUB_CALENDAR_VISIT_DATE or SV_FIN_INVOICE_OCCURRED_DATE Also you already have included the " BETWENN ..." in your default expression, so that you won't add to the query again. otherwise I missunderstood your problem, sorry! regards C-Box
  13. Be aware that if your Field named "result" is in java or from your query just null then you will get a NullPointerException that is internally ignored by JasperReports by default. :-O Then your expression won't work as expected! So that's why it's (always) better to turn the equals comparisons to make it null-safe: "approved".equalsIgnoreCase($F{result}) ....[/code];-) Or just use the StringUtils from Apache, that are also more "null-resistant" and also available in JasperReports classpath. Just my two cents C-Box
  14. Does your field "Signed" contains a valid image? Is this perhaps CMYK in colorspace? We had formerly some troubles with "wrong" colored images in database Also some JPG2000 images couldn't be loaded by Jasper when I remember right. Also the stretchType for the ImageElement can cause strange behaviour (so "real size" /"real height" is bigger than page size) not sure, whether this is solved in 6.x versions, but we had also problems in older versions of JasperReports at some customers. try to track down the problem hth + regards C-Box
  15. Just create a (hidden - not for input) parameter $P{JustDateParam4SQL} for your dynamic date query depending on your input choice param $P{Date}: In this "calced" Parameter you use as Default Expression an IfThenElse Syntax: "Visit".equals($P{Date}) ? "SV_SUB_CALENDAR.VISIT_DATE Between $P{Start Date} and $P{End Date}" : "SV_FIN_INVOICE_OCCURRED_DATE Between $P{Start Date} and $P{End Date}" in your query you could then use the calculated Parameter: ...WHERE $!P{JustDateParam4SQL) .... Not 100% sure where exactly the exlamation mark was placed $!P or $P! ... but just give it a try. Should work (I've built some years something similiar in a customer project). hth + regards C-Box
  16. Just use the short java syntax for that: $F{YourFieldX}.equals("Microsoft") ? "BigButBuggy" : "OthersArePerhapsBetter" [/code]of course you can also build nested if-then-elses (use brackets for more readability): $F{YourMoneyBag} < 0 ? "Ooops negative is bad" : ( $F{YourMoneyBag} <= 100 ? " ok positive but could be more": "more than 100 - well done" )[/code]hth + regards C-Box
  17. Just add a static text e.g. "No f***ing data found" into the "No Data" Band and set the property "WhenNoData" to "No Data Section" ... If you then run the report again and you see this static text in your generated PDF, then you could track down the problem to the database connection or to the query itself that could throw an error or something like this when accessing from your php-app. Otherwise you will have to view the logfiles if the error is thrown perhaps when exporting to pdf or perhaps already when filling the JasperPrintObject. hth + regards C-Box
  18. So if I understand correctly the page numbering should be consecutive over all SubReports, right? So either you put them into your MAIN report, then this main report is responsible for incrementing the $V{PAGE_NUMBER} variable. But then you would have to use the Pageheader/-footer of this and wouldn't be able to use the SubReports Title bands. Of course you also alternatively could pass the current page-number value as SubReportParameter to each subReport.. that would be working fine (Just add outside passed "$P{ParentPageNumber} + $V{PAGE_NUMBER} inside the SubReport(s),) if you just want to print the current but NOT (!) the total page number (so page x/y can't work, as the SubReport don't know how many pages outside will be generated after it has finished itself.) But luckily there is a new evaluation time in newer versions of JasperReports.... so called "Master". And also two "new" built-in variables $V{MASTER_CURRENT_PAGE} and $V{MASTER_TOTAL_PAGES} were introduced: If you use a JasperReports version >= 6.x you can use these variables also in your SubReports Title bands. Just give it a try! hth + regards C-Box
  19. Just create a class like package de.cbox.test;import java.lang.*; public class MyTest { public static String getSomeStuffByField(String fieldContent) { return "SomeStuffF filled or modified with your field content: " + fieldContent; }}[/code]create a jar for that class and put that into your classpath. From within your jrxml file you could then easily access that method within an expression: de.cbox.test.MyTest.getSomeStuffByField($F{YourFieldFromJRXML})[/code]if you are too lazy to write the full package path always you also can add the package to the "imports properties" in your jrxml and then just use the shorter syntax: MyTest.getSomeStuffByField($F{YourFieldFromJRXML})[/code]and voilá it will print the result of that static method. hth + regards C-Box
  20. Well the report designs (jrxmls) are written within a Designer like JasperSoft Studio or the older version iReport (but there just the old versions of JaspertReports < 6.x are supported - so take the Studio for the latest JasperReports release). You will have to load that design in your java app (I assume you have one or you want to create an app) by Jasper API e.g. from FileSystem by JRLoader and will get a JasperReport-Object. (compile the .jrxml by the JRCompileManager or just load the generated .jasper files generates by the designer as well) The data for that JasperReport-Object are passed in different ways depending of your architecture.... so if you have just a simple CSV file you could create JRCSVDataSource and load the records for passing them to the JRFillManager that transforms the data to the wanted report result. (normally the data are stored within a database and you will fetch them by sql query - but therefore JasperReports is very flexible and you can use simple files like csv/xml/json/xls/... also as "datasource") After you have called the filling process you will get an JRPrint-Object that could be send to a printer by using the JRPrintServiceExporter or you could export it to a PDF File with the JRPDFExporter. If you start from a green field - as it sounds - I would advice loading the FULL JASPERREPORTS Project from Sourceforge and take a look into the samples. There you can learn a lot of your requirements (loading data from file, transform it to a report and export/print it). The alternative to the Jasper API would be to install the JasperReport-Server that is a kind of ReportServer, where you can manage all that stuff for loading designs and filling them with different datasources (so normally by sql-connection or also by xml/csv/excel files) and save the output as pdf or just view it in brower or send it to a printer. So it depends on your architecture/infrastructure/needs?!?! :-) hth + regards C-Box
  21. So is this now a question or a fact ?!?!?!? Do you load 5GB of e.g. an XML-DataSource or is your sql-query result such large!??!? So some more info would be helpful?!?! regards C-Box
  22. Hava you already tried to limit the number of decimal places? So something like this: String.format ("%.2f", ($F{cnt}/$F{total}))[/code]?? Perhaps just the long string when dividing your numbers just doesn't fit into the bar chart elements?!? hth + regards C-Box
  23. As for searching the forum it doesn't seem to be possible: https://community.jaspersoft.com/questions/842948/setexplodepercent-method-not-working-3d-pie-chart-jaspersoft This was some years ago, but as you posted that you also use iReport so I guess (!) it's still not possible. In JasperSoftStudio there probably is a newer version of JFreeChart (1.019) integrated... just give it a try if it's working there with the sample source from the customizer class provided of the link above. (and post the solution for other guys if it's working ;-) ) hth + regards C-Box
  24. It took me just some seconds to find the mentioned Zip file from david just by stepping from his download section --> to sourceforge --> to files!??!?! So where is the problem!??!?! :-/ here the direct link: https://sourceforge.net/projects/commander4j/files/Version%207.17/source/b4.zip/download hth + regards C-Box
×
×
  • Create New...