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

How to make repetition counter? (same as page counter.)


danilobtos

Recommended Posts

Hello everybody...

How to make repetition counter? I will pass a parameter or variable with the number of times the report should be printed. And in the report layout, you must inform the total number of times and the current number of printing. Example: p_CURRENT = 0. p_TOTAL = 5. The p_ATUAL "/" p_TOTAL should appear in the report. on the first 01/05 , on the second 02/05 and so on until the fifth and last 05/05.

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

There is no built-in functionality for this.

I would always attempt to see if the database can produce the correct records.  In Oracle, I would update the query and use "CONNECT BY LEVEL" to force data duplication.  This will allow the report to be dumb and print the results.

In the example below I used 7 as the :force_cnt.

SELECT SUBSTR(TO_CHAR('0' || ROW_NUMBER() OVER (ORDER BY 'jane doe')), -2, 2)                           || '/' || SUBSTR('0' || TO_CHAR(:force_cnt), -2, 2) AS rn     , 'jane doe' AS student_name     , TO_DATE('03-AUG-1999', 'DD-MON-YYYY') AS birthdateFROM dualCONNECT BY LEVEL <= :force_cnt;[/code]
RNSTUDENT_NAMEBIRTHDATE
01/07jane doe03-AUG-1999
02/07jane doe03-AUG-1999
03/07jane doe03-AUG-1999
04/07jane doe03-AUG-1999
05/07jane doe03-AUG-1999
06/07jane doe03-AUG-1999
07/07jane doe03-AUG-1999

 

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