![](http://content.invisioncic.com/i328763/set_resources_3/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
av-mihailov
-
Posts
4 -
Joined
-
Last visited
Content Type
Forum
Downloads
Featured Visualizations
Knowledge Base
Documentation (PDF Downloads)
Blog
Documentation (Test Area)
Documentation
Dr. Jaspersoft Webinar Series
Security Advisories
Events
Profiles
Posts posted by av-mihailov
-
-
Damn, I could use variables.
The question may be closed -
I know about it, but I want return field with DateTime type, because I'll use it in another function to count age, month and day on this date. And with this function my text field expression is very big
-
I want get date time from string field in JsonDataSource.
When I use Field Expression like "resource.*(resourceType=="resource1").datePerformed" returns value type String.
Example json:
{"resource":[
{
"resourceType":"resource1",
"datePerformed":"2020-06-19T13:23:00"}
]
}
Why functions not work with dataset?
in Products
Posted
If I use jasper reports functions with dataset I have an error: "net.sf.jasperreports.engine.JRException: net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression for source text: LEN($F{Field_1})".
If I don't use dataset report works.
Why reports don't work with functionts & dataset and how I can fix it?
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.13.0.final using JasperReports Library version 6.13.0-46ada4d1be8f3c5985fd0b6146f3ed44caed6f05 -->
<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="Blank_A4" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="51f620da-6991-46a6-ad13-631cb8b5ee83">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="TestDA"/>
<style name="Table_TH" mode="Opaque" backcolor="#F0F8FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table_CH" mode="Opaque" backcolor="#BFE1FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<subDataset name="Dataset1" uuid="c632fcbe-adff-4ac5-9aa2-7c30b90be897">
<queryString language="jsonql">
<![CDATA[]]>
</queryString>
<field name="Field_1" class="java.lang.String">
<property name="net.sf.jasperreports.jsonql.field.expression" value="..code.coding.code"/>
</field>
<field name="Field_2" class="java.lang.String">
<property name="net.sf.jasperreports.jsonql.field.expression" value="..code.coding.display"/>
</field>
</subDataset>
<queryString language="jsonql">
<![CDATA[]]>
</queryString>
<field name="Field_1" class="java.lang.String">
<property name="net.sf.jasperreports.jsonql.field.expression" value="..authoredOn"/>
</field>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="79" splitType="Stretch">
<textField>
<reportElement x="60" y="30" width="100" height="30" uuid="4f4d100b-fcbf-4807-8f9f-44a1caf1539b"/>
<textFieldExpression><![CDATA[LEN($F{Field_1})]]></textFieldExpression>
</textField>
</band>
</title>
<detail>
<band height="245" splitType="Stretch">
<componentElement>
<reportElement x="30" y="20" width="200" height="200" uuid="a24a68c6-6662-4c9b-bf20-0a0782410e21">
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
<property name="com.jaspersoft.studio.table.style.table_header" value="Table_TH"/>
<property name="com.jaspersoft.studio.table.style.column_header" value="Table_CH"/>
<property name="com.jaspersoft.studio.table.style.detail" value="Table_TD"/>
</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="Dataset1" uuid="3e7dd961-ede0-4307-af01-196291a64630">
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonQLDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("entry.resource(resourceType=="Observation")")]]></dataSourceExpression>
</datasetRun>
<jr:column width="50" uuid="95181416-82fd-495b-a885-70a3b2f7f414">
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Column1"/>
<jr:tableHeader style="Table_TH" height="30" rowSpan="1"/>
<jr:tableFooter style="Table_TH" height="30" rowSpan="1"/>
<jr:columnHeader style="Table_CH" height="30" rowSpan="1"/>
<jr:columnFooter style="Table_CH" height="30" rowSpan="1"/>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="50" height="30" uuid="0ecc44f6-4e70-4d00-b7be-b89868702dca"/>
<textFieldExpression><![CDATA[$F{Field_1}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="110" uuid="c764879f-21d7-4f51-ac1c-a7bef8a64ec0">
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Column2"/>
<jr:tableHeader style="Table_TH" height="30" rowSpan="1"/>
<jr:tableFooter style="Table_TH" height="30" rowSpan="1"/>
<jr:columnHeader style="Table_CH" height="30" rowSpan="1"/>
<jr:columnFooter style="Table_CH" height="30" rowSpan="1"/>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="110" height="30" uuid="fdaa056f-b062-432d-8ea6-24277757a64a"/>
<textFieldExpression><![CDATA[$F{Field_2}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
</band>
</detail>
</jasperReport>