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

date and hexadecimal jasperreport php


her1z.n1a.87

Recommended Posts

Hello,

 

my name is Heri. I have been working with PHP. I really happy when discovered jasperxml.

 

this class or framework really help to generate reporting with PHP since it is hard to create.

 

i means JASPERXML has ireport designer so we can build some report page very easy and its also

 

can combined with my MySQL Database.

 

i have some question here. And really hope you can help me to solve it.

 

1. Can i set the today date with my own format?

 

i have saw few tutorial about this. which easily set up the pattern alongside ireport but mine didnt work as example.

 

for example i want to show Pontianak, 10 April 2017(today) from textfield.

 

2. i have some problem with hexadecimal view.

 

so, one of my field from database called nik field type varchar (18).

 

but it is view as hexadecimal type 6.1710354058E+15 it should be 6171035405800015

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Hey,

The solution to your issues are-

1. Related to show today's date into desired format, once you are creating reports in iReport, you can simply write this expression to get this date 10 April 2017

new SimpleDateFormat("dd mmm yyyy").format(new Date()) 

As soon as you have this expression in report, then this expression will give you the desired results.

 

2. Related to the second issue, you can use the number formatter.

For instance if you do not want any decimal place, then either you can set a feild expression as ### or you can set it through a decimal format .for example 

new DecimalFormat("###").format(expresssion)

 

Hope this helps.

 

Thanks,

Ankur Gupta

Link to comment
Share on other sites

Hey,

 

you are probably on a correct path, just remember that new  java.util.date() gives the current system time  or in your case the phone server time that is why you are getting a vague formatted date.

 

 

wgat you can do us that that create one mor parameter for the current date and via php code pass the current date and keep the parameter instead of the java expression inside ireport 

 

 

try try this out this should work 

my email id is ankur.gupta.aug@gmail.com

 

cheers !!

 

ankur gupta 

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...