1

Is it possible to mark a report based on the times we click Preview?

For example, if we preview the report once, it will show 1.

If we preview the report twice, it will show 2.

I am using Adempiere and would like to put the report inside the window. So, when I click 'Print' once, it will show 1, the same when I click Print for the second time it will show 2, etc.

Any suggestion will be useful :)

Alex K
  • 22,315
  • 19
  • 108
  • 236
Jedi Codestar
  • 189
  • 2
  • 14

1 Answers1

0

There is a field in the AD_Process table called Statistic_Count which function is to store how many times the process has been run.

What I would do is to pass the value of that field as a parameter to the report, so you can print it.

In the process parameter you could add a new numeric parameter called PreviewTimes and in the DefaultValue field set something like:

@SQL=SELECT statistic_count FROM AD_Process WHERE AD_Process_ID = @AD_Process_ID@

Then, in the Jasper Report you receive that number and include it.

Hope it helps.