1
我想在我与格式的报告显示java.time.LocalDate
:如何在文本字段中格式化java.time.LocalDate?
<textField pattern="EEEEE dd MMMMM yyyy">
<reportElement x="64" y="0" width="150" height="20" uuid="5e003c53-2327-4f75-9adf-831a3bb494ff"/>
<textElement verticalAlignment="Middle">
<font isBold="true" isUnderline="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{dateFacture}]]></textFieldExpression>
</textField>
但我得到一个日期,如:2017年3月9日。是否由于java.time.LocalDate类型?
。我不知道贾斯珀报告对这个问题的回答。在纯Java中,您可以使用'LocalDate.format(DateTimeFormatter)'。 –
解决方案:$ F {dateFacture} .format(java.write.Formatter.ofPattern(“EEEE dMMMM yyyy”)) – thomas
@PetterFriberg,该问题的答案解释了如何在Java中设置LocalDateTime的格式 - Jasper报告中不是'LocalDate'。问题标签为jasper-reports,而不是java,这可能意味着Jasper报告上下文是提问者的问题?托马斯最好说明一下。 –