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

stig

Members
  • Posts

    25
  • 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 stig

  1. No ideas on how to solve this? Any attempts would be highly appreciated :) /stig
  2. Sorry, I meant to post this in the iReport forum. I have now created the same topic over there, so if any moderator wants to delete this topic here, feel free. New active topic: http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=87200
  3. I am having trouble finding the right way to use the Barcode tool in iReport 3.7 (using Java as language and collecting values from a database). I need it to create an EAN-128 barcode with two Application Identifiers in it, where each AI matches a different field in the database. Right now it seems the EAN-128 barcode is locked to AI (01) at the beginning, and then, on top of that, I can't seem to add others - does anyone have any idea how to solve this? Thanks! /stig
  4. I am having trouble finding the right way to use the Barcode tool in iReport 3.7 (using Java as language and collecting values from a database). I need it to create an EAN-128 barcode with two Application Identifiers in it, where each AI matches a different field in the database. Right now it seems the EAN-128 barcode is locked to AI (01) at the beginning, and then, on top of that, I can't seem to add others - does anyone have any idea how to solve this? Thanks! /stig
  5. I'm embarrased but also relieved to say that I simply haven't been able to see the forest for the trees - the solution was much simpler than I thought! :) For anyone interested, I replaced the linked calculation in point #3 above with a simple "distinct count" variable based on the date, which also worked perfectly (d'oh, why hadn't I thought of that before now...). Then I made a "sum" variable based on this new variable and set the increment type to "group" and increment group to "employee". Voila! Works like a charm! I'm sorry for having wasted your time with what turned out to be a quite trivial question :)
  6. Matt, thank you so much for your input. I'm afraid I don't know enough about coding to create an alternate version of the report. But I'll try to see if I can explain the main obstacle. The report is based on a time range search, and it consists of: an employee group with a sub group based on date, showing stats by day and by the full period a summary band where the stats for all employees/dates are combined Below, you can see the main points in the employee/date group - and all of these are working right now: NB: The lifted weight variables below are based on a lifted weight field that shows the weight that was lifted during one work process. It shows how much the employees have lifted individually per day This is done by summing the lifted weight in a variable (reset type:group reset group:date) It shows the total lifted weight for the entire period for the employee in question This is done by summing the lifted weight in a variable (reset type:group reset group:employee) It shows the total number of days included for the employee (used to show a weight average in another field) This is done as described in http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=11411These are the main points in the summary band - the first works, and the second does not work, which is the main issue: It shows how much all employees have lifted combined This is done by summing the lifted weight in a variable (reset type:report) It should show the total number of days included for all employees This I cannot get to work. I need a solution that shows the total number of days shown in the report - i.e. if the report shows two dates for employee A (e.g. "01 March, 2011", and "02 March, 2011"), and three dates for employee B (e.g. "01 March, 2011", "02 March, 2011", and "03 March, 2011") - then the result of this variable should be "5". In other words, it should stick to the total number of days shown, and not, for instance, show the total number of dates shown (as this would be 3 because there are only three different dates in this report). I have also stripped down the original report to only include the above points - see attached file. Does this help clear up what the issue is and what I'm after? Thanks again! /stig
  7. Nobody? :) My hair is starting to go grey and I started having nervous ticks because of this problem (ok, maybe I'm exaggerating....)!
  8. No one who can point me in the right direction here? /tools/fckeditor/editor/images/smiley/msn/regular_smile.gif All input is hightly appreciated!
  9. Hello I have a problem that I simply cannot resolve with my own (lack of?) logic - so I'm hoping you guys can help me out here :-) I have a report that has grouped employee pick weights by employee and date (i.e. first an employee group and then a date group). I have a group count function that counts how many days there is for each employee. This is done with the solution provided here: http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=11411 - and it works. However, I also need a total group count for all days for all employees combined in the summary band - and this I cannot get to work. It needs to be the total number of days, and not the total number of dates. In the attached image, you can see that the summary total for days does not add up (listed under the column header "Dage"). It says 2, but it should say 3 (as there are two days listed for the first employee and one day for the last employee). I have also attached the whole report in case you need it! Can any one help point me to a solution?
  10. Nobody who has any suggestions as to how I can solve this issue?
  11. I have a problem with a report where I need to show a count and a sum for some fields in a group. Background:The data source (JRDataSourceProvider) that I use is a record of all picks done by all employees including the individual pick weight for each pick. The report prompts for a from-to date that filters the results so that only entries made within the given period are included. In the report the information is first grouped by employee (EmployeeId) and then by the date the pick was carried out (StartDate). This means all entries for a given employee on a given date is shown as one single entry in the report (successfully executed mainly by sum variables in the group headers). So far, so good :-) Problem example:The problem occurs when I need to calculate the total number of days where an employee has carried out one or more picks. I was hoping to simply do a count variable of the printed dates - but this has proved harder than I had expected. This is because there are several entries for each date in the data source (because employees carry out multiple picks during one day), and thus an employee group count variable for the StartDate field might show the total as "200" for ten dates (meaning the employee carried out 200 picks during those ten dates and thus there are 200 entries in the data source for that date/employee combination). However, the total that I need is simply "10" since there are only ten dates involved. What I'm after:What I'm looking for (for sum/count calculations like the above) is basically a way to only include the data that is actually printed in the report (as opposed to all data in the data source) - or any kind of workaround :-) Please don't hesitate to ask if you need more info. Thanks! Post Edited by stig at 01/26/2010 10:39
  12. Hi baggypants, Thanks for responding :-) I understand what you mean by it not being wrong Java-wise. But I am hoping to find some way to adjust it, so that it fits with real life, so to speak :-) Do you know of any way that one can work around this issue?
  13. I have a java.util.date field for which I have specified the pattern "ww/yyyy". The pattern is shown correctly - for example, the date Dec 24 2009 is shown as "52/2009". However, the week numbers for 2010 seems to be off by one. For example, the date Jan 4 2009 is shown as "02/2010" - and, of course, it should be "01/2010". Is there any way to correct this for the field so that it shows the correct week number? Thanks, Stig
  14. That's OK, Giovanni, I understand. Thanks for your time and effort :) I'll have to see if I can figure it out myself - unless anyone else can jump in with an idea as to what I'm doing wrong?
  15. No, not a DB connection - I use a JRDataSourceProvider as data source.
  16. Hey Giovanni - thanks for not giving up on me :) I've tried to implement your attachments (including changing the paths to fit my local computer folders). Other than that, I've used your exact versions. The experiment was a partial success. It was a success in that I can now, in the main report, see the "Sub rpt showed" headline from the subreport. The not-so-successful part, however, is that, in the main report, I still cannot see any of the actual subreport data besides the mentioned headline (even though when running the subreport in itself, there is data in it). Any idea what could cause this lack of data? I have attached a couple of screenshots of the mainreport result (report1.PNG) and the data that the subreport shows in itself (report2.PNG).
  17. Christina, I use the drag&drop wizard for subreports - and I also use connection expression $P{REPORT_CONNECTION}. I have added the code for the two reports (reportmaster at the top and reportsub at the bottom). It's probably something very basic that I am missing due to my lack of java/report experience, so maybe you can deduce something from the code? Code:<?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="report4master" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"> <property name="ModelName" value="TimeHandlingWeightSpec"/> <property name="ireport.scriptlethandling" value="0"/> <property name="ireport.encoding" value="UTF-8"/> <property name="FinderName" value="findAll"/> <import value="net.sf.jasperreports.engine.*"/> <import value="java.util.*"/> <import value="net.sf.jasperreports.engine.data.*"/> <parameter name="FieldLabelMap" class="java.util.Map" isForPrompting="false"/> <parameter name="FinderDescription" class="java.lang.String" isForPrompting="false"/> <parameter name="Title" class="java.lang.String" isForPrompting="false"/> <parameter name="UserId" class="java.lang.String" isForPrompting="false"/> <parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false"> <defaultValueExpression><![CDATA["C:\\Users\\stig.AXACONAD\\Desktop\\reports\\New Folder\\"]]></defaultValueExpression> </parameter> <queryString> <![CDATA[]]> </queryString> <field name="Id" class="java.util.Date"> <fieldDescription><![CDATA[iD]]></fieldDescription> </field> <field name="WeightCoefficientId" class="java.lang.String"> <fieldDescription><![CDATA[Weight coefficient]]></fieldDescription> </field> <field name="WeightCoefficientTxt" class="java.lang.String"> <fieldDescription><![CDATA[Weight coefficient - text]]></fieldDescription> </field> <field name="WeightCoefficientValue" class="java.lang.String"> <fieldDescription><![CDATA[Weight coefficient - value]]></fieldDescription> </field> <field name="QtyAppliedTo" class="java.lang.Double"> <fieldDescription><![CDATA[Quantity the coefficient has been applied to]]></fieldDescription> </field> <field name="Contribution" class="java.lang.Double"> <fieldDescription><![CDATA[Contribution to weight]]></fieldDescription> </field> <field name="TimeHandlingId" class="java.lang.Integer"> <fieldDescription><![CDATA[Handling times ID]]></fieldDescription> </field> <field name="TimeStarted" class="java.util.Date"> <fieldDescription><![CDATA[start time]]></fieldDescription> </field> <field name="TimeFinished" class="java.util.Date"> <fieldDescription><![CDATA[End time]]></fieldDescription> </field> <field name="JobTypeId" class="java.lang.String"> <fieldDescription><![CDATA[Job type]]></fieldDescription> </field> <field name="JobGroupId" class="java.lang.String"> <fieldDescription><![CDATA[Job group]]></fieldDescription> </field> <field name="ProcessHistName" class="java.lang.String"> <fieldDescription><![CDATA[Pick round name]]></fieldDescription> </field> <field name="EmployeeId" class="java.lang.String"> <fieldDescription><![CDATA[Employee]]></fieldDescription> </field> <field name="ItemId" class="java.lang.String"> <fieldDescription><![CDATA[item]]></fieldDescription> </field> <field name="LocationId" class="java.lang.String"> <fieldDescription><![CDATA[Location]]></fieldDescription> </field> <field name="QtyAtLocationBeforeHandling" class="java.lang.Double"> <fieldDescription><![CDATA[Quantity on the location before handling]]></fieldDescription> </field> <background> <band splitType="Stretch"/> </background> <pageHeader> <band height="35" splitType="Stretch"/> </pageHeader> <columnHeader> <band height="32" splitType="Stretch"/> </columnHeader> <detail> <band height="80" splitType="Stretch"> <textField> <reportElement x="0" y="0" width="100" height="20"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[$F{EmployeeId}]]></textFieldExpression> </textField> <subreport> <reportElement x="0" y="25" width="555" height="50"/> <subreportParameter name="ID_PARAMETER"> <subreportParameterExpression><![CDATA[$F{EmployeeId}]]></subreportParameterExpression> </subreportParameter> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> <subreportExpression class="java.lang.String"><![CDATA[$P{SUBREPORT_DIR} + "report4sub.jasper"]]></subreportExpression> </subreport> </band> </detail> <columnFooter> <band height="36" splitType="Stretch"/> </columnFooter> <pageFooter> <band height="34" splitType="Stretch"/> </pageFooter> <summary> <band height="30" splitType="Stretch"/> </summary></jasperReport>------------------------------------------------------------<?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="report4sub" pageWidth="400" pageHeight="842" columnWidth="400" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0"> <property name="ModelName" value="Employee"/> <property name="ireport.scriptlethandling" value="0"/> <property name="ireport.encoding" value="UTF-8"/> <property name="FinderName" value="findAll"/> <import value="net.sf.jasperreports.engine.*"/> <import value="java.util.*"/> <import value="net.sf.jasperreports.engine.data.*"/> <parameter name="FieldLabelMap" class="java.util.Map" isForPrompting="false"/> <parameter name="FinderDescription" class="java.lang.String" isForPrompting="false"/> <parameter name="Title" class="java.lang.String" isForPrompting="false"/> <parameter name="UserId" class="java.lang.String" isForPrompting="false"/> <parameter name="ID_PARAMETER" class="java.lang.String" isForPrompting="false"/> <queryString> <![CDATA[]]> </queryString> <field name="Id" class="java.lang.String"> <fieldDescription><![CDATA[iD]]></fieldDescription> </field> <field name="WeightPrDay" class="java.lang.Integer"> <fieldDescription><![CDATA[Max lift]]></fieldDescription> </field> <field name="BufferWeightPct" class="java.lang.Integer"> <fieldDescription><![CDATA[Light lifts at]]></fieldDescription> </field> <field name="Name" class="java.lang.String"> <fieldDescription><![CDATA[Name]]></fieldDescription> </field> <field name="Warehouse" class="java.lang.String"> <fieldDescription><![CDATA[Default warehouse]]></fieldDescription> </field> <field name="EmployeeType" class="java.lang.String"> <fieldDescription><![CDATA[Type]]></fieldDescription> </field> <field name="WeightGender" class="java.lang.String"> <fieldDescription><![CDATA[Gender]]></fieldDescription> </field> <field name="WeightAge" class="java.lang.String"> <fieldDescription><![CDATA[Age]]></fieldDescription> </field> <field name="WeightHeight" class="java.lang.String"> <fieldDescription><![CDATA[Height]]></fieldDescription> </field> <field name="HandlingTypes" class="java.util.HashSet"> <fieldDescription><![CDATA[Allowed handling types]]></fieldDescription> </field> <field name="DispatchCodes" class="java.util.HashSet"> <fieldDescription><![CDATA[Dispatch codes]]></fieldDescription> </field> <field name="PickGroups" class="java.util.HashSet"> <fieldDescription><![CDATA[Allowed job groups]]></fieldDescription> </field> <field name="HandlingUnit" class="java.lang.String"> <fieldDescription><![CDATA[Handling unit]]></fieldDescription> </field> <field name="Owner" class="java.lang.String"> <fieldDescription><![CDATA[Default owner]]></fieldDescription> </field> <field name="CurrentPickRound" class="java.lang.String"> <fieldDescription><![CDATA[Current pick round]]></fieldDescription> </field> <field name="ReserveSpaceLocationPrefix" class="java.lang.String"> <fieldDescription><![CDATA[Location prefix on space reservation]]></fieldDescription> </field> <field name="CompanyId" class="java.lang.Integer"> <fieldDescription><![CDATA[Company ID]]></fieldDescription> </field> <field name="UserId" class="java.lang.String"> <fieldDescription><![CDATA[user ID]]></fieldDescription> </field> <field name="CompanyName" class="java.lang.String"> <fieldDescription><![CDATA[Company name]]></fieldDescription> </field> <field name="RemainingDayWithinHorizon" class="java.lang.Boolean"> <fieldDescription><![CDATA[Rest of day within horizon]]></fieldDescription> </field> <field name="HoursWithinHorizon" class="java.lang.Integer"> <fieldDescription><![CDATA[Hours within horizon]]></fieldDescription> </field> <field name="CurrentDayInMemory" class="java.lang.Boolean"> <fieldDescription><![CDATA[Current day in memory]]></fieldDescription> </field> <field name="HoursInMemory" class="java.lang.Integer"> <fieldDescription><![CDATA[Hours in memory]]></fieldDescription> </field> <field name="HorizonEnabled" class="java.lang.Boolean"> <fieldDescription><![CDATA[Horizon activated]]></fieldDescription> </field> <field name="MemoryEnabled" class="java.lang.Boolean"> <fieldDescription><![CDATA[Memory activated]]></fieldDescription> </field> <field name="ViewName" class="java.lang.String"> <fieldDescription><![CDATA[View name - postfix]]></fieldDescription> </field> <field name="WeightCoefficientAge" class="java.lang.String"> <fieldDescription><![CDATA[Weight coefficient for age]]></fieldDescription> </field> <field name="WeightCoefficientHeight" class="java.lang.String"> <fieldDescription><![CDATA[Weight coefficient for height]]></fieldDescription> </field> <field name="Gender" class="java.lang.String"> <fieldDescription><![CDATA[Gender]]></fieldDescription> </field> <field name="MaxWeightInMemory" class="java.lang.Double"> <fieldDescription><![CDATA[Max weight in memory]]></fieldDescription> </field> <field name="InspectionRatio" class="java.lang.Double"> <fieldDescription><![CDATA[inspection ratio]]></fieldDescription> </field> <variable name="variable1" class="java.lang.String"> <variableExpression><![CDATA[$F{Id}]]></variableExpression> </variable> <background> <band splitType="Stretch"/> </background> <columnHeader> <band height="38" splitType="Stretch"/> </columnHeader> <detail> <band height="53" splitType="Stretch"> <textField> <reportElement x="0" y="0" width="100" height="20"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[$F{Id}]]></textFieldExpression> </textField> <textField> <reportElement x="140" y="0" width="100" height="20"/> <textElement/> <textFieldExpression class="java.lang.Double"><![CDATA[$F{MaxWeightInMemory}]]></textFieldExpression> </textField> </band> </detail> <pageFooter> <band height="33" splitType="Stretch"/> </pageFooter></jasperReport>
  18. Hi again, Giovanni and Christina, Sorry for the late response to your kind attempts to help. Giovanni, I use the same method as you describe in #1-4, so I don't think these particular steps are where I mess things up. However, I think you are right that it is the link between the two reports that I am not establishing correctly. Christina, when having setup the "Subreport parameter name/Value expression", should I set up anything the subreport so that it "connects" with the mainreport and only shows the max weight for the Employees listed in the mainreport? Again, thanks for your time and effort!
  19. Hi Christina - thanks for helping! I have tried to connect the main/sub reports by adding a parameter in the "Sub reports properties -> Parameters" field. However, I am not sure that I have done this correctly, as I don't know the correct way to do it. If we forget all the other fields in the report just to simplify my problem, what I want is basically this: The main report should show a list of employees via the main report data source field "Employee". The sub report should show the max allowed weight (via a MaxAllowedWeight field) for a given employee (if it is of any importance: in the subreport's datasource, the field that defines the employee is called "Id"). I would like the link between the two reports to be the Employee/Id, so that for each single employee in the main report, the subreport shows that employee's max weight. Do you have any suggestion on how I can accomplish this?
  20. Hello again, Giovanni :-) I have tried to make a very simple report with a subreport (actually I have tried to make several simple reports with subreports). But I could not get any of them to work. As I mentioned, they work separately but as soon as I try to 'connect' them, the subreport shows no values in the main report :-(
  21. Anybody who has any pointers as to what I can do to get this to work? Any input is highly appreciated by a newbie who is completely stuck :-)
  22. I just tried your suggestion, Giovanni, but without any luck - it won't show any data from the subreport in the master report. Thanks for your time and effort, though! :-) Is there perhaps anyone else who can help me with my problem?
  23. I am off for the weekend now - but I will return Monday and test out your suggestion. Out of curiosity - does this suggestion also take into consideration that the value from the subreport should depend on which employee is shown in the master report? Again, thanks so much for your time. Have a great weekend :)
  24. Hi giobby, Thanks for replying, it is much appreciated! I mean that for each employee listed in the master report, I want the subreport to show the maxallowedweight for that employee. The maxallowedweight must be passed on to the master report from the subreport based on the employee field in master report. As mentioned the master report is grouped by employee. Example with three employees: 11/06/2009 (startdate) - John Smith (employee) - 125kg (currentliftedweight) - 300kg (maxallowedweight) - 175kg (variable showing diff) 11/06/2009 - Dave Olson - 200kg - 300kg - 100kg 11/06/2009 - Laura Brees - 100kg - 250 - 150kg
  25. Hello, I am a complete newbie not only with regard to iReport but with Java programming and databases in general. I have successfully created some simple reports based on a JRDataSourceProvider connection. At this point, i am trying to include a subreport in a simple report but without any luck. Procedure: I create the master report (report A) which extracts fields from a single model via the JRDataSourceProvider connection. The master report contains a startdate field, an employee field and a currentliftedweight field. The info is grouped by employee. I create a report (report B) which extracts fields from another model via the same connection. The report contains an employee maxallowedweight field. Separately, I can run the two reports successfully. But when I try to add the subreport (report B) to the master (report B) and feed info to/from the subreport my luck seems to run out. What I would like to happen is this: The employee field from the master report should be fed to the subreport and thus determine which employee's value the subreport should show. So the finished report should have 4 fields and a variable and look something like this (grouped by employee): Startdate - employee - currentliftedweight - maxallowedweight - [variable showing the difference btw current and max weights] I hope someone can help me out with some pointers. Please feel free to ask if you need info - I know that I am probably not easy to understand since I have absolutely no experience in these programming areas... Thanks, stig Post Edited by stig at 11/06/2009 10:37 Post Edited by stig at 11/06/2009 10:38
×
×
  • Create New...