Jump to content

Missing day in date?


fredand44

Recommended Posts

Hello!

I use jasperreport to create reports in pdf and excel.

In the reports we display some dates like 2010-05-01 

Everything works fine when I run it in my own dev-environmonet  but when we run it on our test-server we just get dates dispalyed like: 2010-05-

...the day is missing as you can see.

We fetch the data from a Oracle databas.

If any one got any clue how to solve this please let me know.

Best regards

Fredrik

 

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

 Can you post a piece of your report template in order to explain your problem?

I think you can be missing the pattern for the date.

Code:
<textField isBlankWhenNull="true" isStretchWithOverflow="true" pattern="dd/MM/yyyy">                        <reportElement x="400" y="0" width="150" height="12" style="detailStyle"                                       stretchType="RelativeToTallestObject" mode="Opaque"/>                        <box padding="1">                            <pen lineColor="#000000" lineStyle="Solid"/>                        </box>                        <textElement textAlignment="Left"/>                        <textFieldExpression class="java.util.Date">                            <![CDATA[$F{purchaseDate}]]></textFieldExpression>                    </textField>
Link to comment
Share on other sites

Hi --

 

I've seen this problem. I develop on a windows machine, but production is running on a Linux machine. In my case, the box allowed for the data is just not quite big enough and somehow the padding wipes out the trailing text. Can you try making your box a little bigger, or decreasing your padding if you are using padding? Or, you can try decreasing your font size

Link to comment
Share on other sites

Hello Guys!

Thanks for your help guys, without you I would not have solved this problem.

As you said the box was a bit too small.

I shrinked the size of the typo from 10 to 8 and voila the date showed.

(I do was missing the pattern as well)

Btw we also develop on windows and test it in linux.

Best regards

Fredrik

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...