Capture current query for a report region
Apologies if this is answered elsewhere, but I could not find it.
I have a reporting application where several different reports that have a list of customers. I would like to develop a means to generate a mailing list for the customers that is generic and can be used on any report. I envision getting the list of customer by executing a query like:
select person_id from
( <report region query> );
Is there a way to get the current query (or query result) for a report region and process it in a PL/SQL procedure? This would need to work for regions that have an SQL query and a PL/SQL function returning a query.
Thanks,
Bill
sorry for the double post, browser trouble...
Similar Messages
-
Problem with using a Spatial Query in a report region
All: I am trying to create a report region using the below query. The query is syntactically correct and returns 10 rows. I have checked it out in SQL Developer AND in APEX SQL Workshop. It returns rows in 1-2 seconds.
However, after putting the query into a report region, the APEX page locks up when it runs. I've tried masking it in a view, using other functions. I can places the spatial function in the select clause and it works. However, placing the function in the Where clause causes the page to lock up.
Any thoughts?
Thanks,
John
select lastname, address
from changetracking.individuals
where sdo_nn (spatiallocation, MDSYS.SDO_GEOMETRY(2001,8265,MDSYS.SDO_POINT_TYPE(-87.55728,33.137569,null),null,null), 'sdo_batch_size=10') = 'TQImaging is not officially supported in the Measurement & Automation (MAX) toolkit, though you may find some luck with our free legacy QImaging LabView interface here: http://www.qimaging.com/support/downloads/software/windows/QCamLabViewInstaller221.exe depending on the version lf LabView you're using.If you're looking for something that is actively updated and supported, you may want to get back in touch with Fred at +1.800.874.9789 and ask about our SITK LabView interface as well.
PMQI_Josh,
Yes I've already installed the LabVIEW interface beforehand. Also the version of LabVIEW I'm currently using is 8.6. I'll get in contact with Fred to see if there's a solution to this problem. Thank you. -
Hi! Anybody who has a sample sql query for aging report? basically this is the table structure and sample data
bill_no B1-01 B1-02 B1-03
bill_date 01-JAN 01-FEB 01-MAR
previous_balance 100 600 800
current_charges 500 200 400
total_due 600 800 1200
As of march 1, total due is 1200. how can i get the breakdown of 1200 as to the number of days it has been due. ex. 500 (60 days old 01-JAN to 01-MAR), 200 (30 days old), 400 (current)
please help. thanks!
nullSELECT CEIL((SELECT MAX(Bill_Date) FROM Bill)- Bill_Date) Days , Previous_Balance, Current_Charges FROM Bill ORDER BY Days ASC
Then create a matrix reprot. -
User Interface Template for Interactive Report Region
In 3.2, where do we set the user interface template for Interactive Reports region?
No matter what out of the box theme I switch to, the Interactive Reports region shows the same. What and where do I change the template so that alternating rows use two different colors?There is no template for Interactive Reports like for a "normal" report. You need to modify the CSS and supply your own for this to happen.
I believe most things are tagged with #apexir - firebug with Firebox is invaluable. This thread may help:
Re: changing the look and feel of interactive report. -
ClariFit Report Instant Search [Plug-in] for 2 Report Regions
Hi,
can we apply ClariFit Report Instant Search [Plug-in] for two report regions at a time?,
can we one search field for two different report regions?
Thanks in advance.
Chandranthank u so much VC guru, it really workd now action is happening wen i click on right click options. but again i hav an issue
i used 2 right click options like PAGE2, GOOGLE., which redirects to the respective pages. and i used JS function as
function myMenuAction2() {
if (Menu='page2')
window.location="http://apex.oracle.com/pls/apex/f?p=71510:2:132217491108949:::::";
if(Menu='google')
window.location="http://www.google.com";
but if i click on both the right click options individually, its get redirected to the 2nd page only... and not to the google page at all. i jus wanted to know how to do it guru... and the credentials are http://apex.oracle.com/pls/apex/f?p=71510:1:16973655787072::::: (username-test; paswrd: apex14gm) ... pls help me out....
thanks in advance -
Improving a query for a report in b1
Dear All,
We have a query for a report. this report display all invoices with it´s Dscription in the system just have 3 descriptions so i need the the report display the this description in column not in row and then have the sum by description. i dont know how can i put a picture for showing the example.
Some one knows how can i do? down the code.
Regards
NANCY
SELECT distinct T1.visorder as 'No. Linea',
T0.DocNum as 'No. Factura',
T0.DocDate as 'Fecha',
T0.CardName as 'Cliente',
T1.U_CANTIDAD as 'Tonelaje',
T0.U_OPERACION as 'No. Operación',
T0.DocCur as 'Moneda',
T0.GrosProfit as 'Ingreso total de factura',
T1.ItemCode as 'Código',
T1.Dscription,
T1.Quantity*T1.Price as 'Importe por Servicio',
T1.LineVat as 'IVA por servicio',
T0.VatSum as 'IVA por factura',
T2.PlngGroup as 'Cuenta SUN'
FROM OINV T0 LEFT JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry
inner join OCRD T2 ON T0.CardCode = T2.CardCode
WHERE T0.Series = 49 and
T0.DocDate BETWEEN [%0] AND [%1]Hi Nancy,
I'm not sure that I understand your requirement 100% but assuming you only have 3 descriptions then the following would give you totals for your different descriptions...
Simply replace the text ' etc in the code below with the descriptions values.
SELECT distinct
T1.visorder as 'No. Linea',
T0.DocNum as 'No. Factura',
T0.DocDate as 'Fecha',
T0.CardName as 'Cliente',
T1.U_CANTIDAD as 'Tonelaje',
T0.U_OPERACION as 'No. Operación',
T0.DocCur as 'Moneda',
T0.GrosProfit as 'Ingreso total de factura',
T1.ItemCode as 'Código',
CASE
WHEN T1.Dscription = '<description1>'
THEN T1.Quantity*T1.Price
ELSE 0
END as '<description1>',
CASE
WHEN T1.Dscription = '<description2>'
THEN T1.Quantity*T1.Price
ELSE 0
END as '<description2>',
CASE
WHEN T1.Dscription = '<description3>'
THEN T1.Quantity*T1.Price
ELSE 0
END as '<description3>',
T1.LineVat as 'IVA por servicio',
T0.VatSum as 'IVA por factura',
T2.PlngGroup as 'Cuenta SUN'
FROM OINV T0 LEFT JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry
inner join OCRD T2 ON T0.CardCode = T2.CardCode
WHERE T0.Series = 49 and
T0.DocDate BETWEEN [%0] AND [%1]
Hope this helps.
Regards,
Sean -
I've created the below crosstab query for a report.
Select Grouping_Condition,Warehouse,Max(Value) Over (Partition By Grouping_Condition,Warehouse) As Total,
Sum(Value) Over (Partition By Warehouse) As Total_Containers_Per_Warehouse,
Sum(Vat1Ue) Over () As Total_Containers,
(Max(Vat1Ue) Over (Partition By Grouping_Condition,Warehouse))
/(Sum(Vat1Ue) Over (Partition By Warehouse))*100 As Total_Pct
From
Seleect Grouping_Condition,Warehouse,Count(*) As Value
From
Set1Ect
T1.Warehouse,Shipped_Weight As Shipped_Tons,T1.Max_Weight As Maxtonnes,
Case When (Shipped_Weight)< (T1.Max_Weight*0.001)*0.95 Then 'containers_under_95'
When (Shipped_Weight*0.001) Between (T1.Max_Weight*0.001)*0.95 And (T1.Max_Weight*0.001) Then 'containers_95_100'
Et1Se 'containers_above_weight'
End Grouping_Condition
From
Tabt1E1 T1
,Tabt1E2 T2
,Tabt1E3 C
Where
T1.Co11 = T2.Col1
And T1.Col2=C.Col2
And More Conditions
Where Warehouse In ('W1','W2','W3','W4','W5')
Group By (Grouping_Condition,Warehouse)
The Above Query Gives Me Output Something Like Below:
Grouping_Condition Warehouse Total Total_Containers_Per_Warehouse Total_Containers Total_Pct
Containers_95_100 W1 5 10 60 50
Containers_Under_95 W1 5 10 60 50
Containers_95_100 W2 10 20 60 50
I've Got Report In The Below Format
W1 W2 W3 W4 W5 Total
Total_Containers 10 20 60
Containers_95_100 5 10 15
Containes_95_100_% 50 50 ????
I Need To Calculate The Total Percentage In The Above Table With ????
Any Help Is Much Appreciated..It appears as though you already have your groupings and counts per grouping, but require a ratio of each groupings count against all other counts. Is that correct ?
If so, try the new 11g analytic function, something like this:
select Grouping_Condition
,Warehouse
,ratio_to_report(Value) over () as Count_Ratio_over_Report
.. -
Need a query for monthly Report
Hello All,
I need a query for monthly report,
comp_code
emp_id
dept_id
work_day
100
A100
MECH
01/01/2013
100
A100
MECH
02/01/2013
100
A100
MECH
03/01/2013
100
A100
MECH
04/01/2013
100
A100
MECH
05/02/2013
100
A100
MECH
08/02/2013
100
A100
MECH
09/02/2013
100
A100
MECH
10/02/2013
100
A100
MECH
12/05/2013
100
A100
MECH
13/05/2013
100
A101
CIV
01/04/2013
100
A101
CIV
02/04/2013
100
A101
CIV
03/04/2013
100
A101
CIV
04/04/2013
100
A101
CIV
06/04/2013
100
A101
CIV
06/06/2013
100
A101
CIV
07/06/2013
100
A101
CIV
08/06/2013
100
A101
CIV
09/06/2013
100
A101
CIV
10/06/2013
100
A101
CIV
11/12/2013
100
A101
CIV
12/12/2013
100
A101
CIV
13/12/2013
100
A101
CIV
14/12/2013
Dear friends this the sample table of my report.In which table has contain list of employees with their working days(actual table has contain almost 5laks of records).
suppose user choose the date between 01/01/2013 and 31/12/2013 then the result should be like this.
comp_code
emp_id
dept_id
month
Total_work
100
A100
MECH
JANUARY
4
100
A100
MECH
FEBRUARY
2
100
A100
MECH
MARCH
0
100
A100
MECH
APRIL
0
100
A100
MECH
MAY
2
100
A100
MECH
JUNE
0
100
A100
MECH
JULY
0
100
A100
MECH
AUGUST
0
100
A100
MECH
SEPTEMBER
0
100
A100
MECH
OCTOBER
0
100
A100
MECH
NOVEMBER
0
100
A100
MECH
DECEMBER
0
100
A101
CIV
JANUARY
0
100
A101
CIV
FEBRUARY
0
100
A101
CIV
MARCH
0
100
A101
CIV
APRIL
5
100
A101
CIV
MAY
0
100
A101
CIV
JUNE
5
100
A101
CIV
JULY
0
100
A101
CIV
AUGUST
0
100
A101
CIV
SEPTEMBER
0
100
A101
CIV
OCTOBER
0
100
A101
CIV
NOVEMBER
0
100
A101
CIV
DECEMBER
4Hi,
If you want the output to include months where no work was done (with 0 in the total_work column) then you need to outer-join a "table" that has one row per month, and make it a partitioned outer join:
WITH got_end_points AS
SELECT TRUNC (MIN (work_day), 'MONTH') AS first_month
, TRUNC (MAX (work_day), 'MONTH') AS last_month
FROM table_x
, all_months AS
SELECT ADD_MONTHS (first_month, LEVEL - 1) AS a_month
, ADD_MONTHS (first_month, LEVEL) AS next_month
FROM got_end_points
CONNECT BY LEVEL <= 1 + MONTHS_BETWEEN (last_month, first_month)
SELECT t.comp_code
, t.emp_id
, t.dept_id
, m.a_month
, COUNT (t.work_day) AS total_work
FROM all_months m
LEFT OUTER JOIN table_x t PARTITION BY (t.comp_code, t.emp_id, t.ept_id)
ON t.work_day >= a.a_month
AND t.work_day < a.next_month
GROUP BY t.comp_code
, t.emp_id
, t.dept_id
, m.a_month
ORDER BY t.comp_code
, t.emp_id
, t.dept_id
, m.a_month
As posted, this include every month that is actually in the table. You can change the first sub-query if you want to enter first and last months.
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
Point out where the query above is giving the wrong results, and explain, using specific examples, how you get the correct results from the given data in those places. If you changed the query at all, post your code.
Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
See the forum FAQ: https://forums.oracle.com/message/9362002 -
Can we have one submit button for mutliple report regions querying same tbl
Hello,
I have a normal multiple report regions in a page with some editable in those regions, these report regions are querying the same table. Now, Is it possible to have one submit button for all the report regions to update the underlying table data?
Can anyone please help me out with this one.
thanks,
OrtonFirst you'll almost certainly need to roll your own - the built-in stuff is fairly basic and more than likely won't help.
It sounds like your process flow should be something like:
1) Person clicks button.
2) You do a select for update in the process to get the loan id and put it in the person's queue. At this point you may want to flag that column as having been assigned so it can't be assigned again.
3) You then forward them to the form to enter data. Personally I would create my own items and processses and forgo the built-in form stuff but you may be able to use the Automated Row Fetch. If you do your own, you just reference the objects like:
insert into table
values(:P1_1, :P1_2, :P1_3)Edit - Another way would be to use a regular form and insert Stop/Start Tables - so it can look like a different section, but it really is just a label. Thats another option. -
Display records returned for a query in the Report Region Title
Hi,
Is there any variable set that can be referenced to indicate how many records have been returned for a specific query. I have several hide/show regions dealing with various reports, and I would like to add a little info into the region title to display how many records there were returned for the report in this region.
Thx in Advance,
cliffHi,
addendum
These are simple sql queries BTW. I've seen posts alluding to the SQL%ROWCOUNT when using cursors. Is there any variable we can reference when using a simple sql query?
thx
cliff -
TDS Amount on Vendor Advance Shows positive value in *QUERY* for TDS Report
Hi Everybody,
I have made a query for List of TDS Report with Vendor informations as required by my client. In which the value of TDS on Vendor Advance Payment appears as positive value instaead of negative value. Please suggest how to rectify.
Thanks,
PaulDear,
If you have cleared the advance in F-54, then this will reverse the tax amount. That could be the reason for tax amount in debit. -
Hi,
I have to generate a report which contains a query with database link. This database link is not hard coded and would be picked up from another report which contans a link to this report. So this database link value for the query could be any. Can anyone guide me hot to write a dynamic select statement so that i could append database link value at run time.
Thanks
SalmanHi,
You can not directly use a PL/SQL query to create an Interactive Report - that is not yet available.
What you could do is create a collection from your query and then use that for the report. Have a look at: [http://download-uk.oracle.com/docs/cd/B32472_01/doc/appdev.300/b32471/advnc.htm#BABGHJFD].
In there, you will see APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY - this allows you to create a collection from a string. You could add a PL/SQL process to your page that runs "On Load: Before Header" that actually creates the collection. Something like:
BEGIN
IF APEX_COLLECTION.COLLECTION_EXISTS('MYCOLLECTIONNAME') THEN
APEX_COLLECTION.DELETE_COLLECTION('MYCOLLECTIONNAME');
END IF;
APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY('MYCOLLECTIONNAME','MY SQL QUERY STRING');
END;Your Interactive Report can then be based on:
SELECT SEQ_ID, C001, C002, C003, ...
FROM APEX_COLLECTIONS
WHERE COLLECTION_NAME = 'MYCOLLECTIONNAME'The tricky part is the headings as these would tend to be the SEQ_ID, C001, C002, C003, etc column names from the collection itself.
To get around this, make sure that the report's sql statement includes as many Cnnn columns as you will need for the widest of the reports. Before doing anything else, run the report once to make sure that all these columns are included in the output.
Then, through Shared Components, Application Items, create items that will hold heading names - for example, G_HEADING1, G_HEADING2 etc - one for each possibile column.
Now, update the process to:
BEGIN
IF APEX_COLLECTION.COLLECTION_EXISTS('MYCOLLECTIONNAME') THEN
APEX_COLLECTION.DELETE_COLLECTION('MYCOLLECTIONNAME');
END IF;
IF ..test1.. THEN
APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY('MYCOLLECTIONNAME','MY SQL QUERY STRING 1');
:G_HEADING1 := 'ColumnHeading1Value';
:G_HEADING2 := 'ColumnHeading2Value';
:G_HEADING3 := NULL; -- column not used for this query, so set it to null
ELSIF ..test2 .. THEN
APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY('MYCOLLECTIONNAME','MY SQL QUERY STRING 2');
:G_HEADING1 := 'ColumnHeading1Value';
:G_HEADING2 := 'ColumnHeading2Value';
:G_HEADING3 := 'ColumnHeading3Value';
ELSIF ...etc...
.. etc ...
END IF;
END;Finally, on the report itself, set the column headings to *&G_HEADING1.*, *&G_HEADING2.* etc. Then, on each column, set a Condition of "Value of Item in Expression 1 is NOT NULL" and in Expression 1, enter in the application item for that column - eg, G_HEADING1
I have done all that here: [http://apex.oracle.com/pls/otn/f?p=16338:5] - select either Departments or Employees from the list and the report will change.
Andy -
Retrieve underlying SQL query for deski report via java SDK in BOXIR2
Hi all,
I am trying to retrieve underlying SQL queries of a deski report in BOXIR2. However I find the error as
oDataProvider = oDocumentInstance.getDataProviders().getItem(i1);
System.out.print(oDataProvider.getName());
oSQLDataProvider = (SQLDataProvider) oDataProvider;
oSQLContainer_root = oSQLDataProvider.getSQLContainer();
But "This feature is not supported for desktop Intelligence " exception has occured.
I am running the same query for Webi, and I did not find any issue . After several time spending in google, it appears to me that this code is supported by webi only. But "This feature is not supported for desktop Intelligence " exception has occured.
Please help me to find out the solution in java SDK. If its not supported by Java SDK, then could you please provide me any workaround , e.g. any macro . Any help !!
Regards,
Nita
Edited by: Nita Prasad on Aug 11, 2009 11:20 AM
Edited by: Nita Prasad on Aug 11, 2009 11:25 AMHi Fritz,
I am not getting the way.. how to open the deski report programmatically. I am writing the code in this way:
Dim oInfoObjects1 As CrystalInfoStoreLib.InfoObjects
Set oInfoObjects1 = oInfoStore.Query("SELECT * FROM CI_INFOOBJECTS WHERE SI_NAME='" & oInfoObject.Title & "' AND SI_ID='" & oInfoObject.Id & "' order by SI_NAME")
Dim oInfoObject1 As CrystalInfoStoreLib.InfoObject
Dim UserCount1 As Integer
UserCount1 = oInfoObjects1.ResultCount
MsgBox "SELECT * FROM CI_INFOOBJECTS WHERE SI_NAME=' " & oInfoObject.Title & " ' AND SI_ID=' " & oInfoObject.Id & " ' order by SI_NAME"
MsgBox " Total number of Deski reports are : [" & UserCount1 & "]", vbOKOnly
Dim j As Integer
For j = 1 To UserCount1
Set oInfoObject1 = oInfoObjects1.Item(i)
sFile_ReportList = StrConv(oInfoObject1.Title, vbLowerCase) & ".rep"
sFile_Output = "D:\TraceWrite1\ " & StrConv(oInfoObject1.Id & "_" & oInfoObject1.Title, vbLowerCase) & ".txt"
sFile_ReportListTemp = StrConv(oInfoObject1.Files.Item(j), vbLowerCase)
MsgBox "[" & sFile_ReportList & "]", vbOKOnly
If Dir(sFile_ReportList) = "" Then
MsgBox "The text file [" & sFile_ReportList & "] for the DeskI documents does not exist!" & vbCrLf & "Aborting process."
Exit Sub
End If
I am getting the error on line ... If Dir(sFile_ReportList) = "" Then... The code is not able to locate the deski report path.
Is this the correct way to get a deski report information? Please let me know, If I am going in the right direction.
Edited by: Nita Prasad on Aug 18, 2009 3:47 PM -
Query for recurring reports using Query Builder in Business objects
1. How to count webi Recurring reports using query builder in business objects? (Need Query for this)
2. How to count Crystal Recurring reports using query builder in business objects? (Need Query for this)
I am able to get summerized recurring reports using Query Builder.
For Example we have 343 reports which are under recurring (This includes both Webi Reports and Crystal Reports).
we need to get individually how many webi reports are under Recurring and Crystal reports are under Recurring.1. How to count webi Recurring reports using query builder in business objects? (Need Query for this)
2. How to count Crystal Recurring reports using query builder in business objects? (Need Query for this)
I am able to get summerized recurring reports using Query Builder.
For Example we have 343 reports which are under recurring (This includes both Webi Reports and Crystal Reports).
we need to get individually how many webi reports are under Recurring and Crystal reports are under Recurring. -
Define Reports For Branch Reporting/Region Wise Reports
Hi,
Is there any possibilities to define our own reports for Branch Wise/Region Wise Reporting?
Kindly give me suggestion if possible with the process to create.
Thanks
Sap Guru
kischowdary*gmail.comHi:
You can define your own customized reports for Branch Wise/Region Wise Reporting.
This is the work of a technical person ie. ABAPer.
You have to give him tables names,fields for defining reports.
Alternatively, you can use SAP BW to define your customized reports.
Please let me know if you need more information.
Assign points if useful.
Regards
MSReddy
Maybe you are looking for
-
Script or query to generate a report of null or not null columns
I need a script/query it should pick up all the tables from user_tab_columns and produce a report for all the tables which are the columns are null and not null.
-
Hello. I set up a new dataguard and am receiving errors when I try to start it on my primary. I looked at support note 172779.1 and it says the DB_UNIQUE_NAME needs to match from the log_archive_dest_2 to the db_unique_name of the standby. I think it
-
Hi all, I am using Model nodes for getting data and sending data back to BAPI. But if i perform search, i get results and once i come back and perform another search its showing previous results. I am invalidating Context and eventhen it shows previo
-
Using Embedded Summary in Cross-tab Report in Crystal
Hi, I am trying to use embedded summary to calculate % Increment by fiscal period (in column) for specific sales areas (in rows). I need some help in identifying the formula which I can use to do so. If someone has experience of using embedded summar
-
Open more than one File in Forms
Hi, my Question is if there is a possibility to open more Files(Text-Files) then one File. That means that if I press my Button in Forms the Program should open all Files in a Folder. Can I do this with a LOOP. Example: LOOP in_file:=TEXT_IO.FOPEN('c