How to pass parameter top LOV query in SpagoBI - lov

How I can pass a parameter to a LOV query in SPagoBI?
I am creating a LOV using query ... something like this:
select id, name
from table1
where parent_id = ${parent_id}
When I click on "Test before save" to evaluate query appears window with title "Profile attributes to fill" asking me to put value for parameter parent_id
Here is a text which appears on that page:
The lov needs some profile attributes.
Your personal profile doesn't contain all the necessary attributes.
To proceed with the test assign a value to the missing profile attributes.
After filling with value and click on Test appears loading icon and stays stucked. I have checked logs. There is no error info in any of the following log files: SpagoBI.log, catalina.out, SpagoBI_[1]_OperatorTrace.log, SpagoBIBirtReportEngine.log
I can see via Express Profiler that query is executed using valid passed parameter but why window stay stucked?

You cannot pass parameter from report to the lovs.
The example given before is of the profile attributes which are passed on the basis of the user logged in.
see the below images for using profile attributes.
first create profile attribute you want to use.
Then you have to fill all the profile attribute corresponding to the user
Then create a lov using profile attribute you want i have created using venueId
see the below image
Now test the lov you will get the response see below image.
Use profile attributes when you want report that is specific to the user.

you can use profile attribute in Dataset query like;
select id, name
from table1
where parent_id = '${parent_id}'
and use the created dataset in LOV.
Please note if query returns only 1 row analytical driver linked to document wont be visible, but will function as expected.

You need to wrap the attribute shortcode with single quotes in the query statement
like this
select id, name
from table1
where parent_id = '${parent_id}'

Related

How to find out the columns to be grouped when a query is generated dynamically?

I need to implement a feature where the user will be generating reports dynamically.
In that feature, the user will be presented with an interface to select some specific modules. Each module will point to a set of tables internally.
Consider the following tables,
**Table Name : module_location**
location_id
location_name ->Contains a location name
**Table Name : module_streets**
street_id
street_location_id (F.K module_location.location_id)
street_name ->Contains street name in a location
If the user selects the module name Location, he is indeed choosing the list tables to be queried on(which is done internally)
In this case, module_location and module_streets (They will be joined by location id).
After selecting the Location module the user has to choose the set of fields which needs to be shown in the dynamic report, once generated.
So he'll be provided with an interface to select those fields. The names given in the interface will be alias names for the respective fields in the tables
ie,
The user will be presented with option to select the following
Location Name -> Corresponds to the field 'location_name'
Street Name -> Corresponds to the field 'street_name'
After selecting the required fields to be shown, the user will have to select some conditions like(count,sum etc)
Suppose, the condition is like Get the number of streets in a location, the user will have to add condition count against the option Street Name.
After selecting the conditions, the user have to simply click the submit button in-order to generate the report.
The issue I'm facing here is how to decide the columns to be grouped. If this is done manually, I know that I need to group the location_id to get the count. So how can I do that, if the query is generated dynamically?
Kindly help. The database I'm using is postgresql8.4

APEX 4.0 - How to load items when using select

I have a question about APEX, I have the problem that when I try to select a value from a selectbox, no value shows in the other items. What I have tried to do is loading data from the database to the items when I select a code from the selectbox with PL/SQL. How do I do this? Selecting a code from a selectbox and filling all the other items?
Vid
Ok if i understand you right you need a List of Values.
If you create this shared Object. Use a dynamic list.
There you have a dialog you can put a PL/SQL or SQL Code snippet into.
You must return a 2 column list. The first Column is the field name in you later select box and the second is you reference.

oracle apex 4.2 : populate a form when page is loaded

How can I populate the form when the page is loaded
I have tried an query base form, and a automatic fetch, but neither will display any data when the page loads.
You must create "Automated Row Fetch" process on the page. For each item on page change the "Source Type" to "Database column", and enter column name in "Source value or expression".
When using the page wizard to create a query based form, the query given in the wizard is only used to define the fields on the form and create the corresponding page items. It is not used to subsequently populate data.
For that you need to add a process in a region above/before your form. Make the process PL/SQL type and provide your query there. Assuming your form is on page 2 and has fields ID and Name, use:
select name into :P2_NAME from my_table where id = :P2_ID;
The page or link that calls page 2 will need to set the value for P2_ID.

Autonumbering in forms in Access

I have a form in access that saves the data in a database and I want one of the fields to be automatically calculated as the next value in line as the ID so that the user doesnt write the ID. does anyone have any ideas?
Create your table using an Autonumber data type.
If you manually create your tables then this statement
CREATE TABLE TableThatIncrements
(
Id AUTOINCREMENT(1001,1)
)
Alternately you can edit your existing table Id column using:
ALTER TABLE TableThatIncrements
ALTER COLUMN Id AUTOINCREMENT(1001,1)
If you do not, then you can change per the article I mentioned via the GUI interface. See steps in this article: https://superuser.com/questions/288087/how-do-i-set-the-first-value-of-autonumber-in-access
You can run a query in Access by doing the following:
Go to the "Create" tab and click "Query Design"
Just close the window that appears which asks you to select tables, we don't need that.
Go to the "Design" tab and click the button with the arrow until you get a textual input screen. (By default, it says SELECT;).
Delete the default text and paste the above query.
Click "Run".

Using all input controls for use in one report

I have a report that uses a query of input controls. It is a drop-down menu of specific ID's (ie. 28, 13, 30...) I want to know if it is possible to have my report go through each of these parameters and populate the report one page at a time for each of them.
Here is an example of the different parameters I want the report to loop through:
Do you want to create a page for all Partner IDs? Or just for the Partner IDs that a user selects? Either is possible.
Using all Partner IDs is probably easier. Modify your report query which probably has something like WHERE partner_id = $P{partnerID}. Remove the where clause. Add grouping and sorting to the query to group on partner id. Each group can start on a new page. And now you don't need a parameter at all.
If you want the user to select the Partner IDs, then you need to use a multi-select input control rather than the single-select input control you're using now. Update your query to use something like this: WHERE $X{IN, partner_id, partnerID}. Add grouping and sorting as above.