How to publish a report

0

I have a Jasper report with 3 paramaters. I have started to publish it  and was able to create a SQL for one of the parameters but I dont know how to handle the other parameters that are date ranges (DATEFROM and DATETO).

what needs to be done for the date parameters?

jkeri's picture
18
Joined: Mar 15 2013 - 12:17pm
Last seen: 4 days 1 hour ago

4 Answers:

0

You can create date type input controls that will show a calendar and let user select from the calendar the date from and date to.The Report parameter behind the input control needs to be of compatibale type. ex: java.sql.Date

the SQL would look something like

Select 
<fields>
from <table>
where  
 ( $X{GREATER, date_field, DATEFROM_param } and $X{LESS, date_field, DATETO_param})

 

Alex42's picture
30
Joined: Dec 7 2016 - 4:24am
Last seen: 1 hour 38 min ago
0

I disagree with your answer. it is better to use SQL BETWEEN as in this case:   and pay.payment_date between $P{DATEFROM} and $P{DATETO}

 

But that is not my original question. I was asking during the publishing step, do I need to do anything to the date parameter to  pop up or is that done at the time input controls are created?

jkeri's picture
18
Joined: Mar 15 2013 - 12:17pm
Last seen: 4 days 1 hour ago
0

what do you mean pop up?

an input control has asociated a parameter that you need to use in your query in order to be able to filter. You can mark said parameter "for prompting" when creating it.When you publish the report for the first time you will be able to select which for prompting parameters you  actually want to publish(this will publish them as a local resource to the report). At future publish operations, unless you change the parameter/input control definition, the input control publishing window will be skipped or appear with Ignore preselected

Once published, by selcting the report and then edit you can access all input controls and configure if you want then in a popup/in a separate page, etc. You can also add/create input controls here in the server, just make sure the parameter behind it matches the one used in the report query. Here input controls can be added also as resources from repository not as local resources. Its recommended to do it like this if you have the same input control over many reports

Hope this helps, if this is not what you were looking for, then i really don't understand what you wand. :)

Alex42's picture
30
Joined: Dec 7 2016 - 4:24am
Last seen: 1 hour 38 min ago
0

Defining parameters and sql statement are included in your jrxml file. This is just a xml file so opening this file with a text editor won't popup a parameter input.

Jaspersoft Studio and JasperReports Server are software that process this jrxml file. As such, they will show parameter input field when a report is executed. In Jaspersoft Studio, this is when you preview the report. In JasperReports Server, this is when you open a report. Nevertheless, in JasperReports Server, you'll need to setup to display these parameter inputs.

http://community.jaspersoft.com/documentation/tibco-jasperreports-server...

 

If you are developing an application that uses JasperReports library, you'll have to create your own input entry logic in your program. Parameters are often passed as Map<String, Object>

hozawa's picture
12990
Joined: Apr 24 2010 - 4:31pm
Last seen: 16 hours 39 min ago
Feedback