Jump to content
Changes to the Jaspersoft community edition download ×

Default value of parameter while scheduling on jasper server 4.0.0


silvi

Recommended Posts

 Hello all,

 I have a date parameter in my report called Auto_Date:

<parameter name="Auto_Date" class="java.util.Date">
        <defaultValueExpression><![CDATA[($P{Auto_Date} == null || $P{Auto_Date} == " "
    ? new Date() : $P{Auto_Date})]]></defaultValueExpression>
    </parameter>

Set curdate as default value when null or empty string. Report is working fine in i-report  but when I am scheduling on Japser server by leaving visible Auto_Date parameter blank, report is empty.  I know that if I will set parameter as "Read-only" on server I can schedule it. My limitation is that I cannot have two jrxml file one for random date and one for scheduling. It is driving me crazy, I have searched all the forum but did not find any answer. Can I schedule my report by using default value of parameter. 

 

Please help, it' svery important for me.

Thanks

Silvi

 

 

 

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

 You would either need 2 reports or create a dynamic date entry taht allows you ot choose from a pre-defined list:

I use something like:

  "This Week", "Last 7 Days", Last 30 Days", "Month to Date",  etc.

This allows me to send reports on any of the defined time slices. So I can schedule a monthly on the first by choosing "Last Month", etc.

I have a writeup on this at: http://reptics.com/?p=1

And I will be releasing the cdoe behind it shortly. Others probably did something simular, so search around if how I did it doesn't fit.

 



Post Edited by brooneyx1 at 01/24/2012 10:57
Link to comment
Share on other sites

Thanks Broonyex1..

I read your tutorial and that's what exactly I am looking for. But very sorry to say I am a newbie in using jasper products. So 
I am not sure how and where use the codes. I would highly appreciate your help if you can explain me in detail and can link me up with documents.

 

 

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