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

aanderso

Members
  • Posts

    11
  • Joined

  • Last visited

aanderso's Achievements

Apprentice

Apprentice (3/14)

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

Recent Badges

0

Reputation

  1. I have a report where I need to count how may times the status value of a field is the string "WARNING" or "ERROR", and display these in different field (or variables) in the summary band. So, the Total Warnings field in the Summary will have the number of times "WARNING" appeared, and the Total Errors field will have a count of the number of times "ERROR" appeared in the same report Field. I KNOW there is an easy, straightforward way to do this, but cannot find it anywhere, and I have been trying different things all day to no avail. Does anyone know how to do this?
  2. I am using JR 2.0.3 (yes, a bit dated), and JasperAssistant 2.4.2. I set the tooltop popup to show the entire contents of a field. In other words, the way the form must be layed out (per Customer) does not allow us to display all the data in the field, so when the field length > 72 character, I put an ellipsis on the end, and set the tooltip to show the entire field. All this works as designed. This presents a problem when the Customer wants to visually scan thru the "hidden" part of the field with the tooltip pop-up, since it is only up for 3 seconds. I can hardly tell them to "learn speed-reading". Is there a way for us to change the time of the pop-up from 3 seconds to say 8 seconds? Yes, I understand that it may be for every report that uses them (if I have to rebuild our Jasper), but that is a plausible solution set for these Users. Thanks for a great product!
  3. One of the other programmers did manage to get all the pages for a single base to paginate together, and for each to be on a separate page. He did this by waiting until fillReport came back for each base, then appending to the already display-formatted report(s) by adding to the 'pages' list. The upper-level report had IGNORE_PAGINATION=FALSE, so it "broke" on each base. As you can imagine, this messed up the print and export, but the display worked fine. That is, all of one base scrolled as it should have in the display on the CRT, but exporting them exported the same way: pages with lots of data were too small to be read because each entire page [base] was scaled onto one physical page. Ditto the printing. What we really wanted to accomplish was to make the display work differently than export or print. At first, I thought I'd just make a main report that contained one subreport for each base -- as if we were going to page break on the base field. That subreport would contain only the other 5 sub-reports. It quickly became apparent that this was not working, and I struggled to find out why. I did noticed that there did not seem to be any way to set pagination at run time. When I traced into the Jasper code, it was immediately obvious from one of your comments -- as well as the code -- that the upper level report would determine paging. A final question: How does one earn karma? I have replied to a couple of posts from others, but I do not know if that counts toward karma. Thanks again, Lucien. Post Edited by aanderso at 07/07/2010 06:17 Post Edited by aanderso at 07/07/2010 06:18
  4. Thanks for the response... it doesn't seem to make sense, but it does for what they want. For display purposes, each of the upper-level sub-reports represents a base. Each base has multiple sub-reports,and should be displayed as a single scrollable page (unpaginated). So, they can see all the subreports for that base on the same scrollable "page". For print (and file saving/export) purposes, it must page/print as normal, otherwise all of one base would be squeezed onto a single page, thus too small to read (I tried this for PDF, and it is unreadable if there are many entries for the base subreports). Each of the subreports is a JRBeanCollectionDataSource of its own, and has different data format and titles. I tried putting the base field into the upper level report, and breaking on that field to a new "page", but if it is unpaginated, it effectively means nothing; if it is paginated, it does not display properly due to the restriction you mentioned on the master report. I saw that in the code, but was hoping there was some way around it. Also, I tried a number of other scenarios, and either it pages normally (not what they want), the master report title does not appear on pages properly (yes, I checked/changed the properties), or it seemed to implode and gave me a mashup of unacceptable (to our customer) output. Thanks again for a great product and support! I love Jasper, and would like to contribute to the effort at the point where I feel competent enough to do so.
  5. In the detail band of the subreport , you can physically insert text similar to the code below with a regular text editor if the GUI does not offer the option. I use Jasper Assistant, and that field won't have anything displayed (if I have not previously set it)... until I click on it an it drops down the option.All the GUIs are currently way behind JR in functionality. The options are: "Relative to Tallest Object", "Relative to Band Height", and "No stretch" See code below. Regards... AndyX Code:[code] <detail> <band height="16"> <frame> <reportElement style="RowShader" stretchType="RelativeToTallestObject" mode="Opaque" x="2" y="-1" width="732" height="16" isPrintWhenDetailOverflows="true"/> <box padding="0" topBorder="1Point" topBorderColor="#C0C0C0" leftBorder="None" leftBorderColor="#FFFFFF" bottomBorder="None" bottomBorderColor="#C0C0C0" rightBorder="None" rightBorderColor="#FFFFFF"/>
  6. Also, you should make the first subreport position type 'Fix Relative to Top', and the second (and any others) position type = 'Float'. this allows the 2nd and subsequent sub-reports to float down out of the way of the prior report. AndyX
  7. I have an upper level report, say Report A, that contains only a subreport. I have set the ignore pagination flag to false in the designer (XML). The subreport, say subreport B, contains only 5 subreports, but not all 5 may appear depending on the print When expression. Subreport B has the XML ignore paginate flag set to true so that all the subreports on B appear on one "page". At runtime the whole report seems to run without pagination for the display (we use a viewer class to view the report, then exporters for PDF, etc.). When it prints, however, it puts out a blank first page and everything paginates and there is no break on the group field. shouldn't the xml cause jasper to print paginated pages (Report A) of unpaginated pages (Report B)? BTW, each of Report B's subreports have ignore pagination = true, and they are on separate sub-reports since each has different data and format. BTW, this question relates to JasperReports 2.0.3, which is compatible with JasperAssistant that we licensed years ago. Maybe this is fixed in a newer release? Is this a bug in JR -- and more importantly, is it still a bug?Is it a limitation of JR to use only a single style of pagination? I do see comments/code that seems to indicated that the uppermost level's pagination is passed to the lower level. Code: Post Edited by aanderso at 06/28/2010 10:15 Post Edited by aanderso at 06/28/2010 10:16
  8. I have an upper level report, say Report A, that contains only a subreport. I have set the ignore pagination flag to false in the designer (XML). The subreport, say subreport B, contains only 5 subreports, but not all 5 may appear depending on the print When expression. Subreport B has the XML ignore paginate flag set to true so that all the subreports on B appear on one "page". At runtime the whole report seems to run without pagination for the display (we use a viewer class to view the report, then exporters for PDF, etc.). When it prints, however, it puts out a blank first page and everything paginates and there is no break on the group field. For Report A, we have something like this: <... snip ...> <jasperReport name="FAReserveSingleBaseSubRpt" pageWidth="791" pageHeight="612" orientation="Landscape" columnWidth="791" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" isIgnorePagination="false"> <parameter name="reporttype" class="java.lang.String" isForPrompting="false"/> <parameter name="forDate" class="java.lang.String" isForPrompting="false"/> <parameter name="sections" class="java.lang.String" isForPrompting="false"/> <parameter name="reportPath" class="java.lang.String" isForPrompting="false"/> <parameter name="printAirportStandby" class="java.lang.String" isForPrompting="false"> <... snip...> <detail> <band height="50"> <subreport isUsingCache="false"> <reportElement stretchType="RelativeToTallestObject" x="3" y="2" width="755" height="43" isPrintWhenDetailOverflows="true"/> <... snip ...> <subreportParameter name="reportDate"/> <subreportParameter name="base"/> <subreportParameter name="printAirportStandby"/> <subreportParameter name="sections"/> <subreportParameter name="forDate"/> <subreportParameter name="ending"/> <subreportParameter name="schedPeriod"/> <subreportParameter name="reporttype"/> <subreportParameter name="beginning"/> <subreportParameter name="position"/> <dataSourceExpression><![CDATA[$F{baseSubRptList}]]></dataSourceExpression> <subreportExpression class="java.lang.String"><![CDATA["crewreports/definition/FAReserveSingleBaseSubRpt.jasper"]]></subreportExpression> </subreport> </band> </detail> On Report B, we have: <jasperReport name="FAReserveSingleBaseSubRpt" pageWidth="791" pageHeight="612" orientation="Landscape" columnWidth="791" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" isIgnorePagination="true"> <property name="com.jasperassistant.designer.Grid" value="false"/> <property name="com.jasperassistant.designer.SnapToGrid" value="false"/> <property name="com.jasperassistant.designer.GridWidth" value="12"/> <property name="com.jasperassistant.designer.GridHeight" value="12"/> <parameter name="printAirportStandby" class="java.lang.String" isForPrompting="false"/> <parameter name="printUnassigned" class="java.lang.String" isForPrompting="false"/> <parameter name="printDeparting" class="java.lang.String" isForPrompting="false"/> <parameter name="printReturningToBase" class="java.lang.String" isForPrompting="false"/> <parameter name="printReturningOOB" class="java.lang.String" isForPrompting="false"/> <field name="airportStandBySubRptList" class="net.sf.jasperreports.engine.data.JRBeanCollectionDataSource"/> <field name="unassignedSubRptList" class="net.sf.jasperreports.engine.data.JRBeanCollectionDataSource"/> <field name="departingSubRptList" class="net.sf.jasperreports.engine.data.JRBeanCollectionDataSource"/> <field name="returningToBaseSubRptList" class="net.sf.jasperreports.engine.data.JRBeanCollectionDataSource"/> <field name="returningOutOfBaseSubRptList" class="net.sf.jasperreports.engine.data.JRBeanCollectionDataSource"/> <detail> <band height="225"> <subreport isUsingCache="false"> <reportElement x="2" y="2" width="744" height="33"/> <dataSourceExpression><![CDATA[$F{airportStandBySubRptList}]]></dataSourceExpression> <subreportExpression class="java.lang.String"><![CDATA["crewreports/definition/FAReserveRptAirportStandBySubRpt.jasper"]]></subreportExpression> </subreport> <subreport isUsingCache="false"> <reportElement positionType="Float" x="1" y="45" width="744" height="33"/> <dataSourceExpression><![CDATA[$F{unassignedSubRptList}]]></dataSourceExpression> <subreportExpression class="java.lang.String"><![CDATA["crewreports/definition/FAReserveRptUnassignedSubRpt.jasper"]]></subreportExpression> </subreport> <subreport isUsingCache="false"> <reportElement positionType="Float" x="2" y="88" width="744" height="33"/> <dataSourceExpression><![CDATA[$F{departingSubRptList}]]></dataSourceExpression> <subreportExpression class="java.lang.String"><![CDATA["crewreports/definition/FAReserveRptDepartingSubRpt.jasper"]]></subreportExpression> </subreport> <subreport isUsingCache="false"> <reportElement positionType="Float" x="2" y="131" width="744" height="33"/> <dataSourceExpression><![CDATA[$F{returningToBaseSubRptList}]]></dataSourceExpression> <subreportExpression class="java.lang.String"><![CDATA["crewreports/definition/FAReserveRptReturningToBaseSubRpt.jasper"]]></subreportExpression> </subreport> <subreport isUsingCache="false"> <reportElement positionType="Float" x="2" y="175" width="744" height="33"> <printWhenExpression><![CDATA[new Boolean($P{printReturningOOB} == "Y")]]></printWhenExpression> </reportElement> <dataSourceExpression><![CDATA[$F{returningOutOfBaseSubRptList}]]></dataSourceExpression> <subreportExpression class="java.lang.String"><![CDATA["crewreports/definition/FAReserveRptReturningOutOfBaseSubRpt.jasper"]]></subreportExpression> </subreport> </band> </detail> </jasperReport> shouldn't the xml cause jasper to print paginated pages (Report A) of unpaginated pages (Report B)?
  9. It turns out there is a different way also. In JasperAssistant editor, just double-click the textfield and enter: ($F{name}.trim().length()> 25 ? $F{name}.substring(0,24) : $F{name}.trim()) This results in the XML below, and will fill out the field nicely. The only downside is that if you change the font size or style (or the field size), you'll have to redo the tertiary above or the results may not be quite what you expect. Thanks for the help! Code:<textField isStretchWithOverflow="true" hyperlinkType="None"><reportElement isPrintRepeatedValues="false" x="92" y="1" width="140" height="12"/> <textElement textAlignment="Left" verticalAlignment="Middle"> <font fontName="Courier New" size="9" pdfFontName="Courier"/> </textElement> <textFieldExpression class="java.lang.String" ![CDATA[($F{cmname}.trim().length()> 25 ? $F{cmname}.substring(0,24) : $F{cmname}.trim())]]></textFieldExpression></textField>
  10. Thanks, C-Box! Unfortunately, I am not using IReports, and JasperAssistant (my version) does not list this property. Can you tell me where the DTD/Schema is for JR 2.0.2 or 2.0.3?
  11. We are using JR 2.0.2, and the forms were designed with JasperAssistant (and usually hand-modified via xml editor). I have a text field on the form that is wide enough to hold 16 characters using Courier New 10 point, which I am using to hold names. The names occur as LAST, FIRST <other freeform text>. When the name exceeds 16 characters, the first name -- or <other freeform text> -- containing space often does not print. However, if the input to the field is 22+ characters or more WITHOUT intervening spaces, then the field is truncated at 22. For example, two names are "THOMPSON, CALVIN" and "THOMPSON, CALVINA". The first example prints the entire name ( "THOMPSON, CALVIN"), but the second leaves off the "CALVINA" entirely and prints only ("THOMPSON, ")! What I'd expect it to do is truncate the terminal 'A' in Calvina. In other words, the text field should print as much text as possible for the available field size and font. I could not find any attribute that changes this behaviour. The report is being run locally on my own machine, and whether I use the Sun JDK 1.5 or IBM (RAD 7) JDK (also supposedly 1.5). We cannot allow the field to grow on overflow, and the line already has too many fields to make the name field bigger. Have I missed something, or is this a bug? Is there a fix in some later version? Thanks for the help, Andy
×
×
  • Create New...