What determines default Interactive Report column layout in Oracle APEX 5? - oracle

I have an Interact Report page in Oracle APEX 5 that includes a SQL Query with ~10 columns or so. When I first load the report, the columns are in a certain order, and columns are set to Do Not Display (as seen under Actions -> Select Columns). The default order does not seem to match the order in which I list them in the SQL Query, nor does it use the order that is found in the Page Designer, under {Page Name} -> Regions -> Content Body -> {Interactive Report} -> Columns. I have two questions about the way columns are displayed in the Interact Report component:
What determines the default order of these columns?
What determines which columns are set to Do Not Display and those set to Display in Report?
Are those settings saved for each user?

First of all, you should probably take a good look at the documentation. Plenty of useful things. The main thing you're looking for in this case would be about saving interactive reports.
In short though.
When first having created the IR the columns will be in the same order as in the select statement.
Afterwards, there is no longer a relation between position in the select statement or the order of the columns as seen in page designer.
Instead, the initial order has been used to create an initial Primary Default report.
From this point on, column position and being hidden or display solely depends on the settings in the "Select Columns" menu.
If you want to alter the default offered to the end user, you'll have to run the page, alter the IR, and save your settings through Actions > Save Report and selecting Primary Default.
Settings saved for each user? Yes and no. End users will be offered the primary default at first. If multiple defaults are present the application will remember which one they have last been working on when coming back.
Users can also save private versions of reports, or public ones, if enabled. They can then edit the report settings, but these settings only affect their own report in that same session. If not saved, all changes they made settings-wise are lost and they'll be presented with the defaults again next time they log in. (or perform a reset themselves).
Unless you take all control away of course, by configuring the Actions menu of the IR.

I was hoping to edit saved reports in the Application Builder, but I guess this is not available (at least in 5.1 that I'm using).
This helped me:
SELECT FLOW_ID, PAGE_ID, REPORT_ALIAS, STATUS, IS_DEFAULT, DISPLAY_ROWS, REPORT_COLUMNS
FROM apex_050100.WWV_FLOW_WORKSHEET_RPTS
WHERE FLOW_ID = 101
AND page_id = 25
;
Then I edited that table updating columns list or other attributes of the saved report.

Related

How to navigate XAMPP/myPHP and verify if mySQL is functional?

Recently downloaded XAMPP on Windows and I would like to request a tutorial on how to navigate the program. I'm not sure how to open myPHP and test SQL Queries or create databases. Any help would be appreciated.
Welcome to XAMPP,
By now you should have the program installed in the location of your choice from the Apache friends website. I understand that it is quite difficult to get started on a new project utilizing unfamiliar tools, by the end of this short tutorial you can start building all sorts of ideas!
1. To start, open the application from the desktop. On windows, the opening screen will display as shown below. Click on "Start" for the Apache and MySQL modules.
Homepage of XAMPP
The port value will be 80 for Apache in most cases, this varies dependent on module type and other applications with respect to their assigned port numbers.
These can be viewed by navigating to "Netstat" which displays socket properties. Configurations can be completed under "Config" in the top right of the application and under "Service and Port Settings". Common issues to modules not working correctly is due to port error or overlapping and changing values will prevent this.
2. The status of the modules is portrayed in the panel below. In your preferred internet browser, type "http://localhost". The dashboard of Apache with given instructions will show when entered. Navigate to "PHPMyAdmin" at the top right of the webpage.
PHPMyAdmin
The critical step for this dashboard to be functional is to have the MySQL module running. On the left of the screen, databases are displayed when created.
3. Next, type "Create database test;" in the SQL tab queries text box. The console is displayed at the bottom of the page representing errors and program messages. Click the "Go" button. The "test" database will join the list of databases on the left side of the window.
This verifies that MySQL and Apache servers are functional on the local computer. URL's define locations for pages that are requested and identify webserver addresses. Apache is an application that provides access to these requested locations to the user.
4. A simple webpage can be generated by the user through XAMPP. Create a .txt file with its contents only including "<h1>StackOverFlow</h1>" and under this type "<p>I am learning, this is a test</p>". Save this file in the htdocs folder inside the xampp installation location as "StackOverFlow.html". Go to your browser and insert "http://localhost/StackOverFlow.html".
The process listed allows the browser URL to request the existing web server to obtain the page's contents "http://localhost/StackOverFlow.html"
5. Next, go back to step 3 where queries will be used to construct tables for relationships of entities and test values.
The test database was created previously and still exists. Keep the query tab open and edit the initial script to be "create database if not exists test;". Add the statement "drop database if exists test;". These steps permit the program to refresh the database and scripted queries each time the user clicks "Go" resulting in the removal of overlapping data.
Two tables will be created and their relationship can be expressed shortly. In the next step, a simple Company and Product association is used. Basic terms to know to write SQL queries:
SELECT -> extracts data from a database
UPDATE -> updates data in a database
DELETE -> deletes data from a database
INSERT INTO -> inserts new data into a database
CREATE DATABASE -> creates a new database
CREATE TABLE -> creates a new table
DROP TABLE -> deletes a table
VarChar -> Varying variable character of desired length
Char -> character of set length
Not Null -> term cannot be null
Date -> date term reference
Integer -> term must be an integer
Key -> uniquely identifies row(s) in a table
SQL Syntax
6. Insert "use test;" under the creation of the database query. Then structure the code in an organized fashion for easy reading for the user.
Add "create table Company(" and under insert "companyName varchar(40) not null primary key,", then "street varchar(40),". Also, "city varchar(40)," and "province char(2)," with "postalCode char(6));".
Add "create table Product(" and under insert "producedBy varchar(40) not null,", then "dateMade date not null,". Also, "productName varchar(40) not null);".
The Company and Product tables are now created with specific dimensions, ordering, and terms.
7. There are many types of relations within SQL that allow individuals to retrieve specific data, store, and construct relationships between many tables with set parameters through additional queries. This example is simple where producedBy references the companyName containing relevant data.
Position the following below both the table queries:
Test values for Company table
Test values for Product table
Select "Go" and this will create tables that can be viewed by clicking the database "test" on the left side.
Here, the statement INSERT INTO is used to input the data below into the table with the parameters created. Appropriate ordering of data from first to last must match with the corresponding table. Invalid inputs will result in the console returning an error. Selecting specific data from a larger database with numerous tables can be accessed by "SELECT * FROM TABLENAME", creating temporary relations and returning desired data. This concept can be further discussed in another tutorial. The interface is extremely useful and can be implemented within html websites to store, calculate, or retrieve data/user processes.
XAMPP is an exceptional tool to create and integrate into different areas of development, I would recommend taking a look at "https://www.w3schools.com/" to further learn SQL, HTML, and other skills to extend your range of capabilities.
Thank you for going through this tutorial! If you have any questions feel free to leave a comment.

Form WHERE clause

I have an APEX form I'm developing for "user settings". I have a table with a sequence as a primary key and the users ID in another column...in addition to a few columns where each users saved settings are stored (things like "N" for do not receive notices).
I haven't used Oracle APEX in a while so excuse this likely newbie question...The insert works fine, but I'm having trouble with making the form only show the current users values. In my Form Region the source is set to my Table, and I have a WHERE clause like this:
USER_ID = 813309
But that's not working (813309 is my id and I'm just hard-coding it for now). The form always comes up with a "New" record.
For a form to load a specific record you can set the primary key page item to the value you need. You can do so in the url using the link builder from another page or you can set a computation on the item. That is what I would try in your case: add a computation to your item P_USER_ID of type "Static Value" with value 813309. Make sure the computation happens before the "Fetch Row" - the value obviously needs to be set before the process runs.
In such cases, I prefer creating a Report + Form combination (using the Wizard, of course): it creates an interactive report (so that you can review data in a table), and a form which is used to add new records or update/delete existing ones.
Doing so, when you pick a user in interactive report and click the icon at the beginning of a row, Apex redirects you to the form page, passing primary key column value to the form which then fetches appropriate data from the table.
Not that it won't work the way you're trying to do it, it's just simpler if you let Apex do everything for you.
So: did you create an automatic row fetch pre-rendering process? If not, do so because - without it - Apex doesn't know what to fetch. Also, if you hardcoded user_id, it won't do much good. Consider storing username into the table so that you could reference it via :APP_USER Apex variable.

Current version of data in database has changed since user initiated update process

I have a Master Detail form in my Oracle APEX application. When I am trying to update data in this form, I am getting below error.
Current version of data in database has changed since user initiated
update process. current row version identifier =
"26D0923D8A5144D6F483C2B9815D07D3" application row version identifier
= "1749BCD159359424E1EE00AC1C3E3FCB" (Row 1)
I have cleared browser cache and try to update. But it not worked.
How can I solve this?
I have experienced similar problem where my detail records set has timestamp fields. By default master detail wizard creates the timestamp fields as date picker type fields. If you set the date format on these, it would resolve the issue.
This blog post tries to address this issue on a Tabular Form (I know that's not what the original issue was with, but thought it might be related). It says the same as #sangam does below.
Short version: If you have an updated field that's timestamp datatype, you should set a date/time format.
http://apexbyg.blogspot.com/2015/05/tabular-form-bug.html
My tabular form has a field that's timestamp datatype, but I had already set a date format, so this didn't help me.
Here's another possibility, which I discovered was the case in my application.
That would be if the data the original checksum was calculated on is truly different than the pre-update checksum calculation, due to a design-flaw in your query!
In my application, the source for one of the updateable fields was COALESCE(name_calced, name_preferred). In the source table, the person's name could already be loaded in the record by an external process and we save it to one field - name_calced. But the end-user can enter a preferred name, which we wanted to save to the name_preferred field. We wanted to initially populate the displayed, updateable tabular form field with name_calced, if one existed, or name_preferred if the user had already provided a preferred name. Then they could change that value and save it back to the database.
I finally discovered that the Save action threw the error message if name_calced was non-null, but name_preferred was null. I realized that the initial checksum was calculated based on name_calced, but the pre-update checksum was based on name_preferred, so the application thought someone had changed the value in the background and showed the error message.
What I don't understand is how this problem didn't show up in the past 3 years the application has been running in production!
My solution is to make the field source only on name_preferred, which immediately solved this problem. I also think the back-end process will also get changed to pre-populate that table field from name_calced, so the user always sees the base value, if there is one.
I just had this issue myself. Now, I realize that tabular forms are deprecated at this time, but I have an application that was developed beforehand and still uses them. This issue occurred and I had to get one of our big guns at Oracle to help me out. I do a lot of DB work and a decent amount of Apex development but I'm more of a Java, WebLogic, etc guy, and I really couldn't figure this one out.
In my case, it turned out to be really simple. One of the columns in my tabular form was a hidden field, generated via a sub query. Being hidden, this column is not editable by the user and should not be part of the MRU update. I had the field set to "Hidden Column (saves states)" and setting its type to "Hidden Column" fixed the issue. So, this leads to sub queries being executed in such a way as to change the checksum for the overall query before hitting submit (save), causing the error.
For those who are continuing to troubleshoot this, look at your query for every field that you have specified and note which columns are editable in the tabular form. All other fields should be set in a way that makes them not save state so that they are not part of the update.
I had this error when I had two update processes processing on submit.
My solution was to add a condition to both processing steps. I had forgotten to do this when I made an additional process for Button A, but I never updated Button B to limit it's behaviors.
Navigation:
Processing -> Processes -> [Your Process Name] -> Server-side Condition -> When Button Pressed = [Your button Name]
In my case I had a column from a secondary table that was not set as Query Only and was being updated! The error would occur trying to save a column not in the table being updated. It took me half a day to figure it out (the column names were the same).
Set your Link column hidden to display only in the form.
Set "Send On Page Submit" to 'No' or disable the link column that is your primary key ( Rownum/rowid/id etc).
Hope it will work for you.
I have noticed this error comes when I was working Tabular Form and has disabled one of the form operations i.e. by setting server-side condition to "Never" for add, apply changes (submit) buttons
When I have restored back to its original state, it worked as expected.
In case you have to hide Add/Update button, use some other option.
https://compknowledgebase.blogspot.com/2018/12/oracle-apex-error-current-version-of.html

OpenERP Report over multiple purchase orders using openoffice / libreoffice

I was able to add a report record for object purchase.order. It shows up when I select and open a specific PO.
How do I print a report over multiple purchase orders, or multiple stock moves, or multiple sales orders etc.?
What do I specify in "object" (model) for the report record and where would this print menu show up?
(I am using aeroo reports engine and I was able to specify a
<for each..> ... </for>
loop but it only prints one record (which is the currently selected PO).
Thanks
at report template level you have two variables o and objects. the 1st one is present if you have only one item. the second one should be always available and must contains all the selected objects (or the objects that has been filtered trough a custom parser).
TIP: when you have doubt on how to do things... just look at how other modules do.
I. Create your report as it was intended for one object only.
<for each="o in objects"></for> as you define
II. On your OpenERP, go to Settings->Customization->Aeroo Reports->Reports and open the report you've previously created. On the report, click the Advanced tab and enable Process separately then save.
Hope this help to you.
Regard,

apex default amount of rows per page option

How can I set default amount of rows per page for interactive report?
I need this value to be applied for all interactive reports that do not have this value overridden. The reason why I need that is the following: it is cumbersome to set necessary amount of rows for each created interactive report and when it comes to updating that value it becomes a nightmare.
For interactive reports, you can modify the default number of rows displayed by selecting the appropriate number of rows and then saving the report with the option "save as default report settings" (when logged in as an APEX developer).
Unfortunately, this has to be applied to each report.
For a mass update, a thread on OTN mentions:
There is a display_rows column in the WWV_FLOW_WORKSHEET_RPTS table in your apex application schema. You can do a global update, where the flow_id equals your app_id.
This has not been verified, use at your own risk (unsupported by Oracle).

Resources