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. As I'm not so familiar with using ReportBooks (as I've used to build "normal" reports in my Jasper-career, so when I start it was version 0.5.3 when I remember right) I can't answer this question for 100% sure - sorry. But when you've designed one (main) report for getting all rooms and for each room-record a SubReport is called like I suggested above, then of course also all new rooms from 11 to 20 (... even to Integer.MAX I guess) will cause a new SubReport-Run and so you will get 20 different pages/subReports. Perhaps I will find some time to take TrialAndError a bit with the ReportBook feature to learn about it more ... but the sparetime is rare + the family + other tasks ... :-O regards C-Box
  2. What version of JasperReports and Java are you using? Seems that there are some old libraries involved!?!? Perhaps it's also better posted in phpjasper community and not here. hth + regards C-Box
  3. In your SubReportElement you just need to define the SubReportParameter by Name... so no $P{} logic is required there for the name of the SubReportParameter. so just call it "subtirid" instead of "$P{subtirid}" hth + regards C-Box
  4. Not sure what you want with a dropdown or anything like this. But as I understand you run a main query that will return several room-ids in a resultset. Let's say room-id 1 to 10. So now you want to run a Report that shows each visitors of each single room. So that e.g. 10 different pages will be printed and each of them just shows the visitors of the 10 rooms in our example. So this is what I meant with the MainReport and SubReport logic. The main report has no actual design and is just responsible to loop through the rooms. (select * from rooms) In the detail band of the main report you create a SubReport element and pass the current room-id as a SubReport-Parameter let's call "ParentRoomID" with expression $F{roomID} In you SubReport (an own jrxml.design) you now create a ReportParameter with the same name ("ParentRoomID") and in the SubReport-Query you can use this parameter within your where condition (e.g. Select * from visitors where visitors.room_id = $P{ParentRoomID}) In the SubReport (the jrxml) you now can define the whole layout based on the visitors of the (current) room. So this is a typical usage scenario of how to call a report x-times based on a (parent) query You also can define different SubReports for different room types or whatever you could imagine and use a PrintWhenExpression or an If.Then.Else expression based on a certain room field to use different layout if needed... so the limit is the sky ;-) hth + regards C-Box.
  5. There is also a Virtualizer for running large reports. We used this for generating large stock or calculation based reports within our ERP-System some years ago where some Reports runs took even several hours and not to run into the OutOfMemory we used the (GZip)Virturalizer logic - Worked fine when I remember right. ;-) http://jasperreports.sourceforge.net/sample.reference/virtualizer/index.html hth + regards C-Box
  6. Well it sounds more, that he has a MasterQuery and the results of this are the feed for the actual running reports. So I would create a TopMost Report with the Query and use a SubReport for running the actual reports. The resulting field values from MasterQuery can be passed as SubReport-Parameters down to the nested SubReport(s) and there used within the SubRepoprt-Queries. I guess each SubReport should have it's own page count and so on, so a group at master level would be helpful with flag "StartOnNewPage" and also ResetPageNumber (if he wants to use PageHeader/-footer of MasterReport). Perhaps also the ReportBook Feature of JasperReports would be helpful, as this is thought for combining several different (Sub)Reports to a kind "Book of Reports" !??! So let us know what you want to reach! ;-) hth + regards from Germany C-Box
  7. Well it's clear that you want to pass the current primary key from the field-value ... So let's try to describe: In your MAIN Report (jrxml) you have a SubReport1 (as Element)... at this SubReportElement you define a so called "SubReportParameter" with a name e.g. "TopMostPrimaryKey" and as parameter-expression you define the current field (e.g. $F{YourFieldForPrimaryKeyAtMainLevel} ) In your SubReport (jrxml) you then define a "normal" ReportParameter with the same name (e.g. "TopMostPrimaryKey") and the matching class type (Integer/String/whatever) in your SubReport (jrxml) query you then can integrate this parameter in your where condition (e.g. WHERE SubTable.ParentKey = $P{TopMostPrimaryKey} ) That's actually all. :-) So you will now just return the results from the first Main record + the nested records with the first primary key... then the SubReport returns and the next record from Main query will be called and the SubReport is also called with the second primary key... and so on.... now a bit clearer? hth + regards C-Box
  8. I just would try to wrap the Barbecue/Barcode4J rendering into an own ToolsClass e.g."MyColorBarcodeProducer" and use the public API of both barcode libraries to render the image by your own color (that you perhaps also could pass as a simple String parameter to the wrapper method) As ImageExpression you could then use something like this: MyColorBarcodeProducer.renderEAN13($F{TheBarcodeContentFromYourField}, "red") The method just returns the image as PNG/SVG and Jasper renders it. hth + regards C-Box
  9. No Problem, I would advice using SubReports (no List-Elements !) for that purpose. Just pass the current primary key down to the SubReport as Parameter and use it for your SubQuery. hth + regards C-Box
  10. Well you could remote debug the Studio and use the OpenSource ZIP for stepping through the source... but it could be a pain if you don't know where to start and what to skip. Perhaps you should better describe your problem and someone can help you?!? a first step could already be to place the parameters $P{...} somewhere in the Title band and use a expression like this: $P{MyFirstParameter} == null ?"MyFirstParameter is null": "MyFirstParameter is not null but: "+$P{MyFirstParameter}.toString() [/code]hth + regards C-Box
  11. You should use a copy of your passed JRBeanCollectionDataSource if you use it multiple times in SubReports. Otherwise the internal pointer to the next record will be forwarded so that the data are just shown once. So you can use the clone() method for that purpose in your SubReport DataSourceExpression, when I remember right. ;-) hth + regards C-Box
  12. Why not just: !$P{Parameter1}.isEmpty()[/code]the PrintWhenExpression just needs a boolean value, as isEmpty() already returns true/false there is actually no need to convert it to a String and compare the 'false' string value. Just my two cents. regards C-Box
  13. Can't you just invert the lable expression itself again, when this is the only problem?!? :-) just an idea - not tried. Otherwise create a small ChartCustomizer and set the invertion flag to the plot, then you probably won't negate the values before ChartPanel.getChart().getXYPlot().getRangeAxis().setInverted(true) hth + regards C-Box
  14. Have you overridden the proxy settings within your eclipse IDE (window --> preferences --> general --> network connections) or do they match to the sytstem ones? Otherwise the eclipse logs will perhaps help?!? regards C-Box
  15. Hi Seve, You must remove the bold attributes not by the editor but instead in jrxml (manually). If you set the bold property ONCE to true in iReport via GUI and then remove it also via GUI the (iReport) designer will explicit set the attribute to "isBold = false"... and that will overwrite the matching conditional style1 setting later! So I can still see those attributes within your frame: <frame> <reportElement style="Style1" x="0" y="0" width="750" height="40" uuid="524d0460-5388-4c98-af03-09ab356b3c24"/> <textField isBlankWhenNull="true"> <reportElement style="Style1" stretchType="RelativeToTallestObject" x="337" y="4" width="128" height="15" uuid="43cc7638-27a5-4526-bcdf-5c34adc4ed08"/> <textElement> <font fontName="Arial" size="9" isBold="false"/> </textElement> <textFieldExpression><![CDATA[$F{Entry Date}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement style="Style1" x="612" y="4" width="128" height="15" uuid="635476fb-ab07-4879-8ccb-de459d569484"/> <textElement> <font fontName="Arial" size="9" isBold="false"/> </textElement> <textFieldExpression><![CDATA[$F{Analyst Assigned}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement style="Style1" x="465" y="4" width="147" height="15" uuid="38c3db87-85f6-4cce-92a1-802c1f7799d0"/> <textElement textAlignment="Left"> <font fontName="Arial" size="9" isBold="false"/> </textElement> <textFieldExpression><![CDATA[$F{Due Date}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement style="Style1" stretchType="RelativeToTallestObject" x="113" y="4" width="118" height="15" uuid="563989e3-f924-4eff-9913-12fcc39ae270"/> <textElement> <font fontName="Arial" size="9" isBold="false"/> </textElement> <textFieldExpression><![CDATA[$F{State}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement style="Style1" x="231" y="4" width="106" height="15" uuid="04ad1100-727d-40d7-93e0-ea0b635b761f"/> <textElement> <font fontName="Arial" size="9" isBold="false"/> </textElement> <textFieldExpression><![CDATA[$F{Region}]]></textFieldExpression> </textField> <textField isBlankWhenNull="true" hyperlinkType="Reference" hyperlinkTarget="Blank"> <reportElement style="Style1" stretchType="RelativeToTallestObject" x="0" y="4" width="113" height="15" forecolor="#0033CC" uuid="5c43edce-cdd1-4a09-afa8-f23dc2700bca"/> <textElement> <font fontName="Arial" size="9" isBold="false" isUnderline="true"/> </textElement> <textFieldExpression><![CDATA[$F{Case Number}]]></textFieldExpression> <hyperlinkReferenceExpression><![CDATA[$F{URL}+"workflow.do?dataObjectKey=object.record&trackingId="+$F{ID}]]></hyperlinkReferenceExpression> </textField> </frame> just try to remove these "senseless" tags (as "not bold" is normally by default and must not set explicit in desgin) and try again ;-) hth + regards C-Box
  16. isn't your date column in your database of type DATE or DATETIME? Don't understand why you query with formatted string (so I interpreted your initial question)?!? Or is the column in database of type CHAR/VARCHAR? So we also query data params (report parameter type = java.util.date) by the user and it's either if the user has german pattern or english one, so the input is always in locale pattern and automatically transfered as java.util.date to the jasperreports query engine no matter if the user entered in "dd.mm.yyyy" or "yyy-mm-dd" pattern?!?! regards C-Box
  17. You should set the Style1 to the TextFields within your frame as well to apply the bold font style when the condition matches. (the frame itself doesn't have any font attributes!) Also remove the cureent set isBold flag at the textfield elements itself, as they will overwrite the StyleSettings. hth + regards C-Box
  18. Take a look here... there I described how to set a default value for the last day in last month (something similiar to your question) using the shipped with Apache Library for the DateUtils. https://community.jaspersoft.com/questions/1122406/expression-editor-last-day-last-month hth + regards C-Box
  19. Well you should pass the current Field-value $F{ID_Customer} to the SubReport as a so called SubReportParameter with name e.g. "Para_ParentCustomerID" from MainReport at the SubReport-Element. Inside the SubReport itself you create a Parameter $P{Para_ParentCustomerID} (the same name is important!) and use this within the SubReportQuery. E.g. Select * From Adresses Where ID_Customer = $P{Para_ParentCustomerID}[/code]That's all.. then the SubReport should filter out just the matching adress(es) from the current MainReport customer. hth + regards C-Box
  20. Well I just tried it out... works fine: <?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="RightToLeft" language="groovy" columnCount="2" columnDirection="RTL" pageWidth="595" pageHeight="842" columnWidth="277" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="f6df8c7d-9bf5-4eed-9361-eb7e1f75d5e4"> <property name="ireport.zoom" value="1.0"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <background> <band splitType="Stretch"/> </background> <title> <band height="79" splitType="Stretch"/> </title> <pageHeader> <band height="35" splitType="Stretch"/> </pageHeader> <columnHeader> <band height="61" splitType="Stretch"/> </columnHeader> <detail> <band height="44" splitType="Stretch"> <textField> <reportElement x="29" y="0" width="249" height="20" uuid="217a07db-0379-41f2-8724-fc68379da58f"/> <textFieldExpression><![CDATA["RecordNumber: "+ $V{REPORT_COUNT}]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band height="45" splitType="Stretch"/> </columnFooter> <pageFooter> <band height="54" splitType="Stretch"/> </pageFooter> <summary> <band height="42" splitType="Stretch"/> </summary> </jasperReport> Or is this not what you want? hth C-Box
  21. But there is an page-break element in your first detail band (at y=120)? As you wrote "you don't want a page break between the bands", why did you placed a break element there? Additionally I would NOT advice using StretchType RelativeToTallestObject for both table elements? I can't imagine any wanted effect where both tables should stretch against the biggest one in the second detail!??! Or why did you adjust that? hth + regards C-Box
  22. Please post some jrxml snippets (or the whole jrxml) to see what causes that break... there are too many reasons, that can result in unwanted breaks. regards C-Box
  23. As you don't pass any data nor use a query that returns any results inside your subReport this SubReport doesn't iterate through any records. So no detail is rendered at all. So I would advice to use the "NoDataSection" in your SubReport for your static text sample and set the ReportProperty "WhenNoDataType" to "No Data Section" in the subreports jrxml. Otherwise you could also pass an JREmptyDataSource as SubReport-DataSourceExpression instead the ReportConnection, so that the SubReport will render some dummy contents as well. Or you place the static text just into the Title band of your SubReport and use "WhenNoDataType" = "AllSectionsNoDetail" to see whether your SubReport is called at all. Or last but not least - just create a query within the SubReport that will return some records. ;-) hth + regards C-Box
  24. You could ORDER BY your Average Column already in your sql-query and use the ROW_NUMBER() or perhaps better the RANK() Function to number these results in a separate column e.g. "Position" In your Report you can then use the built-in JasperOrdering (sort menue/button in iReport) by the field "$F{StudentName}" again, to alphabetical order by students name. Not tried, but worth to give it a try. hth + regards C-Box
  25. Suggestion: "Visit".equalsIgnoreCase($P{TypeDate}) ;-) hth + regards C-Box
×
×
  • Create New...