How to increase number of displayed rows in a tabular form using apex 5.0 - oracle

Currently my tabular form displays 10 rows at a time. How do I increase the number of rows to be displayed, say from the current default number of 10 to something like 20? Is there a place somewhere in the page attribute where you can set the number of rows to be displayed, as in the case of an interactive report?

Region -> Attributes -> Layout -> Number of Rows

In scripting window you will find a drop-down with row label, select it and choose the number of rows you want to display.

If you are facing this problem for an 11g Oracle SQL Developer:
More than 10 rows available. Increase rows selector to view more rows.
Then you can directly solve this from drop down menu of rows situated beside Autocommit checkmark from SQL Workshop:
select 1000000 to show more rows :
Run those queries again!
Final Result having 21 rows in result :
This might have solve your problem!

You can call function
javascript:apex.widget.tabular.addRow();
N number of times per click... For example,
Generate 2 rows, call
javascript:apex.widget.tabular.addRow();
javascript:apex.widget.tabular.addRow();
Generate 4 rows, call
javascript:apex.widget.tabular.addRow();
javascript:apex.widget.tabular.addRow();
javascript:apex.widget.tabular.addRow();
javascript:apex.widget.tabular.addRow();

Related

Totals row in Toad resultset? (via UI)

In Toad for Oracle 12:
I make various queries on-the-fly to analyze data. For example:
select
worktype,
count(*) as count
from
maximo.workorder
group by
worktype
In the query resultset, it would be helpful if I could toggle a totals row on/off to quickly analyze the results.
Example: get the grand total of the COUNT column. Or, in other queries, play around with count, max, standard deviation, variance, etc.
It would be the equivalent to the MS Access totals tool (not to be confused with GROUP BY):
Is there an way to do that using the UI in Toad 12?
You can, I believe. I don't have TOAD 12 any more, but - give it a try:
select all cells you're interested in
right-click
from the menu, select "Calculate selected cells"
check the result
note that - if result list contains a lot of columns and you're calculating the ones far on the right, you'll have to scroll left to see the result

Oracle Apex: Aggregate show as top row

Currently I use interactive report of Oracle Apex
Column1 Column2
A1 1 2
A2 2 3
A3 3 4
A4 4 5
----------------------
10 14
After showing data, I do some calculation such as sum Column1, Column2 using aggregate function SUM of interactive report
But the result show as the last row of report so I have to scroll to see the result.
How can I show the result as the first row of report?
Column1 Column2
10 14
----------------------
A1 1 2
A2 2 3
A3 3 4
A4 4 5
This can be done using JavaScript/jQuery (of course this is only one of many ways this can be done, but it works).
The SQL statement that is used to create the report along with all the filter and search information is stored in
WWV_FLOW_WORKSHEET tables
Create a database package to generate that SQL and sum the columns that you want from that and return as XML.
Call that database package from a jQuery AJAX call then parse the XML and using jQuery add a row to the top (and bottom if you like) of the worksheet table and place the results there.
The JavaScript/jQuery function should be called from an after refresh dynamic action for the worksheet in question.
function htmldbIRTotals(worksheet,columnList) {
sessionId = $("#pInstance").val();
worksheetId = $(worksheet.triggeringElement).find(".a-IRR-table:last").attr("id");
baseReportId=parseInt("0"+$("#"+worksheetId+"_rpt_saved_reports").val());
u="'||pkg||'.getTotals?p_worksheet_id="+worksheetId+"&p_base_Report_Id="+baseReportId+"&p_session_id="+sessionId+"&p_columns="+columnList;
$.post(u,function(data) {
var xml = $.parseXML(data);
});
With sessionId, worksheetId, and baseReportId you can retrieve all the info you need
columnList is a colon separated list of the columns that you want to total
You could even get more fancy and add different agregates (i.e. AVG, MIN, MAX etc.)
Example of this at the link below.
http://apps.htmldb.com/apps/f?p=htmldb:knowledgebase:::NO:RP:P5_ID:84315
The problem is that the totals may or may not be rendered on the page depending on the page size and the number of records in the result set - so with an Interactive Report, unless you force it to always show All Records, the page might not even be able to use JS tricks to move the summary line to the top.
My preference in this sort of situation is to add a separate region to the page based on a simple SQL query. It will be shown above the interactive report. Unfortunately the columns won't be aligned, however.
I found the solution
Add sub query to calculate the sum
Union with existed result
Use highlight function to make up the new row

How to Load CSV file into Apex 5 for particular columns?

I have table with three columns x (Foreign Key),y(Primary Key),z and also csv file with only two columns data y,z as shown in images http://imgur.com/a/12ENZ (Please copy and paste link)which has to uploaded into table.Here I fill x column for all the rows with constant value ‘20’.i have used Data loading wizard to do this in Apex 5.
Problem:
In the first step I loaded this table and then In next step you can see that I have to do column mapping .Here I get only two columns y(Mileage),z(Ratio) because I have only two columns in the excel and first column x i want to map with null values here(Problem 1).
In the next step I have added process in the Datavalidation to update column x to fill that constant value as shown in images. But you could see p_attr_number =1 makes first column to be updated with 20 value.Here I need my first column x to be filled with constant value 20(Problem 2).Please Give me some suggestions on this for solving this problems.
for problem 1 you can choose x column as nullable yes by editing your colum in object browser -> your table -> modify column -> nullabe field to NULL (do not reguire a value) so when you upload data it will not fill third column if you map 2 columns (althıugh you do not see the column name in wizards)
for problem 2 i am assuming that all fields in your database has data so you you can add a page process for giving new values to the uploaded data which has null x columns
1 go to 4th page 'Data Load Results' which created by data wizard
2 click add a page process button
3 choose pl/sql
4 give a name and choose on submit - after computations and validations
5 enter an update command which suits your needs as below
update your_table_name
set
x=20
where x is null;
6 write your success messages
7 choose finish button in option "when button presses"
8 create process
9 add a Branch button in Branches
10 give a name click next
11 enter the page you want to go after data load
12 choose finish button in option "when button presses"
13 go to finish button and choose submit in Action When Button Clicked -> action
by adding this process and branch
1st system will insert data to table
2nd it will update all the null x values to the static values in your table
3rd it will return to the page you want

How to Repeat table in one report side

I have a simple report (1 Table with 2 small columns)
the report works fine but now I'm trying to repeat the table on the same page but I can't find an example on how to do this.
I also crosses only one question about this problem, so maybe I miss something obviously on how to solve this.
Could somebody please enlight me?
You can 'play' with (a single) Tablix details to simulate table repetition.
For example you can create 3 rows of details like this:
row 1: header
row 2: value
row 3: footer space
To obtain a result like this:
You can also use a different layout, for example:
row 1: label/value for column 1
row 2: label/value for column 2
row 3: footer space
If you have a very small table you can also set report columns to fill horizontal space.
This is the result (simulating table repetitions but you can also use a simple Tablix with standard header/details):
This is the result if you use columns and a simple Tablix with standard header/details:

Toad truncating/rounding large Oracle numbers?

We have a table with a 'price' field of type NUMBER(20,7).. In TOAD I do this:
update mytable set price = 1234567890123.1234567;
Then I do this select:
select price, to_char(price) from mytable
PRICE TO_CHAR(PRICE)
1234567890123.12 "1234567890123.1234567"
Question is, why does TOAD truncate the result when displaying the NUMBER(20,7) field? The data is obviously there as it prints out with to_char.
??
Toad limits numbers in the data grid to 15 digits. I believe this is because excel limits numbers to 15 digits as well (or used to limit them). You can turn on "scientific notation" in options -> data grids -> data, check box Display large numbers in scientific notation. That won't probably help, either.
-> Right click on the data grid
-> Select "Grid Options..."
-> Under "Data Grids" chose "Data"
-> Uncheck "Display large numbers in Scientific Notation"
After doing these you need to close and open TOAD again. This worked for me in TOAD Version 8.6.0.38
I had a similar problem, Toad was truncating/rounding my numbers when being displayed in grid view.
I found out that by using the Execute Statement button or by pressing F9 to run the query then the truncation/rounding would not be performed.
I hope that helps.

Resources