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

MiditecReportDev

Members
  • Posts

    51
  • 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 MiditecReportDev

  1. You're absolutely right that's what I forgot in that example. It works now and I can't (as I needed to find a workaround fast) say that it can not have been the same problem in the "real" report as well. Maybe, maybe not. Still the bug remains. Can you tell me how to properly report it as it really needs fixing? I need to show people how to use Jasper Reports soon and I have worked with it for 6 months now and have those problems. Can't imagine my poor phone when people are confronted with this when they just started using Jasper.
  2. As I can't give you our company reports I just made a sample out of two reports. Main with table and sub (inside the table). Report compiles without problems when I fill in the field $F{SHIPNAME} from hand but will however not fill as the data seems not to be given into the subreport. Code of Main Report: <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.3.0.final using JasperReports Library version 6.3.0 --><!-- 2016-07-12T07:15:14 --><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="Main" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="1f893ec5-9a1c-4728-863a-d9eacb152c2c"> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="Sample DB"/> <property name="com.jaspersoft.studio.data.sql.tables" value=""/> <subDataset name="TableDataset" uuid="cc9ba582-862e-4283-8f00-ffc76a6a22dc"> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="Sample DB"/> <property name="com.jaspersoft.studio.data.sql.tables" value=""/> <parameter name="OrderID" class="java.lang.Integer"/> <queryString> <![CDATA[sELECT * FROM ORDERS WHERE ORDERID = $P{OrderID}]]> </queryString> <field name="ORDERID" class="java.lang.Integer"/> <field name="CUSTOMERID" class="java.lang.String"/> <field name="EMPLOYEEID" class="java.lang.Integer"/> <field name="ORDERDATE" class="java.sql.Timestamp"/> <field name="REQUIREDDATE" class="java.sql.Timestamp"/> <field name="SHIPPEDDATE" class="java.sql.Timestamp"/> <field name="SHIPVIA" class="java.lang.Integer"/> <field name="FREIGHT" class="java.math.BigDecimal"/> <field name="SHIPNAME" class="java.lang.String"/> <field name="SHIPADDRESS" class="java.lang.String"/> <field name="SHIPCITY" class="java.lang.String"/> <field name="SHIPREGION" class="java.lang.String"/> <field name="SHIPPOSTALCODE" class="java.lang.String"/> <field name="SHIPCOUNTRY" class="java.lang.String"/> </subDataset> <queryString> <![CDATA[sELECT ORDERID FROM ORDERS]]> </queryString> <field name="ORDERID" class="java.lang.Integer"/> <background> <band splitType="Stretch"/> </background> <title> <band height="30" splitType="Stretch"> <property name="com.jaspersoft.studio.unit.height" value="pixel"/> <staticText> <reportElement x="0" y="0" width="555" height="30" uuid="4f63821b-5cae-4347-bcdd-7ca94a038a42"> <property name="com.jaspersoft.studio.unit.width" value="pixel"/> </reportElement> <text><![CDATA[Example]]></text> </staticText> </band> </title> <detail> <band height="60" splitType="Stretch"> <property name="com.jaspersoft.studio.unit.height" value="pixel"/> <componentElement> <reportElement x="0" y="0" width="555" height="60" uuid="af4d62b4-20ad-4b81-8eb9-076102bc1ee7"> <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/> <property name="com.jaspersoft.studio.unit.height" value="pixel"/> <property name="com.jaspersoft.studio.unit.width" value="pixel"/> </reportElement> <jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd"> <datasetRun subDataset="TableDataset" uuid="ce1200f0-3fa7-4216-965f-8d5d839428a6"> <datasetParameter name="OrderID"> <datasetParameterExpression><![CDATA[$F{ORDERID}]]></datasetParameterExpression> </datasetParameter> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> </datasetRun> <jr:column width="40" uuid="50957880-859d-4a8e-9eeb-b7789566c9d7"> <property name="com.jaspersoft.studio.components.table.model.column.name" value="Column1"/> <jr:columnHeader height="30" rowSpan="1"/> <jr:detailCell height="30"> <textField> <reportElement x="0" y="0" width="40" height="30" uuid="2735cc27-1ec8-4a53-b02a-1e5693725d6c"/> <textFieldExpression><![CDATA[$F{ORDERID}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> <jr:column width="40" uuid="7c027851-f31c-4b54-a1cf-4104ef85b68c"> <property name="com.jaspersoft.studio.components.table.model.column.name" value="Column2"/> <jr:columnHeader height="30" rowSpan="1"/> <jr:detailCell height="30"> <textField> <reportElement x="0" y="0" width="40" height="30" uuid="56e4c2a7-1729-4ce1-97ad-c755363622d5"/> <textFieldExpression><![CDATA[$F{CUSTOMERID}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> <jr:column width="40" uuid="8a12ccee-1f40-498c-8bd6-3861aa55bfa0"> <property name="com.jaspersoft.studio.components.table.model.column.name" value="Column3"/> <jr:columnHeader height="30" rowSpan="1"/> <jr:detailCell height="30"> <textField> <reportElement x="0" y="0" width="40" height="30" uuid="6af83270-b4c0-4ed5-a249-efb9e0539dd9"/> <textFieldExpression><![CDATA[$F{EMPLOYEEID}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> <jr:column width="40" uuid="61327c4f-a715-4895-baa5-d09f58f7016c"> <property name="com.jaspersoft.studio.components.table.model.column.name" value="Column4"/> <jr:columnHeader height="30" rowSpan="1"/> <jr:detailCell height="30"> <textField> <reportElement x="0" y="0" width="40" height="30" uuid="0e7ad0c6-83b5-4912-bb3b-68346d8f2ba7"/> <textFieldExpression><![CDATA[$F{ORDERDATE}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> <jr:column width="40" uuid="be279976-27a2-4300-89b3-a03538dbc1f9"> <property name="com.jaspersoft.studio.components.table.model.column.name" value="Column5"/> <jr:columnHeader height="30" rowSpan="1"/> <jr:detailCell height="30"> <textField> <reportElement x="0" y="0" width="40" height="30" uuid="572e634f-22e3-4d2e-b734-058392be227b"/> <textFieldExpression><![CDATA[$F{REQUIREDDATE}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> <jr:column width="40" uuid="f3aac2c5-fecb-4603-866c-0f51763e1f52"> <property name="com.jaspersoft.studio.components.table.model.column.name" value="Column6"/> <jr:columnHeader height="30" rowSpan="1"/> <jr:detailCell height="30"> <textField> <reportElement x="0" y="0" width="40" height="30" uuid="91babcba-a663-4955-b93e-b058e40d262c"/> <textFieldExpression><![CDATA[$F{SHIPPEDDATE}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> <jr:column width="40" uuid="50cadf93-0123-4742-84cf-e6ea395d2491"> <property name="com.jaspersoft.studio.components.table.model.column.name" value="Column7"/> <jr:columnHeader height="30" rowSpan="1"/> <jr:detailCell height="30"> <textField> <reportElement x="0" y="0" width="40" height="30" uuid="afd84df1-0bc0-4995-852e-6c397e9c38d2"/> <textFieldExpression><![CDATA[$F{SHIPVIA}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> <jr:column width="40" uuid="2088bfac-a959-497f-8af0-bb174b259e06"> <property name="com.jaspersoft.studio.components.table.model.column.name" value="Column8"/> <jr:columnHeader height="30" rowSpan="1"/> <jr:detailCell height="30"> <textField> <reportElement x="0" y="0" width="40" height="30" uuid="d991722c-dfc8-484f-9eca-27ffc7dcc315"/> <textFieldExpression><![CDATA[$F{FREIGHT}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> <jr:column width="235" uuid="32135f06-772c-4e1b-b599-a6ad7cde9859"> <property name="com.jaspersoft.studio.components.table.model.column.name" value="Column9"/> <jr:columnHeader height="30" rowSpan="1"/> <jr:detailCell height="30"> <subreport> <reportElement x="0" y="0" width="235" height="30" uuid="299fba81-ffb0-4652-9d83-e68d7d5f2057"/> <subreportParameter name="ShipName"> <subreportParameterExpression><![CDATA[$F{SHIPNAME}]]></subreportParameterExpression> </subreportParameter> <subreportExpression><![CDATA["Sub.jasper"]]></subreportExpression> </subreport> </jr:detailCell> </jr:column> </jr:table> </componentElement> </band> </detail></jasperReport>[/code]Code of Subreport: <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.3.0.final using JasperReports Library version 6.3.0 --><!-- 2016-07-12T07:16:05 --><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="Sub" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="4f184e02-e9d4-4808-8b7e-07858b8166a6"> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="Sample DB"/> <property name="com.jaspersoft.studio.data.sql.tables" value=""/> <parameter name="ShipName" class="java.lang.String"/> <queryString> <![CDATA[sELECT * FROM ORDERS WHERE SHIPNAME = $P{ShipName}]]> </queryString> <field name="ORDERID" class="java.lang.Integer"/> <field name="CUSTOMERID" class="java.lang.String"/> <field name="EMPLOYEEID" class="java.lang.Integer"/> <field name="ORDERDATE" class="java.sql.Timestamp"/> <field name="REQUIREDDATE" class="java.sql.Timestamp"/> <field name="SHIPPEDDATE" class="java.sql.Timestamp"/> <field name="SHIPVIA" class="java.lang.Integer"/> <field name="FREIGHT" class="java.math.BigDecimal"/> <field name="SHIPNAME" class="java.lang.String"/> <field name="SHIPADDRESS" class="java.lang.String"/> <field name="SHIPCITY" class="java.lang.String"/> <field name="SHIPREGION" class="java.lang.String"/> <field name="SHIPPOSTALCODE" class="java.lang.String"/> <field name="SHIPCOUNTRY" class="java.lang.String"/> <background> <band splitType="Stretch"/> </background> <columnHeader> <band height="30" splitType="Stretch"> <property name="com.jaspersoft.studio.unit.height" value="pixel"/> <staticText> <reportElement x="0" y="0" width="100" height="30" uuid="7e5a2610-38e5-494a-aee7-e023f3aad9d5"/> <text><![CDATA[sHIPNAME]]></text> </staticText> <staticText> <reportElement x="200" y="0" width="100" height="30" uuid="2ec86bb2-b681-4ba8-b64b-1ddf52da5ffa"> <property name="com.jaspersoft.studio.unit.y" value="pixel"/> </reportElement> <text><![CDATA[sHIPADDRESS]]></text> </staticText> <staticText> <reportElement x="400" y="0" width="100" height="30" uuid="9144275e-0eea-44e4-b988-383b80492865"/> <text><![CDATA[sHIPCITY]]></text> </staticText> <staticText> <reportElement x="100" y="0" width="100" height="30" uuid="579a1967-c762-498a-a326-6e1469ead32a"/> <text><![CDATA[sHIPREGION]]></text> </staticText> <staticText> <reportElement x="300" y="0" width="100" height="30" uuid="5a40dbfa-0d9b-45e4-9df3-5f3817d2af7f"> <property name="com.jaspersoft.studio.unit.y" value="pixel"/> </reportElement> <text><![CDATA[sHIPCOUNTRY]]></text> </staticText> </band> </columnHeader> <detail> <band height="30" splitType="Stretch"> <property name="com.jaspersoft.studio.unit.height" value="pixel"/> <textField> <reportElement x="0" y="0" width="100" height="30" uuid="bddebae8-f26c-40ea-86ef-b413690a442a"/> <textFieldExpression><![CDATA[$F{SHIPNAME}]]></textFieldExpression> </textField> <textField> <reportElement x="200" y="0" width="100" height="30" uuid="385cad10-9395-4453-8071-27e03ec3f1e6"/> <textFieldExpression><![CDATA[$F{SHIPADDRESS}]]></textFieldExpression> </textField> <textField> <reportElement x="400" y="0" width="100" height="30" uuid="e65a6ce9-0af2-4a69-a161-019e4275b5bb"/> <textFieldExpression><![CDATA[$F{SHIPCITY}]]></textFieldExpression> </textField> <textField> <reportElement x="100" y="0" width="100" height="30" uuid="d9a2b2d8-011f-47b3-aa2f-220d73cc7279"/> <textFieldExpression><![CDATA[$F{SHIPREGION}]]></textFieldExpression> </textField> <textField> <reportElement x="300" y="0" width="100" height="30" uuid="fe03c200-5c84-4be3-9ffa-92e0e746eaff"/> <textFieldExpression><![CDATA[$F{SHIPCOUNTRY}]]></textFieldExpression> </textField> </band> </detail></jasperReport>[/code] So currently there seems to be no way to have subreports inside tables at all o_O Greetings, Patrick
  3. I have a very serious problem when having my main report with it's dataset, inside of the main report is a table with it's own dataset which has a subreport inside one of it's cells. This subreport needs to get some field values given inside it's own parameters. However when I try to give the fields to the subreport I only see fields and parameters or variables from the main report dataset, not from the table dataset. I can select those and the expression is totally valid but the report won't compile as the subreport could not find the values (which to me is correct behaviour - so why offer them to me in the first place?). I can manually put the correct expressions there and the report will compile then but will not fill correctly as the subreport somehow will still not get the right values. So I can either use those value Jasper Studio offers me to use and get a non-compiling report or use the correct values and get the report to compile but have a piece of garbage then. What exactly is the problem there? oO
  4. Bump. Anyone able to help there? It would be quite important to know this.^^°
  5. Hi, currently I have "{0}, {2}" in my charts legend label. But this displays the values with no decimal places at all, even though the data the chart uses is float values. This results in the charts legend sometimes summing up to 99% or 101% - rare but it happens. It would be much better if it would be something like 99,99% or 100,01% - therefore I'd need decimal places in the charts legend label. {2,##} | {2.##} | {2}.## and {2},## don't work as desired (the last two print the # as characters and don't use it to format, the first two don't do anything at all). Is there any way to get decimal places in the label without needing to code a java class? And if not how would this java class need to look like and be used?
  6. The development is not a problem, we have development databases^^ So deleting from there or looking at data is no problem at all. Problem is that you can easily give reports to customers that will delete all their data as long as you know at least one table name, which you do since they'll need to tell you for select statements anyways. Kind of unsecure in my opinion, but we'll solve this differently now.
  7. Hi, just wanted to ask if it is in any way possible to forbid the guy who builds the reports to use certain sql statements such as insert, update or delete? As far as I can see a report tool such as Jasper should have some tools for that as normal reports in my/our eyes should be read-only oO It is kind of unsafe to allow that, especially when the guy who builds the report (theoretical scenario) may get fired, knows it and inserts a delete statement for a crucial database table into a report without anyone being abtle to stop this.
  8. Hi, I'd like to know if there's any way to resize the width of a table cell (or to be more correct the entire column) depending on the width of the content of the cells. In my example I have a table column with 80px width containing a table inside the cell consisting of two columns with 40px width each. One of those has a PrintWhen Expression and in 50% of the cases is not displayed. The inner table correctly hides the specific column in that case to the width of the inner table shrinks from 80px to 40px. But since the outer column has a fixed width of 80px it doesn't shrink just because it's contents get less wide. Is there any way (return parameters or such) to tell the outer column "Hey - you can cut your width in half, your content just did so" ?
  9. 'Setting build path' has encountered a problem. Could not write file: [path][projectfolder].classpath. I have this problem with version 6.2.1 final of Jaspersoft Studio - anyone knows what the problem could be? Neither the file itself nor the folder it is contained in or it's parent folders are read-only. It's quite a bit annoying to have to edit the classpath file with text editors every time things need to change.
  10. I can only guess at the moment (as I'm at work and can't check the tutorial to compare it to what you have) but can you check the following points? - If you use SQL in your subreports make sure that needed parameters are set to be forwarded by the master report. - If you don't need any data besides parameters inside your subreports make sure to put an "SELECT *" statement in your subreports query (doesn't do anything but is needed to fill the subreport - don't ask me why). - Please look up the error messages the Studio is giving to you - they may not look like much but some times there is actually helpful information in there. - In your master report select the subreports and go to "Appearance" Tab, set a back color and set transparency off (if it already is off, turn it on and off again, sometimes it does not work otherwise). When you did this print the report again and look if both colored areas are visible or just one of them - that way you can see if they are both generated but empty or not even generated at all (which you would see because there will be no colored area for that report). - In your master report select the subreports and go to "Dataset" Tab and make sure "When no Data Type" is set to "All Sections No Detail" - that way you should get a subreport generated even without any data - see if that changes anything.
  11. Any idea how to solve this potential problem? Maybe a way to copy the .jasper files directly into the project directory after compiling?
  12. Because a) I'm doing that and other employees will be doing so soon too. and b) That does not solve the problem at all. When compiling the files stay in their respective folders and don't get (as far as I can see) compiled in the folder of the project they get used in, which would be what we need. It seems you didn't read quite through my question, as I already have stated that I want to know if it somehow is possible to get the compiled files all into the project folder even if some of the subreports are not created inside that specific project but imported from another.
  13. Ok, title is not nearly telling what I really want to do. I'd love to know if there is a possibility to create new projects, add a specific other project into the build path (possible so far and known to me), use a specific subreport of that other project (possible as well, I know) and once I hit build having not only one jrxml-file and one jasper-file, but one jrxml-file and two jasper-files in my project folder? The one jrxml being the file I just created for the project and the two jasper-files being the jasper-file matching the jrxml-file and the one matching the included subreport from another project. Is this in any way possible? When I design reports I need the compiled jasper-files and put them inside an archive. So far no problem as long as it's just me working on those, but soon other employees will work on other projects but there will be subreports used in many of those projects, required in the archives every single time. And because I want it to be as easy as possible for them I need a way to get all used reports and subreports into the project folder no matter if the jrxml-file is in that specific project or inside an included one. Can I do something like this?
  14. Hi, just saw that my whole report (one main and eleven subreports) are not bold in any of my text-fields. I am required to use Arial if possible, but since Arial seems not to get used when exporting to pdf and font weight seems to get discarded if that happens, I switched to Sans Serif. Is there any way to use Arial font with bold font weight when exporting to pdf without workarounds? Just a clean solution? If not I'd be very thankful for any explanation on why it is that way as I need to justify my descisions and it'd help me a lot ^_^
  15. Ok, solved it myself now. It was the versions. Seems we were running with 6.0.4 of Jasper Reports and after updating to 6.2.0 it works just fine without further changes.
  16. Ok - found the problem(s) but still can't solve them. Daily Subreport has a table for the values inside itself, which returns them to the subreport itself who in turn passes them as parameters to another table and returns them to Weekly Subreport who passes them as parameters to a table and returns them to Monthly Subreport where they get passed in a table. There is no problem when it comes to returning even totally empty values from Daily to Weekly or Weekly to Monthly Reports, works fine. But when I even try returning something from the value table of Daily Subreport to Daily Subreport itself it crashes immediately. Works fine from the studio, doesn't work if started using Java. Everything else is totally identical, I even removed initial values of the variables in the table to make everything exactly as it is one level higher (where it works) - still nothing. Crashes with NullPointer. Also a second problem is, that I cant use phrases like "new java.text.SimpleDateFormat("EE. dd.MM.yyyy",new Locale($P{Locale},UPPER($P{Locale}))).format($P{DATE})" because it's crashing as well. This too does work perfectly fine if compiled directly from the studio and filled there. But filling it with Java will crash it.
  17. Yes, I do pass parameters all the way down, but those parameters are present in the main report, I made sure of that. It is one table that seems to be the problem which has something to do with ReturnValues which seems kind of strange to me as in the Studio everything works fine, but running from java is produces the mentioned NullPointer.
  18. Hi, currently I'm trying to run my report from existing java code which I need to check for usability with subreports of differing depth. The current report has multiple subreports from which one has a subreport that has another subreport, so we are talking about third level depths here. The error message says something about return values gone wrong, which I don't quite get as the deepest subreport may be having return values that could go wrong in theory, but I the report it returns it's values to returns them to his parent report as well and that one works just fine. The structure of the document is as follows. Main Report with multiple subreports which don't get called every time but depending on several conditions. So for the print I'm trying to test only three specific subreports (two different headers and the data subreport) are getting called.Headers: Work just fine, do what they are supposed to do, but their SQL statements are quite simple and they don't return anything at all.Monthly subreport which has two different tables with captions that need to be above one another but in different bands, then has a weekly subreport, a table (same format as the above mentioned) for summing up the values returned by the weekly subreport and a summarizing subreport (which also works just fine because it doesn't get many parameters, doesn't return anything and has quite a simple SQL)Weekly subreport which has a daily subreport and a table (same format as the previous tables) for summing up the values returned by the daily subreport.Daily subreport which has two tables, both in the well known format. One is for the actual data of that specific day, the other is for summing up the returned values from the data table. The data from this report should get returned to weekly report, summed up there and returned to monthly report and summed up there.So as you can see it's not the simplest of all documents. What I don't get is that even with initial value expressions of the variables in all reports the error exists in the deepest level. Weekly report and monthly report work just fine if I delete the daily one, so I know the problem is in there. Should not be the summing up either as the other two reports do it the same and it works just fine. I don't quite think the amount of information I just gave will be enough for you to help me out here, so if anyone needs additional bits of information I haven't thought of, do tell me please. The error I get when trying to run the report is as follows:
  19. You could use a normal table with twelve columns and set one printWhen Expression to each column that only print the column when the month in question is in the given date range. Table column that are not printed do have a width of 0 so you won't have space issues either. Not the best solution (I think) but it definitely is one ;)
  20. @hozawa I know that much, that's why I check if the size it at least two before selecting index 1 - because size1=index0 available and size2=index1 available. But that's not working ;) @kkriplani Will try your solution now. You want me to paste that in the Expression-Field, just to clarify this?^^
  21. Hi, currently I’m trying to fill the captions of up to eight table columns depending on a list of entries I get as a parameter. The list can be smaller than eight, but never bigger, so in my opinion the following code should work in the field expression. IF($P{List}.size()<2,"No Entry",$P{List}.get(1)) As an example for the second column. The subreport in question compiles without any error, but the main report crashes when I try to fill it. There surely is something that I'm doing wrong, but I even tried using that expression in a variable and print the variables content in the field, same result, same error. I get the feeling Jasper evaluates the whole statement, sees "Oh, I can't get into the else case because the list is to small" and crashes, even though it could perfectly use the if-case. Is there a workaround or a real solution to this problem?
×
×
  • Create New...