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

How do I mark records as printed in a report?


andrew_50

Recommended Posts

I have a report which is to be run several times a day, but I do not want the data from an earlier run to be printed in a later run.

I've got a field which I can use as a flag, but I don't see how to set it after a run of the report.

I am wondering if I can include a direct call to a stored procedure as part of the report, but am not sure how I'd do this.

Link to comment
Share on other sites

  • Replies 9
  • Created
  • Last Reply

Top Posters In This Topic

I had seen that, but... it didn't look too helpful

Pretty sure a sequence is not what I'm after. I am using mysql, and I want to flag the records selected for the report as printed (by the time the report is done).

Further to your links, which I thank you for. Can scriplets be used to update a database? Also, they seem to need to be set up in jasperStudio, but I'm not sure how to write any ccode for them?

Link to comment
Share on other sites

@andrew_50 

you either need to know how to write a stored procedure or a java scriptlet.

both the implementations perform the same output. 

I would suggest you should think about writing a mysql procedure first and then implement it in jasper.

try writing a mysql procedure which should output a cursor and this cursor can be used for displaying the report.

inside the same procedure, you should update the records that have been fetched by the cursor.

Link to comment
Share on other sites

First you should use some real parameters, in my screenshot for example, you should use:

exec dbo.myStoredProcedure '2017/01/01', '2017/02/02'[/code]

Then click "Read Fields" to get the actual fields. When fields are loaded, you can replace the real parameters to $P expressions.

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