Query /report asking for input ? in Apex

Hello all, my name is John and I am asking for help with the following,
I am new to Oracle, Apex and SQL, PL/SQL (as you can tell from my query below.)
I have the very basics of Apex (in that of making reports,forms etc).
I created this query on a view in SQL Developer where it is asking for start and end dates to filter the report. , which is what I want it to do and returns the results I want.
Now I would like to create a report in Apex where it asks for the between dates as it does in the posted query, When that is done I want to pass it to the bipublisher report for pdf printing.
I am running this query as a totals report already (without the line with WHERE clause query asking of course.) in an apex application, crude as it may be.
I have it running as a Interactive reports and can filter the dates that way of couse but I want to learn to create the user input type query/report in Apex.
I have been reading that I would need to use a "pl/sql anonymous block with a "declare' and a page process?. (gettting confused in the "declare" variables and the execute sections)
I have looked at numerous samples and still do not quite getting the blocks down.
If you could point me in the right direction of where to go or better yet if someome could show me coding on how to get this to work in apex report/query (s)?
Slow learn I guess
I am using APEX 3.1.2 on 11g database.
Thanks in advance for help on this.
++++++++++++++++++++++++++++++++++++
----query for truck totals from view-----------
,select
trucktotals.truck_number as "Truck Number",
trucktotals. truck_type as "Truck Type",
sum (trucktotals.end_miles-trucktotals.begin_miles) as "Total Miles",
sum (trucktotals.reg_hours+trucktotals.ot_hours) as "Total Hours",
sum (trucktotals.total_net_tons) as "Total Tons",
avg (trucktotals.equip_rent) as "EQR P_HR"from "trucktotals"
<strong>where trucktotals.wage_date between to_date(:Start_date) and to_date(:end_date)</strong>
group by trucktotals.truck_number, trucktotals.truck_type
order by trucktotals.Truck_Number----end query for truck totals from view------------------+++++++++++++++++++++++++++++++++++++
Edited by: [email protected] on Oct 31, 2008 12:49 PM
Edited by: [email protected] on Oct 31, 2008 12:53 PM
Edited by: [email protected] on Oct 31, 2008 12:54 PM

Hi Martin,
Thank you for the information, it is a real help to me and gives me more insight toward my learning .
It took me little while , the condition had to be modified a little bit
(had to put parentheses around the :PXXX_START_DATE .... END_DATE, and remove the period to get it to work).
where (:PXXX_START_DATE) is not null and (:PXXX_END_DATE) is not null
It does work to the sense it shows the start and end date fields and the button and the report results below that, and you can enter the dates and the results change.
Looking at my question, I should have been a little more clear in the fact I want query to ask for the dates first in a pop up type window, when you press the "Show Report" button,
and then branches off to show the report. That is the reason I think, I referred to a block or procedure to acomplish this?
Thanks and still learning
John

Similar Messages

  • Oracle 10g http issue. always ask for XDB and APEX password

    As i m uses oracle 10g express edition, it ask for XDB and Apex password frequently.
    i changed the port from 8080 to 8181 but still same problem.
    Any solution?

    If you wish to enable anonymous access to the ML DB repository, the following code creates the "<allow-repository-anonymous-access>" element if it is missing, or updates it if it is already present in the xdbconfig.xml file.
    CONN sys/password AS SYSDBA
    SET SERVEROUTPUT ON
    DECLARE
    l_configxml XMLTYPE;
    l_value VARCHAR2(5) := 'true'; -- (true/false)
    BEGIN
    l_configxml := DBMS_XDB.cfg_get();
    IF l_configxml.existsNode('/xdbconfig/sysconfig/protocolconfig/httpconfig/allow-repository-anonymous-access') = 0 THEN
    -- Add missing element.
    SELECT insertChildXML
    l_configxml,
         '/xdbconfig/sysconfig/protocolconfig/httpconfig',
         'allow-repository-anonymous-access',
         XMLType('<allow-repository-anonymous-access xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd">' ||
         l_value ||
         '</allow-repository-anonymous-access>'),
         'xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd"'
    INTO l_configxml
    FROM dual;
    DBMS_OUTPUT.put_line('Element inserted.');
    ELSE
    -- Update existing element.
    SELECT updateXML
    DBMS_XDB.cfg_get(),
    '/xdbconfig/sysconfig/protocolconfig/httpconfig/allow-repository-anonymous-access/text()',
    l_value,
    'xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd"'
    INTO l_configxml
    FROM dual;
    DBMS_OUTPUT.put_line('Element updated.');
    END IF;
    DBMS_XDB.cfg_update(l_configxml);
    DBMS_XDB.cfg_refresh;
    END;
    /

  • Report asks for database login in deployed version using crystal runtime for vs2008

    I am developing an application with VS2008 .Net with an Interface to use external Crystal  reports.
    I created a Report using Crystal Reports 2011 "doku.rpt".
    I am using a CrystalReportViewer "crpv" on a form.
    I am using a ReportDocument object (Variable "ReportDocumentM"), to which I load the file "doku.rpt"  and assign the logon Settings of main and subreports (which are the same for all tables).
    Using crpv.ReportSource = ReportDocumentM I assign the reportDocument to the ReportViewer.
    On my develop System everything works fine, the Report is shown in the Viewer.
    I created a Setup for my application and isnatalled it on another System. I also installed the CrystalRuntime for VS2008.
    When I try to Show the Report, a dailog "Database Login" appears and aks for the Connection.
    where the SERVER, USERID and (sometimes the PWD) Input fields are filled with  the correct values, but always the DATABASE field is empty.
    SERVER and DATABASE fields are READONLY.
    Hours and hours I tried differnt things, I also filled the logon info of the ReportViewer himself, nothing helped.
    The code:

    Sorry, I found the solution in another discussion:
    "Crystal ask for DB Connections on new installation"
    Correct Answer by Marc Trudel  on Jan 9, 2014 6:57 PM ' Solved Reports are all saved with SQLNCLI which is Sql Native client 9 (2005) New computers only have SQLNCLI10 which is Sql Native Client 10 (2008) Customer will either install SQL CLient 10 on all old computer and upgrade the reports or install SQL Client 9 on new computers which will avoid upgrading hundred of reports
    In my case the original Report was created on a System with both SQLNativeClient 9 and SQLNativeClient 10 on it. Because I originally used a SQL2000 database as datasource, the SQLNativeClient9 was used. It wasn't a Problem on the System when I dynamically connected to a SQL2008R" database, probably because the NativeClient9 was still there and could be used. On the other Computer only the NativeClient10 was existing and this caused the Problems.
    But I think that this is a bug in Crystal: I think ist normal, that from time to time there are changes in DataBase Connections and Clients, so the reports should be able to work also with new Clients. At least there  should be a message to inform about the Problem.

  • Query not prompting for input

    Hello,
    I am just learning Oracle and I am having problems getting a query to run correctly. I am creating a query on the HR database that should prompt the user for input. The code I have so far is below using the single ampersand substitution variable. When I run the query, I keep getting no data found instead of being prompted to enter a letter. I have also tried running the query using a ':' instead of an '&' and get the same results. If I change '&ltr%' to 'A%' the query will run, however I need it to prompt the user to input a letter. I have also tried to run the query without the single quotes, it will prompt for input and return an error of ORA-00911: invalid character. Any help given will be greatly appreciated.
    SELECT last_name, first_name, job_id, department_id
    FROM employees
    WHERE last_name LIKE '&ltr%'
    ORDER BY last_name;

    If you are the sql query form in APEX, try using this query:
    SELECT last_name, first_name, job_id, department_id
    FROM employees
    WHERE last_name LIKE :ltr
    ORDER BY last_name;For input include the % at the end of your string
    When looking for employees with last name like MILLER, enter MILL%
    Thank you,
    Tony Miller
    LuvMuffin Software
    (281) 871-0950

  • Report asking for password

    Hello all,
    When i am trying to open a report saved on local PC it is asking for BW server user id and password evertime i try to open it.
    this is problem with only one report.rest all reports are fine.
    Can anyone please help me out.
    Thanks

    One other possible reason for this is if your report contains a drilldown on a hierarchy. In that case, the report tries to retrieve the hierarchy icons from the MIME repository, which causes the report to try to login to BW even if you are not doing a query refresh.
    The workaround for this is to create an "anonymous" user (service, not dialog), as described in SAP Note 516884 and 487456.
    Hope this helps...
    Bob

  • Input ready query - not ready for input

    I have created the following in IP:
    1. A multiprovider based on an actuals cube (Standard infocube) and a plan cube (realtime - data can be planned not loaded).
    2. An Aggregation level on the multiprovider - containing infoobjects: 0version, employee, WBS element, infoprovider, fiscal year, fiscal year variant, 0currency and 0amount.
    3. A filter on the following infoobjects: employee (=123456), wbs element(XX.XX.XXX.X), version (variable - mandatory; ready for input), fiscal year(2008) and fiscal year variant(XX).
    4. A planning function to copy from version 0 (actual) to version 866 (random Value - Master data exists).
    I have created a query on the multiprovider and set the query properties correctly. I have also created two restricted key figures as follows:
    1. Actual (Restricted by infoprovider = actual; version = 0; fy = 2007; fyvar = XX)
    2. Plan   (Restricted by infoprovider = plan  ; version = input-ready variable; fy = 2008; fyvar = XX)
    I have used all the infoobjects in the agg. level in the query. I am using the same version number (866) on the query selection screen as defined in the filter.
    When I run the query, I can see only the actuals line. The plan keyfigure is not ready for input (although keyfigure properties are set to "Data can be changed using user entries or planning functions).   
    What am I doing wrong which is preventing the plan keyfigure from opening up for planning?
    I have also tried to create an agg. level on the plan infocube with similar settings as above. When I run the query, I get a no data found result - which I think is right because there is no data in the planning cube.
    PS: When I use the wizard in the planning modeler the keyfigure (0amount) can be changed.

    Hi Avya,
    Use a filter on the 0currency, for a particular currency type. (if problem is: currency type keyfigures are not input ready)
    This will mak it input ready.
    **Reward Points for useful answers**
    Regards,
    Naveenan

  • Why pop up is shown to ask for inputing sales order when using COR1

    I want to create a process order with order type PI01, but pop up window is shown to ask for sales order when using COR1.   I suppose there is something wrong with material master setting, but I've never set classification to this material.
    Please help.

    Hi Nichole
    Is the material assigned to any MRP group , if yes then check the  config settings on t-code OPPR, if stg group is assigned. also check the matrial type to default MRP group assignment settings in SPRO>production>mrp>MRPgroup> Define MRP Group for Each Material Type.
    regards
    Prasad
    reward if useful

  • Crystal Reports asking for Dbase username and id

    When I try to select a dBase file as my data source location in Crystal Reports, CR wants a user name and log in id for the dBase file...I do not have a user name or log in id for my dBase file...
    How can I get past this?
    Mitch

    I don't believe this is a DB2 z/OS question, perhaps it would be better to ask in another SDN forum?

  • "printf" asking for input data

    Hi, my cuestion is why when I ask the user to input data in the test bench with "printf" for my TOP.c not run?
    NOTE: I am a new user HLS :)
    Regards
     

    welcome
    Also besides Gabor's answer, please note that the testbench execution is wrapped into other scripts, so user input would not work because it's not interactive (if i remember correctly) so you can't do cin , gets , scanf etc
    From the GUI, when performing csim there is the ability to enter input arguments to the executable - ie the ones passed to argv.
    If you want to do user interactions, then you need to go to a command line and navigate to YOURPROJ/YUORSOLUTION/csim/build and run the executatble from there : it's call csim.exe.
    As such I would recommend to avoid using user inputs in your testbenchs - but you can use loops or text files with 1000s of test values.
    I hope this helps.

  • I have an Iphone5 .. thought reported asked for help to find to find my iphone.  this deactived my phone.  how do i get the deactivate 'beacon' turned off?

    I have an Iphone 5.  I thouht I'd lost I phone in an Wal-Mart.   A Wal-Mart clerk was trying to be helpful and got her Iphone and reported it lost and deactivated.
    Eventually, I found the phone.  It was completely cleared and the phone had a message to take it to my service provider.  I spent 2.5 hours at the Sprint office.  The Sprint Tech was finally told to contact an Apple Tech who said to downloand a I tunes account accout and then the phone would work .. it didn't.
    There seems to be some sort of program that needs to be done to the phone itself to turn off the deactivation beacon to the phone .. help .. does anyone know how to help me???
    thanks!!

    To be honest it sounds like phone is locked to disabled screen and needs to be DFUed and restored in itunes.
    Go to youtube and type in DFU. Watch movie and do the same and then restore in itunes. That part should not be a problem for Sprint tech if he knows anything. Or for you if you follow instructions here.
    http://support.apple.com/kb/ht1414
    After that Sprint may need to undo whatever they have done to blacklist.

  • Crystal reports asking for login information at runtime

    BH
    Hi,
    I've installed the Crystal Reports for VS2010 (filename: CRforVS_13_0_9).  I've created a new "Crytal Reports Application" Project and I've added dataset which is connected to Access 2010 database. When I create a new report I use the "Project Data > Ado.Net Datasets > CrystalReportsApplication8 > Ledger" as my connection. I connect the report to the CrystalReportViewer in Form1.
    However, when I run the application, I get prompted for a Username and Password. Even though I type in the correct user name and password, it does not let me login and view the report.  I've been struggling for a few days with this.  What am I doing wrong?  I do not want the application to prompt for a username and password, because I've already entered the credentials in the application.  I've searched on the web for a solution, but with no success.  Please help.  I'm using C#.
    Thanks
    Aron

    See if this document will help:
    Crystal Reports Guide To ADO.NET
    Go to page 6 and follow the instructions there. Also, see KBA 1525432 (search box is ion top right corner)
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter
    https://twitter.com/SAPCRNetSup

  • I am using firefox ver 8.0.1 and Canon LBP3200 printer. Whenever i give a print command from Firefox the browser crashes and the crash reporter asks for submitting the report.

    I am using the printer in a network. the same problem is faced when giving print on the canon LBP3200 from the local computer.
    its kind of very irritating.
    Even if i open a pdf document in the browser and then give print command the browser crashes and the crash reporter appears.
    Kindly help.

    Sir
    Following are the crash reports generated:
    bp-8af5ab44-6b84-427f-ae16-36acd2111227 12/27/201102:29 PM
    bp-bc804648-bbb4-4ac1-a93a-604052111219 12/19/201104:00 PM
    bp-1fb97a23-84cc-4922-91d0-21a732111219 12/19/201104:00 PM
    bp-c621113c-5446-4c16-8236-5a06c2111214 12/15/201101:07 PM
    bp-2f51489c-adcf-4f9e-8f16-f6cf52111212 12/12/201102:24 PM
    bp-5b9f3af7-d1e2-4882-b625-815cb2111212 12/12/201102:23 PM
    bp-0b7389bc-7047-478c-a01c-03f3b2111212 12/12/201102:22 PM

  • Crystal reports report allways asks for db creditentials, please vertify!

    Hi all, just upgraded couple of test servers up to pl 19 and pl 19 hf1
    my problem is, if i create a report (the ones allready in the b1 database still work as should), so this new report asks for creditentials every time on running.
    Reproduce:
    Upgrade pl 19, create a new report, save it inside SAP, run it from sap, and i get a box prompting for db creditentials.
    Help me vertify this issue!
    Please test your pl 19 systems with compleatly new riports (even the simplest report will do)
    Thank you all!
    Regards,
    D

    For Further reference only:
    PL19 indeed has this bug, PL20 is promised to fix it (i didn't have time to check this... but there are 2 notes about this so it is probably fixed)

  • Stock Aging Query/Report

    Dear all,
    We are on SAP B1 2007 PL42 and using Moving average as our cost valuation method.
    It doesn't have an inbuilt stock aging report, I have searched through the forum but none of the queries arebshowing the correct aging of stocks. Could anyone have a query/report/addon for stock aging?
    Kind Regards,
    Asif

    Hi,
    Try this one,with warehouse code as input parameter
    select b.code, b.name, b.Wh, b.Bal, b.Val,
    isnull(case when b.days <30 then b.bal end,0)'0-30 Days' ,
    isnull(case when b.days between 30 and 60 then b.bal end,0) '30-60 Days',
    isnull(case when b.days between 60 and 90 then b.bal end,0) '60-90 Days',
    isnull(case when b.days between 90 and 120 then b.bal end,0) '90-120 Days',
    isnull(case when b.days between 120 and 150 then b.bal end,0) '120-150 Days',
    isnull(case when b.days between 150 and 180 then b.bal end,0) '150-180 Days',
    isnull(case when b.days >180 then b.bal end,0) 'Above 180 Days'
    from (
    select a.code,a.name,a.wh,a.bal,a.val,datediff(dd,dt,getdate())'days'
    from (
    select max(t0.itemcode)'Code',max(t0.Dscription)'Name',
    max(t0.Warehouse)'Wh',
    sum(t0.inqty-t0.outqty)'Bal',sum(t0.transvalue)'Val',max(t0.docdate)'dt'
    from oinm t0 inner join oitm t1 on t0.itemcode=t1.itemcode
    where t0.warehouse='[%1]'
    group by t0.itemcode
    )a
    )b order by code

  • Crystal asking for credentials

    I have a new SQL 2005 instance on the same server as the previous instance and have changed the data source of Crystal reports to use the new instance.
    Now the reports ask for login credentials though I pass them with the request. If I point the report back to the previous DB instance, the credentials pass through fine and the reports run.
    I'm seeing some kerberos errors on our report server but haven't been able to diagnose what's being dropped going against the new DB.

    You may need to strip off the location of the original database
    Something like:
    For Each crTable in crTables
         crTableLogOnInfo = crTable.LogOnInfo
         crTableLogOnInfo.ConnectionInfo = crConnectionInfo
         crTable.ApplyLogOnInfo(crTableLogOnInfo)
         crTable.Location = crTable.Location.SubString(crTable.Location.LastIndexOf(".")+1)
    Next
    The issue may be that if you designed the report against the old database and installed the new database on the same machine the report will try and use the old database.
    This is because the old database is saved with the report and if you point the report to that machine it will see the old database sitting there and try and use it.
    The last line in the above code strips that out and should allow you to hit the new database.
    Of course this assumes that this is the issue you are running into

Maybe you are looking for

  • Code hints don't work - include files using a variable

    In Dreamweaver CS 5.5 code hints didn't work properly. DW would not look at my code and find the include files and look at the functions inside them when using a variable to make an absolute path, which is the best way to include files in PHP (its fa

  • MacBook Pro won't sleep or stay shut down?

    Product: MacBook Pro 13" "mid 2009," 8GB RAM (3rd party RAM upgrade), 2.26GHz, Mountain Lion 10.8.2 This happens ~75% of the time: 1) When I put it to sleep, the fans keep running, hard drive keeps spinning, and the outside front pulsing light goes t

  • Photos with noise reduction filters applied shows too much noise in preview mode

    The Noise Reduction filters do an impressive job in Lightroom, but the preview of photos when zoomed out is sometimes poor. This becomes especially visible on photos with a high amount of noise reduction applied. When zooming in to 1:1 I see that the

  • Setting-up a backup server

    Dear Expert, My SAP is running on SQL2000 server using Win 2K as the platform. We are getting new servers as a backup to minimise the downtime in case the production server is down. Need some advice /info on setting up the back up server. 1- Is d/b r

  • [Z3 compact] Bluetooth headphones disconnecting after unlock screen

    I've just encountered a strange issue while listening to music over bluetooth on my Sony MDR-10rbt headphones (connected in high quality mode, aptx codec used). It's fine until you try to unlock te screen, it then immediatly switches to play the musi