Is it possible to sort report using parameters?

Hi,
I am building a report - which generates select query based on the parameters entered by the user.
Could you help me with how to sort output with the parameter chosen by the user himself? Thanks,

I will give you 2 answers since I am not sure exactly how your report runs.
Lets say your users choose a couple parameters to limit certain columns by in your where clause. In this case, you would want to just create a user parameter, and use that parameter in the where clause.
select col
from table
where job_id = :P_JOB_ID and
start_date between :P_START_DATE and :P_END_DATEPretty simple. Now here is how I would do it if those are optional parameters, and the user could enter a value, or could leave all blank.
select col
from table
where job_id = nvl(:P_JOB_ID, job_id) and
start_date between nvl(:P_START_DATE, start_date) and
nvl(:P_END_DATE, end_date)If its null, it will set the column equal to each other, and will return all the rows (good little trick).
The other case is if you need a different select/where clause entirely based on what the user sends in. For example, lets say you have 2 entirely different queries based on a certain parameter. Then you'd want to use lexical parameters and an after parameter trigger.
I think you are looking for the first scenario, so try that and post back if you are looking for something different

Similar Messages

  • Link two reports using parameters

    Hi,
    We are using business object XI.
    I am trying to link two reports using parameters. I cannot use subreport option becuase inside the subreport I should link another report too. So,
    Report 1(High level summary)
    Report 2(Middle level summary)
    Report 3(Detail level)
    I tried to use hyperlink option and used following string.
    http://<server_name>/<Virtual Directory>/object.rpt?prompt0={?param1}&prompt1={?param2}
    Here is my question.
    1. Server name: Does it include port number??
    2. Virtual Directory: I am absolutely lost. I tried the "frsinput" directory the actual rpt file is storing. It is not working.
    Do you have general path??
    3. Parameters: I have 5 parameters to pass. 3 of them are Strings and the rest are DateTime.
    Basically, I need any tutorial about this kinds of things. The tutorial I have got only discribe link like "www.yahoo.com"
    BTW, is this even possible solution??

    Hi,
    I am trying to link two reports in the crystal report designer->deploy to the server->show in the DHTML viewer.
    When I create a URL from report A, it looks like "&" disapears. For example, I created a hyper link from report A using formula,
    http://server:port/........openDocument.jsp?sDocName=reportB&sType=rpt&paramName1="Trim(ToText({?param1},"#####"))"&paramName2="+Trim(ToText ({?param2},"#######"))
    But when I see the actual URL, all the "&" disappears so it looks like
    http://server:port/........openDocument.jsp?sDocName=reportBsType=rptparamName1="Trim(ToText({?param1},"#####"))"paramName2="+Trim(ToText ({?param2},"#######"))
    No wonder it is not working.
    I guess I need special protection for "&" sign. Do you know any?

  • Calling report using parameters

    Dear experts,
    I have seven reports objects.I am willling to club them into a single screen.
    Selection parameters in these reports are more or less same.Little bit variation is there.
    Is it possible that i club complete input parameters on single screen and present these parameters
    to user and then call various transactions selected by radio buttons on basis of what user give in these selection parameters. Is there something of that sort in call transaction or SUBMIT.
    I could see help but could not conclude how ?
    Thanx in advance.

    Hi
    You can use Call Transaction for each report using:
    CALL TRANSACTION tcod [AND SKIP FIRST SCREEN] [USING itab].
    At the end of the Call, it returns to calling program and proceeds to next stmt.
    Also if you want to use Submit:
    [Submit|http://help.sap.com/saphelp_nw04/helpdata/EN/9f/db9dd035c111d1829f0000e829fbfe/content.htm]
    Also check out the code at: [Filling the Selection Screen of a Called Program|http://help.sap.com/saphelp_nw04/helpdata/EN/9f/dba51a35c111d1829f0000e829fbfe/content.htm]
    Hope this helps
    Regards,
    Jayanthi.K

  • Is it possible to sort document using Description field?

    In a specific folder you can sort documents by "Name", "Size" and "Last modified" fields. does anyone know how to enable the sort by "Description"?
    Thanks,
    Nadia

    I will give you 2 answers since I am not sure exactly how your report runs.
    Lets say your users choose a couple parameters to limit certain columns by in your where clause. In this case, you would want to just create a user parameter, and use that parameter in the where clause.
    select col
    from table
    where job_id = :P_JOB_ID and
    start_date between :P_START_DATE and :P_END_DATEPretty simple. Now here is how I would do it if those are optional parameters, and the user could enter a value, or could leave all blank.
    select col
    from table
    where job_id = nvl(:P_JOB_ID, job_id) and
    start_date between nvl(:P_START_DATE, start_date) and
    nvl(:P_END_DATE, end_date)If its null, it will set the column equal to each other, and will return all the rows (good little trick).
    The other case is if you need a different select/where clause entirely based on what the user sends in. For example, lets say you have 2 entirely different queries based on a certain parameter. Then you'd want to use lexical parameters and an after parameter trigger.
    I think you are looking for the first scenario, so try that and post back if you are looking for something different

  • Cache issue in Reports using Parameters

    Hi,
    I have a Report which uses multiple Regions to show conditionally based on the Parameters selected.
    e.g. PARAM1, PARAM2, PARAM3
    (1)PARAM1,null,null - Selected : Shows Region : 1,2,3
    (2)PARAM1, PARAM2, null- Selected : Shows Region : 1,4,5,6
    (3)PARAM1, PARAM2, PARAM3 - Selected : Shows Region 1,7,8
    After I get Report based on (1). And then go back & select (2). It works fine. But when I go back & select (1) again, it still shows the Regions displayed based on the (2).
    Is it a Cache Issue ?
    Please advise
    Thanks
    Sandeep

    hey sandeep--
    if i'm understanding you correctly, this does indeed sound like a cache issue. based on what i'm thinking is your expected behavior, it sounds as if you're forgetting to clear the cache for your other PARAM items when a value is selected from one of your PARAM items that, from a logical perspective, comes before it. so to use your example...
    After I get Report based on (1). And then go back & select (2). It works fine. But when I go back & select (1) again, it still shows the Regions displayed based on the (2).
    ...i'd say you'd want to add a process to your page that fires after submit and clears the cache for PARAM2 when the value of :REQUEST = 'PARAM1'.
    hope this helps,
    raj
    ps-if i've misunderstood your issue, please explain it in more detail.

  • Is it possible to brust report using data template?

    I fail to do this with many trials.
    Can anyone give me a guide?
    Thank a lot!

    Hi Murali,
    I am also facing the same problem with bursting, it is giving the Java error as follows
    oracle.apps.xdo.servlet.scheduler.ProcessingException: java.lang.NullPointerException
    at oracle.apps.xdo.servlet.scheduler.XDOJob.runBurstingReport(XDOJob.java:2116)
    at oracle.apps.xdo.servlet.scheduler.XDOJob.execute(XDOJob.java:358)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
    Caused by: java.lang.NullPointerException
    at oracle.apps.xdo.servlet.scheduler.XDOJob.runBurstingReport(XDOJob.java:2018)
    But i am unable to understand create a new data model logic which u have explained in "http://forums.oracle.com/forums/thread.jspa?messageID=3965055&#3965055".
    Could you please give some example and expalin the same.
    Thanks in Advance
    Manohar Reddy

  • Unable to modify Report using JRC alone

    Hi
    I am trying to modify the report generated thru Crystal reports 2008 programmatically using JRC.
    I dont see any API in com.crystaldecisions.reports.sdk.DataDefController to modify filters,groups,parameters,sort objects and summaries.
    I could find Controller API to modify the above in com.crystaldecisions.sdk.occa.report.application package part of RAS SDK which requires RAS to be installed.
    WIll it be possible to modify report using JRC alone?
    because when i use com.crystaldecisions.sdk.occa.report.application.ReportClientDocument class to open a report, it thorws
    ReportSDKServerException: There is no server specified exception.
    and i am not sure what need to set for ReportClientDocument.setReportAppServer()
    Pls help me .

    Hi,
    Thanks for your help.
    I am getting the below  exception when I am trying to open a report programmatically using  com.crystaldecisions.reports.sdk.ReportClientDocument.
    oReportClientDocument.open(reportName, 0);
    I am not sure how to resolve this issue.
    I have even created a new rpt file. I am getting the same exception/
    I could open this report directly thru Crystal Reports.
    12/16/10 16:19:57:376 IST] 10c3f2a6 WebGroup      E SRVE0026E: [Servlet Error]-[The document is being opened.]: com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: The document is being opened.---- Error code:-2147215349 Error code name:docNotReady
    Error code:-2147215349 Error code name:docNotReady
         at com.crystaldecisions.sdk.occa.report.lib.ReportSDKException.throwReportSDKException(Unknown Source)
         at com.crystaldecisions.client.helper.ObjectState.a(Unknown Source)
         at com.crystaldecisions.client.helper.ObjectState.if(Unknown Source)
         at com.crystaldecisions.client.helper.ObjectState.stopping(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ClientDocument.close(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.close(Unknown Source)
         at com.crystaldecisions.reports.sdk.ReportClientDocument.close(Unknown Source)
         at org.apache.jsp._CrystalReportViewer._jspService(_CrystalReportViewer.java:389)
         at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:344)
         at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:662)
         at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
         at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
         at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
         at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
         at com.ibm.ws.webcontainer.servlet.ServletInstance.service(
    Pls help me.
    Edited by: D.Sangeetha on Dec 16, 2010 12:33 PM

  • How to create report using Procedure.

    Hi All,
    I want to create report in apex.But i do not have sql code.I have one procedure.Is it possible to create report using this procedure in apex.
    CREATE OR REPLACE PROCEDURE headcsv_prc2
    AS
       CURSOR cr_header
       IS
          SELECT ood.organization_code, fm.formula_no AS "FORMULA_NAME",
                   fm.formula_vers AS "FORMULA_VERSION",
                   fm.formula_desc1 AS "FORMULA_DESC",
                   DECODE (fm.formula_status,
                           100, 'New',
                           400, 'Approve for Laboratory Use',
                           700, 'Approve for General',
                           800, 'On Hold',
                           900, 'Frozen',
                           1000, 'Obsolete/Archived'
                          ) AS "FORMULA_STATUS",
                   DECODE (fd.line_type, '1', msib.segment1) product,
                   DECODE (fd.line_type, '-1', msib.segment1) ingrediant,
                   DECODE (fd.line_type, '2', msib.segment1) AS "BY_PRODUCT",
                   DECODE (by_product_type,
                           'W', 'Waste',
                           'R', 'Rework',
                           'Y', 'Yield',
                           'S', 'Sample',
                           NULL
                          ) AS "BY_PRODUCT_TYPE"
              FROM org_organization_definitions ood,
                   fm_form_mst fm,
                   fm_matl_dtl fd,
                   mtl_system_items_b msib
             WHERE ood.organization_id = fm.owner_organization_id
               AND fm.owner_organization_id = msib.organization_id
               AND msib.organization_id = fd.organization_id
               AND fd.organization_id = ood.organization_id
               AND fm.formula_id = fd.formula_id
               AND msib.inventory_item_id = fd.inventory_item_id
               -- and fm.FORMULA_NO like'%TEA%'
               AND fd.line_type IN ('1', '2', '-1')
          GROUP BY ood.organization_code,
                   fm.formula_no,
                   fm.formula_vers,
                   fm.formula_desc1,
                   fm.formula_status,
                   fd.line_type,
                   msib.segment1,
                   by_product_type
          ORDER BY fm.formula_no, fm.formula_vers;
    BEGIN
       DBMS_OUTPUT.put_line (   INITCAP ('ORGANIZATION CODE')
                             || ','
                             || INITCAP ('FORMULA NAME')
                             || ','
                             || INITCAP ('FORMULA VERSION')
                             || ','
                             || INITCAP ('FORMULA DESC')
                             || ','
                             || INITCAP ('FORMULA STATUS')
                             || ','
                             || INITCAP ('PRODUCT')
                             || ','
                             || INITCAP ('INGREDIANT')
                             || ','
                             || INITCAP ('BY PRODUCT')
                             || ','
                             || INITCAP ('BY PRODUCT TYPE')
       FOR ch IN cr_header
       LOOP
          DBMS_OUTPUT.put_line (   ch.organization_code
                                || ','
                                || ch.formula_name
                                || ','
                                || ch.formula_version
                                || ','
                                || '"'
                                || ch.formula_desc
                                || '"'
                                || ','
                                || ch.formula_status
                                || ','
                                || ch.product
                                || ','
                                || ch.ingrediant
                                || ','
                                || ch.by_product
                                || ','
                                || ch.by_product_type
       END LOOP;
    EXCEPTION
       WHEN OTHERS
       THEN
          DBMS_OUTPUT.put_line ('Error No: ' || SQLCODE || 'Error Msg: '
                                || SQLERRM
    END;
    EXEC HeadCSV_Prc2
    Thanks,
    Raghu

    RaghuVarma wrote:
    I created one report using sql code.(Ex: select * from emp).
    But my higher authorities want that for security purpose They will change the code into java.
    What "higher authorities"? What "security purpose"?
    In this process they changed my code as a procedure.Finally they give that java code.they tell to me please fix in apex.
    Do these "higher authorities" know anything about APEX? What does the Java code actually do? Have you asked them how their approach is to be integrated into APEX?
    There is no reason why a properly written Java stored program cannot be used in APEX, provided that whatever it is doing makes sense in an APEX/web context, and isn't some nonsense like using DBMS_OUTPUT to generate a CSV.
    I tried so many ways.But it is not fixed.Different Different errors will occurs.
    Tried what? Demonstrate what you have tried, preferably using examples on apex.oracle.com.
    How to solve this.
    How to solve what? No clearly defined problem or requirement has been identified.
    Describe the the problem/requirement (not your attempted solutions) in detail.
    How to ask questions
    Re: 2. How do I ask a question on the forums?
    Include as much relevant information with your question as possible, starting with:
    APEX version
    DB version, edition and host OS
    Web server architecture (EPG, OHS or APEX listener), platform, and host OS
    Browser(s)/version(s) used
    Theme
    Templates
    Region type(s)

  • Sorting JTable using keyboard

    Hi all,
    Is it possible to sort JTable using keyboard? There is a key to get the focus to a column header by clicking the key F8. I don't find any key to sort the table based on the column which is in focus. Is there any solution for this?
    Thanks,
    Ganesh

    You miss the point of that link, there is no need to write any custom code.
    I have already tried to implement Keyboard listener of JTableHeader which must be similar to using Key Bindings.You should NOT use a KeyListener, Swing was designed to use KeyBindings
    The problem I am facing is that I am unable to find the column which got the key strokeYou don't have to write any code, the functionality you want is already supported with a Key Binding. Just use the "space" key.
    If you don't like the space key, then you can assign the Action to any other KeyStroke. The link shows you how to do that in 3-4 lines of code.

  • Developing reports using JDeveloper 3.0

    Is it possible to develop reports using jdeveloper 3.0, so that the end users can print reports over the internet? Is that a feature in jdeveloper or do I have to buy a third party tool?
    Thanks,

    Creating HTML/XML-XSL based reports in JDeveloper is completely doable.
    To do this you can either create a Servlet or a JSP. This JSP/Servlet can use either either JDBC or BC4J to access a datasource in the database.
    For further info on how to do this see the
    Java Server Pages overview at: http://tooldemo.oracle.com/demos/tools/jdeveloper/
    Hope this helps,
    -Chris

  • Generate Reports using Siebel eService

    Hello all,
    Is there a way so we can generate reports from Siebel eService? If so how can we do that because We've got the BI Publisher already and we just need to figure out if it's possible to create reports using Siebel eService.
    Regards,

    Can you be a little bit more specific on what you're trying to do? Why can't you have users use BI Publisher UI for reports, or any other Siebel Application besides eService?

  • Export and save a Crystal Report in PDF using parameters

    Hi @all!
    Is it possible to suppress the output of an Crystal Report in a window using parameters? Instead of that I want to save the pdf in a specified folder without using the publication-function.
    Fot the parameter I use these link:
    [http://devlibrary.businessobjects.com/businessobjectsxir2/en/en/boe_sdk/boesdk_dotnet_doc/doc/boesdk_net_doc/html/Report_Linking13.html]
    Best regards,
    Dirk

    Hi,
    this is the forum for the SAP Integration Kit. I would suggest you post your question into the Crystal Reports forum.
    the answer - yes you can use OpenDocument to show the report right away as PDF.
    Ingo

  • Possible to use parameters in MDX Studio?

    Is it possible to use parameters in MDX Studio? I've tried using SSRS2008 for query design but...
    SSRS2008 query designer complains that parameters do not exist when they quite obviously do ( in the report)
    LaCie drives. Failing when you need them most."La" meaning "Terrible", "Cie" meaning "customer service"

    You can declare parameters in XMLA format after the MDX query - see examples in this post:
    Bug v2.9.1: Parametric queries parsing and debugging errors
    WITH MEMBER [Measures].[Profit] AS '[Measures].[Sales Amount]-[Measures].[Standard Product Cost]' SELECT NON EMPTY { [Measures].[Internet Sales Amount], [Measures].[Internet Total Product Cost], [Measures].[Internet Order Quantity] } ON COLUMNS, NON
    EMPTY { ([Sales Reason].[Sales Reason].[Sales Reason].ALLMEMBERS * [Sales Territory].[Sales Territory Group].[Sales Territory Group].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME, [Sales Reason].[Sales Reason].[Sales Reason].KEY, [Sales
    Territory].[Sales Territory Group].[Sales Territory Group].KEY ON ROWS FROM ( SELECT ( STRTOSET(@ProductCategory, CONSTRAINED) ) ON COLUMNS FROM [Adventure Works]) WHERE ( IIF( STRTOSET(@ProductCategory, CONSTRAINED).Count = 1, STRTOSET(@ProductCategory, CONSTRAINED),
    [Product].[Category].currentmember ) ) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
    <Parameters xmlns:xsi="www.w3.org/2001/XMLSchema-instance" xmlns:xsd="www.w3.org/2001/XMLSchema"
    xmlns="urn:schemas-microsoft-com:xml-analysis">
    <Parameter>
    <Name>ProductCategory</Name>
    <Value xsi:type="xsd:string">{ [Product].[Category].&amp;[1],[Product].[Category].&amp;[2] }</Value>
    </Parameter>
    </Parameters>
    <PropertyList xmlns="urn:schemas-microsoft-com:xml-analysis">
    <Catalog>Adventure Works DW</Catalog>
    <LocaleIdentifier>1033</LocaleIdentifier>
    <Format>Tabular</Format>
    <Content>SchemaData</Content>
    <Timeout>0</Timeout>
    <ReturnCellProperties>true</ReturnCellProperties>
    <DbpropMsmdFlattened2>true</DbpropMsmdFlattened2>
    </PropertyList>
    - Deepak

  • Position of parameters of a report using a Logical Database

    Hallo all,
    Is there any way that I can make the parameters defined by me in a report to appear <b>before</b> the ones defined by the Logical Database it is using ?
    I searched but I couldn't find something relevant.
    I would like to avoid having to copy and modify the LDB program.
    Thanks

    Here are a couple of things you can do:
    1.  Right-click on the subreport and select "Format Subreport...".  Turn off the borders on the subreport.
    2.  Right-click on the subreport and select "Size and Position".  Set the X and Y coordinates both to 0.  This will place the subreport at the top-left of the section where it's located.
    3.  In the subreport, suppress ALL of the sections that you're not using.
    4.  Make the height of the subreport fairly small - it will expand to the size of the data it contains.
    5.  Put the column labels in the Page Header of the main report, using markers on the ruler to identify the placement of the left side of each column header.  Be sure to line the markers up to a specific "tick mark" on the ruler.
    6.  In the subreport, place markers at the same tick-marks on the rule as you used for the column labels on the main report.  Then align the fields in the subreport with the markers.
    This should get you close to the format you're looking for.  If it's not exact, you can look at the report in Preview and tweak the position of the column labels to match the data in the subreport.
    -Dell

  • How to create report using pass-in parameters

    hi all,
    I want to create a report using the parameters passed from the previous page. take an example:
    Now in the page B, it got 2 parameters P1_Table,P1_column passed from Page A, i want to get the report about :
    select * from P1_Table where P1_column like 'test%';
    that means i want to get the date in the table P1_Table and its P1_column starts with the character 'test'.
    i tried to use the dynamic sql in region source but failed.
    plz help me
    thanks in advance.
    PPMonkey
    Edited by: PPMonkey on Jan 4, 2009 12:53 AM

    Hi Andy,
    I have a test with your approach, bu it still failed.
    -- here is the statement in the Region Source:
    DECLARE
    L_SQL VARCHAR2(1000);
    BEGIN
    L_SQL := ' SELECT * FROM ' || V('P16_Z') || '''';
    RETURN L_SQL;
    END;
    -- here is the error message:
    failed to parse SQL query:
    ORA-06550: line 1, column 8:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin function package pragma procedure subtype type use
    form
    current cursor
    The symbol "" was ignored.
    ORA-06550: line 2, column 22:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin function package pragma procedure subtype type use
    form
    current
    do you have any idea?
    PPMonkey

Maybe you are looking for