Passing more than 3 items in a reports column link - oracle

I have a report that is listing students and I want a column to edit a student. I've done so by following this answer:
How do you add an edit button to each row in a report in Oracle APEX?
However, I can only seem to pass 3 items and there's no option to add more. I took a screenshot to explain more:
I need to pass 8 values, how can I do that?
Thanks!

Normally, for this you would only pass the Primary Key columns (here looks like #RECORD_NUMBER# only). The page that you send the person to would then load the form based on the primary key lookup only. If multiple users were using this application, you would want the edit form to always retrieve the current values of the database, not what happened to be on the screen when a particular person ran a certain report.

Change the Target type to URL.
Apex will format what to already have into a URL text field which magically appears between Tem3 and Page Checksum.
All you need to do is to add your new items and values in the appropriate places in the URL.

I found a workaround, at least it was useful to my scenario.
I have an IR page, query returns 4 columns, lets say: ID, DESCRIPTION, SOME_NUMBER,SOME_NUMBER2.
ID NUMBER(9), DESCRIPTION VARCHAR2(30), SOME_NUMBER NUMBER(1), SOME_NUMBER2 NUMBER(3).
What I did was, to setup items this way:
P11_ITEM1-->#ID#
P11_ITEM2-->#DESCRIPTION#
P11_ITEM3-->#SOME_NUMBER##SOME_NUMBER2#
Previous data have been sent to page 11.
In page 11, all items are display only items.
And P11_ITEM3 actually received two concatenated values.
For example, the calling page has columns SOME_NUMER=4 and SOME_NUMBER2=150
so, in pag1 11, P11_ITEM3 shows 4150
In page 11 I created a Before Footer process (pl/sql expression)
to set up new items, for example P11_N1 as source SUBSTR(P11_ITEM3,1,1)
and item P11_N2 as source SUBSTR(P11_ITEM3,2,3)
So, I had those items with corresponding values from the calling IR page.
The reason I did not pass the primary key only for new lookup access, is because i do not want to stress database performing new queries since all data are already loaded into page items. I've been an oracle DBA for twenty years and I know there is no need to re execute queries if you already have the information somewhere else.

These workarounds are not very useful for a product that bills itself as a RAD tool.
Just include a single quoted word in the select statement (Select col1, 'Randomword', col2 from table 1;)
Then define that column as a link and bingo! More items than 3 to select.

Related

In oracle apex how to navigate to different pages from link column depending on another column data

I have a table with multiple columns in that one column have data like text field in that data is either A or B and another column is of link type link is getting fetched by id column, Now I have a situation by comparing the data in column1 if it's 'A' I want to navigate to page 3 and If it's 'B' I want to navigate to page 4 by click of link column. How to achieve this?
It would probably be easier for us if you actually shared table and its contents instead of describing it; moreover, as you wrote it as a single sentence with no punctuation, it is difficult to understand what you want to say.
The way I understood it, table is used as a source for some kind of a report (interactive or classic?). One of its (reports) columns is used as a link to another page. As link depends on column's value, I suggest you use a case expression and compose link to target page.
I don't know how you are creating the link now, but - if you already don't use it - have a look at GET_URL function which does most of the dirty job for you. In its simplest appearance, you'd just
select id,
apex_page_get_url(p_page => case when column1 = 'A' then 1
when column2 = 'B' then 2
end) as link
from ...
You need to create Dynamic action on Button.
Button -> True -> Action := Execute server-side-code
Settings -> language := PLSQL
FOR PLSQL QUERY
3)Items to Submit = P7_NEW,P7_NEW_1
4) Items to Return = P31_URL
This will create URL and Trigger the URL to next page

Limiting rows initially returned in select list

Populating an Apex 5.1 select list of employees with about 25,000 names is proving to be a performance problem when loading the page. Is there a method of limiting the initial list to a set number (such as 200), and dynamically populating with chunks of additional names as the user scrolls through the list? Are there other options I should consider that would not slow down the page load?
I am currently using a dynamic LOV, and have tried adjusting this LOV to include Oracle row limiting code; however, there is no way of fetching past the initial set of rows. The source of the data is a view on a materialized view.
I appreciate any ideas
I'd use a pop-up LOV with a search function, not showing any records until the user enters a search value (more than 3 characters). I know it's tedious to use a pop-up LOV but it seems the only way to prevent waiting for a slow list to display.
I'd try with cascading lists of values. I don't know what those 25.000 names represent, but - suppose it is a large company. Then you'd
1st LoV: continent
2nd Lov: country
which refers to the previous LoV as where country.continent = :P1_CONTINENT
3rd LoV: city
which refers the previous LoV as where city.coutry = :P1_COUNTRY
4rd Lov is actually your current query:
which refers to the previous Lov as where person.city = :P1_CITY
Now your list of values wouldn't contain 25.000 rows, but - hopefully - a lot less.

Can I use a list to repeat two tablixes on a report page?

See image below. Warehouse and Customer are dropdown lists populated via query. Year is a text field. The two tables display data from datasets driven by the report parameters. Is there a way to repeat the two tables based on each member of the Customer dropdown? Preferbly with a pagebreak after the 2nd table.
I normally do this using subreports. You could either create a single subreport that contains both tables or individual subreports. The individual approach might help with page breaks etc so that's the way I'd go.
Step 1: Create a report for your first table.
As you don't state what each table does, I'll make some up for the sake of illustration.
The key is to create a subreport that displays just the info you need in a single table. So in your case this might mean we only need to pass in a single parameter, CustomerID. You might need to pass in more such as Warehouse but I don't know...
In my made up scenario, let's assume the report shows customer contacts so we create a subreport (let's call it subCustomerConacts). It has a single parameter pCustomerID and a single dataset dsCustomerContacts. The query might looks something like SELECT * FROM CustomerContacts WHERE CustomerID = #pCustomerID. Add whatever tables/textbox etc you need to display your data.
Test this subreport works by manually typing in a CustomerID
Step 2: Create a report for your second table.
Do exactly the same again, creating a new subreport. Let call this subCustomerOrders. Repeat as above until you end up with another report that can display order details (or whatever you need).
Finally, create you main report.
This is basically what you have described in you question in terms of parameters etc.
Now to add this bit that will call you subreports.
Create a dataset (let's call it dsCustomerLoop) that contains each customer from your parameter something like SELECT DISTINCT CustomerID FROM myCustomers WHERE CustomerID IN (#myCustomerParameter)
Add a table to your report, 1 column wide and stretch it so it's wide enough to accommodate you subreports.
Set the dataset to point to dsCustomerLoop
Right-Click the cell in the detail row and do "Insert Row -> Inside Group - Below". You should not have two detail rows.
Next, right click the top detail row and do "Insert -> Subreport"
Right-Click the newly inserted subreport control and choose "properties".
Choose your first SubReport form the drop-down list
Click parameters on the left,
Click "Add" and select the CusomterID parmeter, set it's value to the CustomerID field.
Repeat this process on the seconds row, choosing your seconds subreport.
You may want to also add a 3rd row to the table, you could insert a rectangle into this with page breaks set to force a new page after each seconds subreport.
That's It. When the report runs it will produce two rows per customer, each row containing a subreport.
I hope this is clear enough, I've rushed through it a bit but if anything is unclear, let me know and I'll provide a clearer solution.

Pagination in Classic ASP with VB Script

I am using ASP/VB Script in my project but, i don't have much idea of Pagination in Classic ASP. I have designed a datagrid format using tables and looping. That table is filled by accessing database. As we have a huge amount of data to display, we need pagination.
Thanks in advance
The pagination problem is not inherently to ASP classic or VBScript. You need first to define which strategy to follow:
In the client:
Ajax style pagination (You can use a jQuery plugin like SlickGrid)
Linked pagination: Your page have links to page 1, page 2, etc.
Infite scrolling: This is a modern way to do pagination, with more results added to the page via ajax
In the server
Full DB results retrieve and return only the page asked. This is sometimes necessary.
Full DB retrieve but caching the result so subsequent page request come from the cache, not the DB
Ask the DB only the page asked (Different techniques depending on the DB engine)
There is a issue you need to be aware of... the built-in ASP record set will allow pagiing, however is not very efficient. The entire result set gets returned to the browser and then it locates the appropriate page and displays that data.
Think of it like this... your result set is a 4 shelf book case. When you ask for page one all 4 shelves of books get returned. The the display code says "Okay now only show page 1". If you then ask for page two... All four shelves of books gets returned and then the display code says "Okay give me page 4".
So, you should look for a paging solution that takes place on the server, inside the database. This way if you ask for page 15 of a 50 page result, the database will only return one shelf of books.
This google query should put you on the right track.
Edit: How SQL Paging Works
You must us a stored procedure
One of the input parameters is the page to view
The stored procedure filters the results on the server
Here is the basic concept of what happens inside the proc:
Step 1:
Create a temp table that stores the entire result set. My preference is to store only two values in this temp table. An identity seed value called RowId and the primary key of the result data. (I'm one of those people that believes in non-sensical identity seed keys)
Step 2:
Insert all the PKey values from the select statement into the temp table
Step 3:
Determine the StartRowId and EndRowId based on the input page parameter.
Step 4:
Select from the temp table using an inner join to the datatable on the PKey. In the where clause limit the result so the RowId (of the temp table) is between StartRowId and EndRowId. Make sure to Order By the RowId.
Set page size
recordset.PageSize = 100 ' number of records per page
Set the current page
recordset.AbsolutePage = nPage ' nPage being the page you want to jump to.
Other useful bits:
recordset.RecordCount ' number of records returned
recordset.PageCount ' number of pages based on PageSize and RecordCount
That's the basic info. You'll still need to loop through the appropriate number of records, and check the page number as it is passed back to the page.

VB6 and data-bound MSHFlexGrid, moving and populating columns

I'm working on a VB6 program that connects to a SQL Server 2008 R2 database. In the past I have always used the MSFlexGrid control and populated it manually. Now, however, the guy who is paying me for this wants me to use data-bound grids instead, which forces me to use the MSHFlexGrid control because I'm using ADO and not DAO. So, I have two questions...
First, how would I move a column in a MSHFlexGrid? For example, if I wanted the third column to appear as the sixth column in the grid, is there a simple single line of code that would do that?
Second, believe it or not, I've never had to do anything in a grid other than display the data, as is, from a recordset. Now, however, I have a recordset with some fields that contain just ID numbers that refer to records in other files - for example, a field containing an ID number referring to a record in the Customers table, instead of the field containing the customer's name. What is the easiest way to, instead of having a column showing customer ID numbers from the recordset, having that column show customer names? I thought I read somewhere that there's a way to embed a sql command in a MSHFlexGrid column, but if there is I wouldn't know how to do it. Is this possible, or is there a simpler way to do it?
TIA,
Kevin
The column order would typically be handled by your SELECT statement.
Say you have a Pies table that has a FruitID foreign key related to the FruitID in a Fruits table:
SELECT PieID AS ID, Pie, Fruit FROM Pies LEFT OUTER JOIN Fruits
ON Pies.FruitID = Fruits.FruitID
This returns 3 items: ID, Pie, and Fruit in that order.
Moving columns after the query/display operation is rarely used, but yes ColPosition can be used for that.
Wow! VB6.... Back to the future! :-)
You can move Columns using the ColPosition Property.
This article shows how you could setup the grid to display hierarchical data.
If you just want to display the customer name on the same line as the main data then that is doable as well by just creating the proper SQL for your data source. For that matter you can control the column order the same way as well.
Now, how about considering upgrading to .Net? Just kidding..... No, I'm not. OK. I am, maybe. :-)

Resources