Jump to content
Changes to the Jaspersoft community edition download ×

Text Field(s) displaying date(s) for first and last day of previous month


Go to solution Solved by tamara.berova,

Recommended Posts

Hi Folks:

I'm new to Jaspersoft Studio  (I've been doing hands on practice and reading the manual for the last couple of days).

My Question:

On many of my current reports (done in Oracle Reports)   I  have to list all the records from the previous month.  The admin wants the date range listed for the report.

This means at the top of the report I need to list:  1.  The first day of the previous month (i.e   6/1/2017  )  and the last day of the month (6/31/2017).

I'm thinking that maybe a text box (field) that is populated by an expression?  (I'm also relatively new to Java... been using PL/SQL for years with Oracle Forms and Reports).

Any help / ideas for a noob would be appreciated..

Thanks,

Matthew

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

  • Solution

Hi!

There is a SQL-solution:

You do a Query with 2 Columns: select last_day (add_months (SYSDATE, -2)) + 1 AS First_Day, last_day (add_months (SYSDATE, -1) AS Last_Day from DUAL,
Connect the query to your own query (view) or Table (Sorce Data) and the 2 necessary columns will get you in each rows of your report. You can group then result by this 2 columns.
There is a Jasper-solution too, but this solution is not so transparent for Sie.

Best Regards

Tamara Berova
 

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