Optional parameter

hi
if anybody knows how to use optional parameter in oracle stored procedure,
pls help me
regards
joshy

Take a look to Default Values for Subprogram Parameters
Nicolas.

Similar Messages

  • CR 2008 - Optional parameter prompts

    Hi!
    I sometimes use Optional parameter prompts in Crystal Reports 2008.
    The main reason is to minimise user input in Selection Criteria Screen.
    I have many subreports, and not all prompts are needed for all subreports.
    If the user leaves the prompt blank, then a formula will set a default value for the user.
    I usually put the optional prompt at the top, so that user needs only fill prompts at the bottom.
    Here is an example:
    I have a parameter field called "PreferredSortOrder"
    The Edit screen reads as follows:
    Type: String
    List of Values: Static
    Value:
        Original Order
        Description
    Value Options:
    Show on (Viewer) Panel           : Read Only
    Prompt Text                              : Preferred Sort Order [Optional]
    Prompt With Description Only  : True
    Optional Prompt                        : True
    Default Value                             :
    Allow custom values                 : False
    Allow multiple values                 : False
    Allow discrete values                 : True
    Allow range values                     : False
    Min Length                                  :
    Max Length                                  :
    Edit Mask                                   :
    Show value or Description        : Show Value
    My report works perfectly, even if I leave the parameter field blank
    I now add another parameter field called "WhichWarehouse"
    with exactly the same values as above.
    When I run the Crystal Report, I get this message;
    Error running Crystal Reports
    The report runs only if I type a value in the "WhichWarehouse" prompt
    (The "PreferredSortOrder" prompt remains blank)
    I did exactly the same as before. Why does the 2nd optional parameter not work like the first?
    What has gone wrong?
    Thank you
    Leon Lai
    JUST ADDED
    I just noticed that in the Field Explorer,
    (a) There is a green TICK near the parameter PreferredSortOrder
    (b) But no green Tick neat the parameter "WhichWarehouse"
    What does the green tick mean?
    Could this be the key to the mystery?

    Hi Leon,
    No green tick means that the prompt has Not been used in the report.
    If the report has Subreports, and if the subreport also has a 'warehouse' prompt then it could be this prompt that is causing the issue. You should link both the warehouse prompts to make sure you're only prompted once.
    -Abhilash

  • Missing Parameter Values CR2008 Optional Parameter

    Hi,
    I am getting "Missing Parameter Values" error
    "CrystalDecisions.CrystalReports.Engine.ParameterFieldCurrentValueException: Fehlende Parameterwerte. ---> System.Runtime.InteropServices.COMException (0x8004100E)"
    if I try to export a Report with an optional Parameter without setting the parametervalue.
    The Report works fine with ReportViewer.
    If I uncomment the "Parameterpart" and set a parametervalue it works fine, but it should works without a parametervalue too, its optional.
    I have tried many for a long time and read many Websites but it does not work !
    I use WinXP SP2 CR2008 with C# .NET 2.0 VS2005
    CrystalDecisions.CrystalReports.Engine.dll version 12.0.2000.683 Date: 2008-03-01
    CrystalDecisions.Shared.dll version 12.0.2000.683 Date: 2008-03-01
    Sorry my English is very Bad !
    Thanks a lot!
    ExportFormatType ExportType = ExportFormatType.PortableDocFormat;
                ReportDocument RD = new ReportDocument();
                RD.Load("C:\\ParaTest01.rpt");
                string strServer = "<ServerName>";
                string strDB = "<DBName>";
                string strUser = "<UserID>";
                string strPW = "<PW>";
                RD.SetDatabaseLogon(strUser, strPW, strServer, strDB);
                //ParameterFieldDefinitions crParameterFieldDefinitions = RD.DataDefinition.ParameterFields;
                //ParameterFieldDefinition crParameter1 = crParameterFieldDefinitions[0];
                //ParameterValues crParameter1Values = crParameter1.CurrentValues;
                //ParameterDiscreteValue crDiscrete1Value = new ParameterDiscreteValue();
                //crDiscrete1Value.Value = "GER";
                //crParameter1Values.Add(crDiscrete1Value);
                //crParameter1.ApplyCurrentValues(crParameter1Values);
                RD.ExportToDisk(ExportType, "C:\\Test2.pdf");
    RecordSelectionFormula in Report:
    (not HasValue({?Land}) OR {tab.location_code} = {?Land}) and
    {tab.sup} = "XXX" and
    {tab.Accounting_Period} = "200801"

    You need to be careful when using optional parameters. If you are using the optional parameter in a record selection formula you'll need to check and make sure it has a value before you use it. There is a function call HasValue() that you can use to do this.
    If you have an optional parameter in the record selection formula and you don't pass a value you'll need to make sure your selection formula can be completed with out it.
    This is an excerpt from our help file.
    Crystal Reports supports optional parameters. An optional parameter is a prompted value that does not have to be supplied by the user.
    Report designers should provide some guidance to the end user that a parameter is optional by adding this information to the prompt text.
    Optional parameters are treated by Crystal Reports as optional anywhere within the report that they are used. You cannot set one instance of the parameter to optional and another to mandatory.
    Note: After you set a parameter to optional, if you use the Select Expert, the system will automatically add the selection formula for you using the HasValue() function.
    The Formula Workshop Editor does not automatically add the formula. Only the Select Expert automatically adds the formula for you.
    If you change the parameter from optional to mandatory, the HasValue() function is not automatically removed from your formula.
    Handling a parameter with no value
    When the report engine evaluates any formula which references an optional parameter that does not have a value, it generates a runtime error. All formulas that reference an optional parameter should first use the HasValue() function to check if that parameter has a value before evaluating it. This includes record selection formulas and saved data formulas.
    Note: The system will not automatically drop a statement from the SQL WHERE clause. It is the report designeru2019s responsibility to decide which statement to leave out based on HasValue() testing.

  • Optional Parameter in ODSI

    Hi,
    I have to create a Optional Parameter in ODSI function as given following :
    xquery version "1.0" encoding "UTF-8";
    (::pragma xds <x:xds targetType="urn:AddressInfo" xmlns:x="urn:annotations.ld.bea.com" xmlns:urn="http://www.wcbsask.com/employeerCoverage/AddressInfo"><creationDate>2010-10-15T15:19:40</creationDate><userDefinedView/></x:xds> ::)
    declare namespace wbt= "ld:Physical/CBC";
    import schema namespace ns1="http://www.abc.com/employeerCoverage/AddressInfo" at "ld:Logical/AddressInfo/schemas/AddressInfo.xsd";
    declare namespace tns="ld:Logical/AddressInfo/SampleOptional";
    (::pragma function <f:function kind="read" visibility="public" isPrimary="true" xmlns:f="urn:annotations.ld.bea.com"/>::)
    declare function tns:getSampleOptional($formNum as xs:string,$optinalInput as xs:integer?) as element(ns1:AddressInfo)?{
    for $cbc in wbt:CBC()
    where $formNum eq $cbc/FORM_NUM
    return
    <ns1:AddressInfo>
    if(exists($optinalInput))then
    <ns1:regNum>{fn:data($CBC/FORM_NUM)}</ns1:regNum>
    else(
    <ns1:cusNumber>{fn:data($optinalInput)}</ns1:cusNumber>
    </ns1:AddressInfo>
    when i am passing the form number as some value and OptionalInput as null(since the parameter is optional). I am getting error as
    com.bea.dsp.das.exception.DASException: weblogic.xml.query.exceptions.XQueryDynamicException: {err}XP0021: "": can not cast to {http://www.w3.org/2001/XMLSchema}integer: error: decimal: Invalid decimal value: expected at least one digit
         at com.bea.dsp.das.ejb.EJBClient.invokeOperation(EJBClient.java:160)
         at com.bea.dsp.das.DataAccessServiceImpl.invokeOperation(DataAccessServiceImpl.java:171)
         at com.bea.dsp.das.DataAccessServiceImpl.invoke(DataAccessServiceImpl.java:122)
         at com.bea.dsp.ide.xquery.views.test.QueryExecutor.invokeFunctionOrProcedure(QueryExecutor.java:113)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.getFunctionExecutionResult(XQueryTestView.java:1041)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.executeFunction(XQueryTestView.java:1176)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.widgetSelectedImpl(XQueryTestView.java:1866)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.access$300(XQueryTestView.java:174)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent$3.run(XQueryTestView.java:1594)
         at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.widgetSelectedBusy(XQueryTestView.java:1597)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.widgetSelected(XQueryTestView.java:1560)
         at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:227)
         at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
         at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
         at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3687)
         at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3298)
         at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
         at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
         at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
         at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
         at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
         at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
         at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
         at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
         at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169)
         at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
         at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
         at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
         at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508)
         at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
         at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
         at org.eclipse.equinox.launcher.Main.eclipse_main(Main.java:1148)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.m7.installer.util.NitroxMain$1.run(NitroxMain.java:33)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
    Kindly help in the issue.
    Regards,
    Tara

    "when i am passing ... and OptionalInput as null"
    What does that mean exactly? From the exception, it looks like you are just leaving the text box blank. For 'null' you have to check the 'null' check-box beside it.

  • How to set no_value to Optional parameter in XI 3.0 by OpenDoc URL linking

    I found in "BusinessObjects XI 3.0 Viewing reports and documents using URLs Howto.doc"
    "You can remove an optional parameter from the prompt by setting it to no_value in the OpenDocument query string."
    I tested: response.sendRedirect("/OpenDocument/opendoc/openDocument.jsp?sIDType=CUID&iDocID=AaVxpKuKNBxKnHUJCqwuRi0&lsSCountry=""no_value""&token=" + logonToken);
    But it will filter no data, because no country call "no_value". I still need to delete the value, and click Apply, to get all data.
    I wonder how to achieve optional parameter via opendocument linking, to get a report with "full data set".
    Any one can help?
    Thanks in advance!
    Jennie

    Hi Jennie,
    I'm wondering if "1203675 - Cannot specify an empty string for an optional string parameter through the refresh prompts page which displays "no value" unlike the parameter panel" is related to this.
    Instead of using no value or empty string, how about if you use ALL value for the parameter to bring full data? Check "1218621 - Option "All" in list of values for a dynamic prompt in XI"
    Hitomi

  • Optional Parameter - Oracle Package Throws an Error

    Hi there,
    I have an Oracle Package & it has a stored procedure with optional parameter. The calling code is in ColdFusion.
    When I run my webpage the Oracle throws below error.
    " [Macromedia][Oracle JDBC Driver][Oracle]ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'GET_CONTRACT_BY_DYN_SQL' ORA-06550: line 1, column 7: PL/SQL: Statement ignored "
    Calling Code (ColdFusion)
    <cfstoredproc procedure="CONTRACTS_PKG.GET_CONTRACT_BY_DYN_SQL" datasource="#REQUEST.dsn#">
         <cfprocparam cfsqltype="CF_SQL_INTEGER" type="in" value="1" variable="P_CONTRACTID">     
         <cfprocresult name="qDataDynSQL" resultset="1">
    </cfstoredproc>
    <br>Dynamic SQL Query:
    <cfdump var="#qDataDynSQL#" label="Dynamic SQL Query">
    Oracle Package
    create or replace
    PACKAGE CONTRACTS_PKG AS
    TYPE T_CURSOR IS REF CURSOR;
    PROCEDURE GET_CONTRACT_BY_DYN_SQL(P_CONTRACTID IN NUMBER, P_COLS IN VARCHAR2 DEFAULT '*', IO_CURSOR IN OUT T_CURSOR);
    END CONTRACTS_PKG;
    create or replace
    PACKAGE BODY CONTRACTS_PKG AS
    -- Get Contract Using Dynamic SQL
    PROCEDURE GET_CONTRACT_BY_DYN_SQL(P_CONTRACTID IN NUMBER, P_COLS IN VARCHAR2 DEFAULT '*', IO_CURSOR IN OUT T_CURSOR)
    IS
    V_CURSOR T_CURSOR;
    V_SQL VARCHAR2(200);
    BEGIN
    IF p_contractid > 0 THEN
    V_SQL := 'SELECT '|| P_COLS || ' FROM CONTRACTS WHERE contract_id = ' || P_CONTRACTID ;
    ELSE
    V_SQL := 'SELECT '|| P_COLS || ' FROM CONTRACTS';
    END IF;
    OPEN V_CURSOR FOR V_SQL;
    IO_CURSOR := V_CURSOR;
    END GET_CONTRACT_BY_DYN_SQL;
    END CONTRACTS_PKG;
    Does anyone knows why it throws an error? As you can see in the package header & body the parameter P_COLS has the default value as '*'.
    Looking forward to hear from someone.
    Thanks,
    Hitesh Patel

    931198 wrote:
    I have an Oracle Package & it has a stored procedure with optional parameter. The calling code is in ColdFusion.
    When I run my webpage the Oracle throws below error.Never mind the error - your approach is most definitely a candidate for Oracle WTF.
    Nothing sane about this approach. Especially the decision not to use bind variables and slowing down cursor processing significantly by burning a lot more CPU cycles on hard parsing and fragmenting the SQL Shared Pool in the process.
    Why not used MS Access instead? It is far more suited as a mickey mouse database for a goofy application?
    Why am I badmouthing your approach to Oracle? Because that is exactly the primary cause, the #1 reason, for poor Oracle performance and run-time problems dealing with Shared Pool fragmentation. It is something that many Oracle experts blog about, talk about, write about. It is addressed in numerous books, Oracle documentation, and even Oracle Support Notes.
    And despite the amount of information available on how to get the basics rights in using Oracle... this approach you are pursuing still refuses to die. So it deserves to be beaten with a lead pipe when it rears its ugly head here in this forum..

  • How to use offset for select-option parameter ?

    Hi experts
    could anybody please let me know how to use offset for select-option parameter. i can able to use offset for table fields, variabiles and all , but don't know how to use for parameters.
    following is my code
    SELECT-OPTIONS: s_prctr  FOR vbsegs-prctr OBLIGATORY.
    here "prctr"  length is 10.
    i'm using two tables  1. vbsegd-bupla
                                    2. vbsegs-prctr
    here prctr+6(4) = bupla.
    "Bupla" length is 4
    SELECT belnr gjahr bukrs bupla sgtxt buzei FROM vbsegd INTO CORRESPONDING FIELDS OF TABLE it_vbsegd FOR ALL ENTRIES IN it_vbkpf
                                                                 WHERE belnr = it_vbkpf-belnr
                                                                   AND gjahr = it_vbkpf-gjahr
                                                                   AND bukrs = it_vbkpf-bukrs
                                                                   AND bupla IN s_prctr.  
    the above statement is not working as prctr and bupla lenths are different. here i want to use offset.
    SELECT belnr gjahr bukrs prctr sgtxt buzei FROM vbsegs INTO CORRESPONDING FIELDS OF TABLE it_vbsegs FOR ALL ENTRIES IN it_vbkpf
                                                                WHERE belnr = it_vbkpf-belnr
                                                                  AND gjahr = it_vbkpf-gjahr
                                                                  AND bukrs = it_vbkpf-bukrs
                                                                  AND prctr IN s_prctr.
    this is working as prctr and s_prctr lengths are equal.
    could anybody please help me out in this.
    Thanks in advance.
    regards
    satish

    Below code will work for you.
    SELECT-OPTIONS: s_prctr  FOR vbsegs-prctr OBLIGATORY.
    RANGES: s_bupla FOR vbsegd-bupla.
    s_bupla[] = s_prctr[].
    DELETE ADJACENT DUPLICATES FROM s_bupla.
    SELECT belnr gjahr bukrs bupla sgtxt buzei FROM vbsegd INTO CORRESPONDING FIELDS OF TABLE it_vbsegd FOR ALL ENTRIES IN it_vbkpf
                                                                  WHERE belnr = it_vbkpf-belnr
                                                                    AND gjahr = it_vbkpf-gjahr
                                                                    AND bukrs = it_vbkpf-bukrs
                                                                    AND bupla IN s_bupla.

  • Passing select option parameter to a procedure

    Hello, i need to know pass a select option parameter to a procedure. I tried the following
    For eg if i have a select option called so_belnr & i call the procedure using the following
    PERFORM VALIDATE_DOCUMENT TABLES SO_BELNR USING GJAHR BUKRS  , i still cannot use the
    select option paramter in the called procedure.
    Pls help.

    Hi,
    in topinclude...
    data: lr_belnr type RNG_BELNR.
    at start-of-sel.....
    move so to range..
    refresh: lr_belnr.
    lr_belnr[] = so_belnr[].
    PERFORM VALIDATE_DOCUMENT TABLES lr_belnr USING GJAHR BUKRS .
    in form:
    ...   tables lr_belnr like structure of RNG_BELNR.
    reason(my definietion): perfom doesn´t know if the select-options is availible.....
    bestreg
    Robert

  • Passing optional parameter to subreport

    Hi,
    I am having a CR 2008 report based on BW query.  The query has optional parameter (the value can be set to NULL).  When I try to use this report as subreport in my main report, I am unable to pass Null(equivalent to set to NULL) to my subreport using subreport link.  I tried blank and "" in a formula field and try to link it to the subreport parameter but it doesn't work.  Kindly guide me in this regard.
    Thanks and Regards,
    Subbu S

    Hi Subbu,
    Try to create a formula and pass the formula value to your sub report parameter and in sub report record selection based on main report formula value try to filter the records.
    Ex: Main report create the following formula :
    Whileprintingrecords;
    Shared Stringvar x;
    If not hasvalue({?Optional}) then
    x:='No Value'
    else
    x:={?Optional}
    Now link this to your sub report parameter
    In sub report record selection
    If {?parameter} = 'No Value ' then true else {?Parameter} =  FieldValue.
    Thanks,
    Sastry

  • Optional Parameter without a value

    Hi, I'm using Discoverer 10g.
    Somebody knows what is passed when an optional parameter (a parameter which doesn't require a user to enter a value) is left without a value ?
    I didn't understand actually if is passed NULL, 'NULL', '',' '...
    I need to know it because I need to wrap this "value" in order to pass it to a function on the DB.
    The user have to be the possibility to write something or leave it without a value.
    Thanks
    Alessandro

    Hi,
    While running the Discoverer Report, just leave the parameter as blank.
    Discoverer passes it as NULL to execute the query.
    In the function, where you are passing this parameter, use NVL() to defualt the NULL value. If you want to pass "this value" manually into function, you can still leave it as blank and NVL will take care of it.
    Hope this helps!
    Yogini

  • Optional parameter workaround  -  dates problem

    Hi
    I use  optional parameter workaround  and it's fine.
    but how I should use it with dates parameter or numbers ?
    SAP note 1500777. This describes a workaround :
    ((not HasValue({?itemcode@select itemcode from OITM })
    or isNULL({?itemcode@select itemcode from OITM })
    or {?itemcode@select itemcode from OITM } = '')
    OR {OITM.ItemCode} = {?itemcode@select itemcode from OITM })
    Regards
    Idan

    Hi,
    Optional parameter is not supported.
    What I did was, I have 2 date parameter. pmDateFrom and pmDateTo.
    In Crystal report record selection, OINV.DocDate in pmDateFrom to pmDateTo.
    When running within SAP B1 8.8, if I want to include every dates, I put in a date in pmDateFrom (eg: 1/1/00) and do not enter anthing for pmDateTo.
    That seems to work.

  • OPTIONAL PARAMETER WITH NO VALUE SELECTED

    I have an optional parameter and I want to place the selected value in the Page Header.  Since the selected value is a number, I want to give it a name.  The problem I am having is when I don't select a value, my naming forumula doesn't work.  I tried the HasValue function, but I don't think I'm using it properly.
    // This did not work
    IF {?SUPPLIER}= 10001 THEN "NESTLE PRODUCTS ONLY" ELSE
    IF {?SUPPLIER}= 10005 THEN "UNILEVER PRODUCTS ONLY" ELSE
    "ALL PRODUCTS"
    // This did not work
    If (not hasvalue){?SUPPLIER} then "ALL PRODUCTS" ELSE
    IF {?SUPPLIER}= 10001 THEN "NESTLE PRODUCTS ONLY" ELSE
    IF {?SUPPLIER}= 10005 THEN "UNILEVER PRODUCTS ONLY" ELSE
    "NESTLE AND UNILEVER PRODUCTS ONLY"
    Got any suggestions?

    Hi,
    Well if you select multiple values in a parameter and drag the parameter or the formula containing the parameter, then it would always display the first selected value.
    Here's a dirty way:
    If NOT(HasValue({?SUPPLIER})) then "ALL PRODUCTS" ELSE IF
    ubound({?SUPPLIER}) = 1 then
            IF {?SUPPLIER}= 10001 THEN "NESTLE PRODUCTS ONLY" ELSE
            IF {?SUPPLIER}= 10005 THEN "UNILEVER PRODUCTS ONLY" ELSE
            "NESTLE AND UNILEVER PRODUCTS ONLY"
    ELSE IF
    ubound({?SUPPLIER}) = 2 then
    "NESTLE AND UNILEVER PRODUCTS ONLY"
    Let me know how this goes!
    -Abhilash

  • Optional parameter, no values

    Hi,
    I have an optional parameter in CR2008; I would like to print the choosen parameter values into the report header. This works great by using this function:
    Join({?MyParameter},", ")
    However, when no values were selected I get the error message "Parameter has no value".
    So I adapted the function:
    if hasvalue({?MyParameter}) then Join({?MyParameter},", ") else "All records"
    The function is correct but I still get the error message (error dialog window).
    How can I suppress the error message?
    Thanks!

    Ian,
    Tip of the day: You can show the &lt;&gt; signs in the forum by using & lt; and & gt;. Just remove the spaces after the &.
    It also works in code blocks...
    {@Field} &lt;&gt; 123
    Jason

  • Optional parameter in QLD

    I am designing qld with the following query-
    SELECT T0.Father, T0.Code, T3.Dscription, T1.CardCode, T1.CardName, T1.DocNum, T3.DocEntry,
    T1.DocDueDate, T3.DocDate,  T0.Quantity AS 'BOM Qty',T2.Quantity AS 'PO Qty', T3.Quantity AS
    'Receipt Qty',t0.Quantity-t3.Quantity as Balance FROM ITT1 T0 , OPOR T1 INNER JOIN POR1 T2
    ON T1.DocEntry = T2.DocEntry, PDN1 T3 WHERE t2.ItemCode=t0.code and  t2.DocEntry
    =t3.BaseEntry AND t2.LineNum = t3.BaseLine
    and t3.InvntSttus = 'O' and  T0.Father like '%[%0]'  and  T1.DocNum = '[% 1]'  and 
    T1.CardName like '%[%2]' and T1.DocDueDate between convert(datetime,'[%3]',112) and
    convert(datetime,'[%4]',112)
    order by t1.DocNum, t3.DocEntry
    I want to make DocNum as optional parameter.But since its data type is numeric I can not use
    T1.DocNum='%[%1]'
    In this case how can I make this numeric field optional.
    Note-The square bracket is replaced by underscore in the above query.For eg,
    '%[%1]'='% Opening square bracket % 1 Closing square bracket '

    Dilip,
    Are you saying that the user entering the DocNum is optional and if they leave the field blank they should still get the result. based on the other selection parameters
    Since you are using DocNum = it will not be possible to have it optional but if you specify it as a range.  example DocNum Between '[%0\]' AND '[%2\]' then we have a chance.
    This is what I have for you to try
    SELECT T0.FATHER, T0.CODE, T3.DSCRIPTION, T1.CARDCODE, T1.CARDNAME, T1.DOCNUM, T3.DOCENTRY, T1.DOCDUEDATE, T3.DOCDATE,
    T0.QUANTITY AS 'BOM QTY',T2.QUANTITY AS 'PO QTY', T3.QUANTITY AS 'RECEIPT QTY', T0.QUANTITY-T3.QUANTITY AS BALANCE
    FROM OPOR T1 INNER JOIN POR1 T2 ON T1.DOCENTRY = T2.DOCENTRY INNER JOIN ITT1 T0 ON T0.CODE = T2.ITEMCODE INNER JOIN
    PDN1 T3 ON T3.BASEENTRY = T2.DOCENTRY AND T3.BASELINE = T2.LINENUM
    WHERE T3.INVNTSTTUS = 'O' AND T0.FATHER LIKE '%[%0\]' AND T1.DOCNUM BETWEEN (CASE WHEN '[%1\]' = '' THEN 0 END) AND  (CASE WHEN '[%2\]' = '' THEN 100 END)
    AND T1.CARDNAME LIKE '%[%3\]' AND T1.DOCDUEDATE BETWEEN CONVERT(DATETIME,'[%4\]',112) AND CONVERT(DATETIME,'[%5\]',112)
    ORDER BY T1.DOCNUM, T3.DOCENTRY
    Note: Change the 0 and 100 with the DocNum range of your purchase order documents
    <FONT Color="RED" Size = 3> Quick tip to avoid the $ and % and [\] getting changed by the interface is to use a " \  " (Backslash) 
    </FONT>
    Example:
    FOR $\[$38.1.0]  use $<FONT Color="RED" Size = 2>backslash</FONT>\[$38.1.0]
    FOR '[%0\]'  use '[%0<FONT Color="RED" Size = 2>backslash</FONT>\]'
    Suda

  • Optional Parameter in Java.

    Hi all,
    I am new to java programming... I just wanted to know if we can have Optional parameter in java?. I searched few threads but not found any good result. Few suggested a overloaded method ,i think if it is not provided then there must be a big reason for that. Please let me know if anybody knows exact reason why it is not provied. I am using ver 1.4
    ~Amod .

    class A{
         String a;
         String b;
         String c;
         public A(String a, String b, String c){
              this.a=a;
              this.b=b;
              this.c=c;
         public A(String a, String b){
              this.a=a;
              this.b=b;
              //String c will get a default value when this constructors get called
         public static void main(String args[]){
              A test = new A("a","b","c");
              System.out.println(test.a);
              System.out.println(test.b);
              System.out.println(test.c);
              System.out.println("-------");
              A test_ = new A("a","b");
              System.out.println(test_.a);
              System.out.println(test_.b);
              System.out.println(test_.c);
    }Is that what you want?

Maybe you are looking for

  • Problem with Jtree and a checkbox

    Hello, I have a problem with my tree implementation. I create a tree and i want to add a checkbox in each node. this is my code : DefaultMutableTreeNode root; root = new DefaultMutableTreeNode(new JCheckBox()); DefaultTreeModel model = new DefaultTre

  • Is it possible to add Premiere App, for business use, on a month-month basis

    My Company already has a 1-year plan for 2 Adobe Apps. We are currently planning a 3 month internship (jan-mar 2015). The intern would like to use Premiere, but since we don't use it currently, we need to consider adding it to our CC. Is it possible

  • FOC material scrap

    hi all please suggest i am getting free of cost material form customer an doses value addition and then supply to cutsomer while pricing customer credit the scrap generated during vlaue addition/converson. since i have created these material as Non v

  • I want to Search for a file within a directory

    how can i access a directory and search for a folder name in that directory

  • Starting obiee weblogic services in linux after simple installation

    Hi all, I have installed OBIEE 11g on linux machine with "simple installation" option, i have following questions: with simple installation, will weblogic server will get installed? because i am not able to open the weblogic EM page, now do i have to