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

sean.1.barry

Members
  • Posts

    3
  • 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 sean.1.barry

  1. I have a Jasper report that is iterating over a list of data returned by a query and displaying the data in tabular format. Depending on the number of table rows the contents of the table might be split across two pages. Is there a way to prevent this data splitting and cause the entire table to appear on the next page if it doesn't all fit on the current page? The detail band of my report is as follows: <detail> <band height="100" splitType="Prevent"> <componentElement> <reportElement x="0" y="0" width="800" height="20" isPrintWhenDetailOverflows="true" uuid="3e389075-14ca-4f57-9d02-175fbc34a639"/> <jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical"> <datasetRun subDataset="output" uuid="acf7113d-1f5a-4acc-ad2c-70efb491bb4f"> <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRMapCollectionDataSource($F{output})]]></dataSourceExpression> </datasetRun> <jr:listContents height="60" width="800"> <textField> <reportElement isPrintRepeatedValues="false" x="0" y="20" width="555" height="20" uuid="156e4ef8-b8d9-4dc4-8a50-4f27e0f36a83"/> <textFieldExpression><![CDATA[$F{reference}]]></textFieldExpression> </textField> <componentElement> <reportElement x="0" y="40" width="200" height="20" uuid="3e389075-14ca-4f57-9d02-175fbc34a639"/> <jr:list printOrder="Vertical"> <datasetRun subDataset="unitDetails" uuid="acf7113d-1f5a-4acc-ad2c-70efb491bb4f"> <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRMapCollectionDataSource($F{units})]]></dataSourceExpression> </datasetRun> <jr:listContents height="40" width="800"> <textField> <reportElement x="0" y="0" width="100" height="20" uuid="ead7d8ba-12e2-4a0e-af92-66a50b34148f"/> <textFieldExpression><![CDATA[$F{businessUnit}]]></textFieldExpression> </textField> <componentElement> <reportElement x="0" y="20" width="800" height="20" uuid="85e29233-08b3-4717-b260-82c9e4a003c5"/> <jr:table> <datasetRun subDataset="codeDetails" uuid="1f5dfa57-f961-4574-b663-8637b2aa6f6e"> <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRMapCollectionDataSource($F{codes})]]></dataSourceExpression> </datasetRun> <jr:column width="100" uuid="f832562c-1459-44a4-89df-fe5feadfe7ee"> <jr:detailCell height="20"> <textField> <reportElement x="0" y="0" width="100" height="20" uuid="e2ce6b92-bf8a-45f8-936a-af99b2ced4e7"/> <textElement textAlignment="Left"/> <textFieldExpression><![CDATA[$F{code}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> <jr:column width="150" uuid="b8c51d7d-f4d2-47c9-90a8-2449dff2a9f9"> <jr:columnHeader height="20"> <staticText> <reportElement x="0" y="0" width="150" height="20" uuid="2fc57842-d68d-4398-a0df-4eddd74316fd"/> <textElement textAlignment="Right"/> <text><![CDATA[Total]]></text> </staticText> </jr:columnHeader> <jr:detailCell height="20"> <textField> <reportElement x="0" y="0" width="150" height="20" uuid="b2953321-ce5d-4e5f-94e3-8b48b49bbf90"/> <textElement textAlignment="Right"/> <textFieldExpression><![CDATA[$F{total}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> <jr:column width="150" uuid="f8e255a7-951d-43ad-962b-f4ee32efaa80"> <jr:columnHeader height="20"> <staticText> <reportElement x="0" y="0" width="150" height="20" uuid="69deede1-0fbc-4fd0-b430-4f0f3cacdc4f"/> <textElement textAlignment="Right"/> <text><![CDATA[Approved]]></text> </staticText> </jr:columnHeader> <jr:detailCell height="20"> <textField> <reportElement x="0" y="0" width="150" height="20" uuid="200263e0-f9fb-4626-8cee-3eb838d51add"/> <textElement textAlignment="Right"/> <textFieldExpression><![CDATA[$F{approved}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> <jr:column width="150" uuid="b4d8feb1-4134-4302-bad1-902685238d3e"> <jr:columnHeader height="20"> <staticText> <reportElement x="0" y="0" width="150" height="20" uuid="096581a7-beec-43bc-a17e-ce96c4384838"/> <textElement textAlignment="Right"/> <text><![CDATA[Rejected]]></text> </staticText> </jr:columnHeader> <jr:detailCell height="20"> <textField> <reportElement x="0" y="0" width="150" height="20" uuid="3c5d019f-c4af-479b-b180-d52a6606d4e0"/> <textElement textAlignment="Right"/> <textFieldExpression><![CDATA[$F{rejected}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> </jr:table> </componentElement> </jr:listContents> </jr:list> </componentElement> </jr:listContents> </jr:list> </componentElement> </band> </detail> The report output looks like the following where the bottom of the page has the table headings but not the contents because the contents don't fit.
  2. Hi, I have a Jasper Report with a couple of date parameters for from and to dates. <parameter name="fromDate" class="java.util.Date" /> <parameter name="toDate" class="java.util.Date" /> I am wanting to use these in a date comparison against a createdDate field that is stored in my MongoDB database as an ISODate $match : { "createdDate": { $gte: "$P!{fromDate}", $lt: "$P!{toDate}" } } This doesn't work in terms of not returning any results so I created a variable to convert the date parameter to the ISODate format: <variable name="formattedFromDate" class="java.lang.String"> <initialValueExpression><![CDATA[DATEFORMAT($P{fromDate}, "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")]]></initialValueExpression> </variable> I then changed the $match stage of the pipeline to: $match : { "createdDate": { $gte: ISODate("$V!{formattedFromDate}") } } Again this didn't return any results when it should have but did when I hard-coded it to the value I was setting for the report as a parameter: $match : { "createdDate": { $gte: ISODate("2020-01-01T00:00:00.000Z") } } Any ideas what I'm doing wrong? Unfortunately I can't keep the from and to dates as hard-coded values as the user needs to be able to select these.
  3. Hi, I am trying to create a Dataset in Jasper Studio that queries a MongoDB dataset but that uses a MongoDB view rather than a collection, is this possible? I get the following when I try but not sure if it would work with a newer version of Jasper Studio, Jasper Server or MongoDB. The MongoDB version I'm using is 3.6. "Reason: Namespace . is a view. Legacy find operations are not supported on views. Only clients which support the find command can be used to query views." Any ideas? Thanks, Sean
×
×
  • Create New...