Hello Team,

we are using grid interface with an infinite scroll option and filters are enabled on some columns in the grid. Our users want to have an additional info regarding:

  1. the entire number of rows in the dataset

  2. number of rows fetched

  3. number of current selected row

(2) and (3) should provide accurate info even if filters are applied. Is there any way to achive that?

asked 14 Jan '15, 09:45

anatoly4u's gravatar image

anatoly4u
6918
accept rate: 0%

edited 14 Jan '15, 10:11


Hi,

This is available in Oracle Forms by default and I feel that formspider team should also have provided this. I always take some trouble to bring all oracle friendly features to formspider. I have done this by using the following procedure.

   FUNCTION getrowcounts(p_ds varchar2)
      RETURN VARCHAR2 IS
      l_currentrow      VARCHAR2(10);
      l_totalrows       VARCHAR2(10);
      l_filterrowcount  VARCHAR2(10);
   BEGIN
      --get current row number.
      l_currentrow       := api_datasource.getrownumber(p_ds);
      --get the total rows
      l_totalrows        := api_datasource.getrowcount(p_ds);
      --get the filtered rowcount
      l_filterrowcount   := api_session.getvaluetx('filterrowcount.'||p_ds);
      RETURN 'Current row: ' || l_currentrow || ' Filtered rows: ' || l_filterrowcount || ' Total rows: ' || l_totalrows;
   END;

Above, the first and second statements are self explanatory. The third statement is obtained from session variable which is set in the procedure below. I have single api_datasource.executequery command throughout all of my programs. This is given in the following procedure (this is not my complete code, but this gives an idea as to how to go). Here, after the executeqry statement, I set the filtered rowcount in a session variable which is obtained in the procedure above.

When you find a solution, please put your code here, and kindly add (solved) to the beginning of your question. This will help others to use your solution.

   PROCEDURE executeqry(p_ds VARCHAR2, p_whr VARCHAR2 := ' 1=1 ', p_order VARCHAR2 := NULL) IS
   BEGIN
      api_datasource.executequery(in_datasourcename_tx => p_ds, in_whereclause_tx => p_whr);
      api_session.add('filterrowcount.'||p_ds, api_datasource.getfilteredrowcount(p_ds));
   END;

Regards.

George

link

answered 17 Jan '15, 03:38

grajan777's gravatar image

grajan777
1011238
accept rate: 10%

thanks for the hint. we'll try to find a solution and come back here

(19 Jan '15, 13:04) anatoly4u
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×85
×5
×4
×1
×1

Asked: 14 Jan '15, 09:45

Seen: 953 times

Last updated: 19 Jan '15, 13:04


© Copyright Gerger 2017