Force page submits when paginating through a report

How do you force a page submit when paginating through a report?

Standard behaviour from apex is to redirect when navigating through the recordset of a report. While this is advisable in most cases, we sometimes need processes to run when the user clicks the next or previous button.

I have often seen the question, but never an answer. Although this can be achieved fairly easy, with following steps.

1) Adapt the report template. Best is to create a new report template, based on an existing template, so we don’t affect all pages.
I copy “Standard Report” and name it “Standard Report with Submit”.

2) In this new template we are interesting in the “Pagination Subtemplate”. We change “Next Page Template”, the original value will be a redirect:
&lta href=”#LINK#”>next&lt/a>
We can easily change this to a submit:
&lta href=”javascript:doSubmit(‘#LINK#’);”>next&lt/a>

And we change “Previous Page Template” analogous from :
&lta href=”#LINK#”>previous&lt/a>
to:
&lta href=”javascript:doSubmit(‘#LINK#’);”>previous&lt/a>

3) When we use this report template on our page, the next and previous button will submit, and the request will be the url it wants to redirect too. This way we can use our ‘after submit’-processes.

4) The last step we need is to foresee a branch.
We create a branch to URL, and our url will be our request:
&REQUEST.
We make the branche conditional, based on Pl/Sql:
:REQUEST LIKE ‘f?p=%’

Steps 3 & 4 need to be repeated for every page needing this functionality. Our processes can be made conditional in the same manner as our branch.

We used this for saving our data temporarily to a collection when paginating through an updatable report, and we didn’t notice any drawbacks using this method.

About these ads

2 thoughts on “Force page submits when paginating through a report

  1. Thanks for this, was looking for this solution. But is there also a way to do this when changing the page via the select list of row ranges?

  2. Peter, this is possible, although not as simple and elegant as the next and previous links.I’ll create a new post for this, thanks for the intresting question.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s