Parameter passing  into column

Hi ,
We have one prompt as TimeHorizion. How can we pass this value in column formula.
I mean based on user selection I should pass TimeHorizion value in to column formula
I wrote following query in column formula but it is not working properly
CASE WHEN Time Horizon Duration = @{TimeHorizion}THEN "Pipeline Product Agg"."Estimated Revenue" ELSE 0 END.
If user select 30 days then we should get revenue for 30days period only
FYI: TimeHorizion values are 30 days, 60 days, 90 days and 100 days.
Due to ETL issues we can’t use that prompt value in filtters.
Any help would be appreciated.

Are you getting an error or is it simply not evaluating correctly ?
Just been playing around on my local machine, i got the following to match a Pres. Variable :
CASE WHEN <measure> = @{PV} THEN 'blah' END
but flip it over the other way (as you have) and I dont get a match :
CASE WHEN @{PV} = <measure> then 'blah' END
Try flipping the values around the operator?
Also check your datatypes match (column the prompt is based on) vs column your evalulating against

Similar Messages

  • Parameter passing into servlet

    Hi,
    I am trying to get the html page to pass some parameters into a servlet. Everytime I try running it, I get "Page could not be found error"
    I use the following path:
    Http://localhost:8080/example/servlets
    I could run the HelloWorld example with no problems.
    I'm trying to run the LoanAmorization.html
    which calls LoanCalculator servlet.
    I just modified the examples that came with jsdk2.1 to get the servlets working.
    HTML code:
    <HTML>
    <HEAD>
    <TITLE>Loan Calculator</TITLE>
    </HEAD>
    <BODY>
    <CENTER>
    <H1>Please enter the following information:</H1>
    <HR>
    <FORM ACTION="http://10.1.11.84:8080/examples/servlet/LoanCalculator" METHOD="GET">
    <TABLE CELLSPACING="2" cellpadding="2" border="0">
    <TR>
    <TD ALIGN="right">Principal: $</TD>
    <TD ALIGN="left"><INPUT TYPE="text" NAME="principal" SIZE="10"></INPUT></TD>
    </TR>
    <TR>
    <TD ALIGN="right">Interest (0.nn): </TD>
    <TD ALIGN="left"><INPUT TYPE="text" NAME="interest" SIZE="10"></INPUT></TD>
    </TR>
    <TR>
    <TD ALIGN="right">Monthly Payment: $</TD>
    <TD ALIGN="left"><INPUT TYPE="text" NAME="payment" SIZE="10"></INPUT></TD>
    </TR>
    <TR>
    <TD COLSPAN="2" ALIGN="center"><INPUT TYPE="submit" NAME="cmdSubmit"
    VALUE="Calculate!"></td>
    </TR>
    </TABLE>
    </FORM>
    </CENTER>
    </BODY>
    </HTML>
    Servlet Code:
    //Import Servlet Libraries
    import javax.servlet.*;
    import javax.servlet.http.*;
    //Import Java Libraries
    import java.io.*;
    //Import html and loan helper classes
    import com.wrox.util.*;
    public class LoanCalculator extends HttpServlet
    public void doGet(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    // retrieve parameter values as strings
    String principalAsString = req.getParameter("principal");
    String interestAsString = req.getParameter("interest");
    String paymentAsString = req.getParameter("payment");
    // initialize variables to hold floating point values
    float principal, interest, payment;
    // initialize a variable to hold the loan repayment period
    int months;
    try
    // use the LoanTools class to obtain floating point values
    // stringToFloat throws a NumberFormatException, so we'll have to catch it
    principal = LoanTools.stringToFloat(principalAsString);
    interest = LoanTools.stringToFloat(interestAsString);
    payment = LoanTools.stringToFloat(paymentAsString);
    // use the LoanTools class to calculate the loan period
    // the method throws an IllegalArgumentException, so we'll have to catch it
    months = LoanTools.calculateLoanPeriod(principal, interest, payment);
    // If a NumberFormatException was thrown, we want to
    // replace the error message with something more friendly
    catch (NumberFormatException e)
    handleError(new NumberFormatException("Check that the values entered are numeric"), res);
    return;
    // If any other kind of exception was thrown, we catch it here
    catch (Exception e)
    handleError(e, res);
    return;
    // If no exceptions were thrown, the code continues here
    // so we can send an acknowledgment to the browser
    res.setContentType("text/html");
    PrintWriter out = res.getWriter();
    HTML h = new HTML("Loan Calculator: Results");
    h.add(HTML.HEADING, "Loan Calculator Results", false);
    h.add(HTML.LINE, "", false);
    h.add(HTML.NORMAL, "Principal Amount: $", false);
    h.add(HTML.NORMAL, Float.toString(principal), true);
    h.add(HTML.NORMAL, "Interest: ", false);
    h.add(HTML.NORMAL, Float.toString(interest), true);
    h.add(HTML.NORMAL, "Payment: $", false);
    h.add(HTML.NORMAL, Float.toString(payment), true);
    h.add(HTML.NORMAL, "Months Until Payoff: ", false);
    h.add(HTML.NORMAL, Integer.toString(months), true);
    out.println(h.getPage());
    out.close();
    // This version of handleError() sends an HTTP Error code to inform
    // the client and server of the error
    private void handleError(Exception e, HttpServletResponse res)
    throws IOException
    res.sendError(400, e.getMessage());
    I really appreciate your help.
    thanks,
    Will

    Hi!
    You have to insert an entry for every Servlet you use in the
    web.xml file of your Servlet-Engine (e.g. tomcat):
    <servlet>
    <servlet-name>
    LoanCalculator
    </servlet-name>
    <servlet-class>
    pkg.LoanCalculator
    </servlet-class>
    <load-on-startup>
    1
         </load-on-startup>
    </servlet>
    Regards,
    Geri

  • Passing a column name as a parameter

    Good afternoon,
    I was wondering if any of you ever encountered the following situation and found a method to get around it...
    I recently created a pivot table using the SQL Query (PL/SQL function body returning SQL query) option.
    The table consisted of the following information:
    - Date range, Object Type and count.
    The final table looks something like this (pardon the lack of fancy markup, hopefully it will get the point across):
    Date        Object A    Object B    Object D    Object G
    01-apr-09   10           16         50          43
    02-apr-09   1            15         77          35
    03-apr-09   19           0          14          17
    04-apr-09   15           7          70          20
    05-apr-09   7            6          65          50And it goes on like that.
    I had to create the code dynamically because I don't know what Objects I will get in any given date range (for example: I could have something for Object C and nothing for Object D in the month of March). I had a cursor loop through the object types before creating the SQL query that builds the table above.
    The table is now working fine. What I'm trying to do now is do a little bit of drilling down in data.
    Since everything is dynamically built, I can't give actual column names in my report. Is there any way that, when I click on, for example, the "10" on April 1st in Object A that the column header "Object A" gets passed? #COL02# only passes the value "10" which isn't what I want, and I tried the other variations such as :COL02 and &COL02. without much luck.
    If you could shed some light on this problem, that would be greatly appreciated!
    Thank you for your time.
    Ivan

    Hi,
    You can achieve passing column name as parameter with the help of jquery.
    Below is the sample code
    <script src="http://www.google.com/jsapi"></script>
    <script type="text/javascript"> 
       google.load("jquery", "1.2.6"); 
    </script>
    <script type="text/javascript">
        //<![CDATA[
        $(document).ready( function() {
            $('.t20data').each( function(i) {
                $td =$(this);
                colHeader = $(this).attr("headers");
                $td.html('<a href="f?p=' + &APP_ID. + ':3' + ':' + &APP_SESSION. + '::NO:3:P3_COLUMN_HEADER,P3_COLUMN_VALUE:' + colHeader +',' +$td.text()+ '">' + $td.html() + '</a>');
        });                                  //]]>
    </script>Note - U need to change t20data , :p3_column_header , :p3_column_value to match you application.
    No need to add link individually by going into column attributes
    [E X A M P L E |http://apex.oracle.com/pls/otn/f?p=62171:2]
    Regards,
    Shijesh

  • Changing the value of a parameter that has been passed into an SSRS 2008 R2 report

    I support 200+ reports that all use stored procedures and have many drill downs with built in URLs.
    I want to do the below to avoid creating a brand new parameter that I will have to add to literally hundreds of places.
    We have what I'll call Param1 that receives a value from the user.  That Param1 is passed to the stored procedure(s) for the report and also embedded in any Action URLs for drill downs to other reports from that report.  All works great.
    Now I have a need to concatenate a string to whatever value they supplied which provides context for the environment in which they are running.  The reason I want to do this instead of creating a new parameter is because I need this in all my reports
    and as stated above I would have to make 100s of changes to make that happen.  If I can figure out a way to concatenate a value to the existing Param1 value I can greatly reduce the number of changes.
    I can't seem to be able to find a way to modify the value on an existing parameter that is passed into the report prior to report execution.
    I get an error when I simply try to concatenate something to the parameter in its Default property.
    I can't find a way to update a parameter value in the Report Code block.  There don't appear to be any methods available on the Parameter Collection to set the value of a parameter.
    Any ideas?
    Thanks!
    Nathan 

    Create a new parameter. Mark it internal, set it's value by expression to:
    =User!UserId+"MyNewValue"
    and pass it to the proc?
    Don't forget to mark helpful posts, and answers. It helps others to find relevant posts to the same question.

  • Passing the column name on Where condition based on input parameter

    Hi,
    I am using Oracle10g. Following are my table schema.
    Table Name : Codes
    Columns( ID, Level0, Level1,Level2)
    View Name : SampleView
    I have a scenario : A parameter will be passed to my view from C# application. I need to cut the last 4 places of the parameter and need to check 4 conditions as follows :
    1. IF last 4 places of parameter contains the value as "AMPD" then pass level0 column on where condition.
    Sample code : A123XPAMPD
    Expeted Result: Select * from Codes where Level0 ='A123XPAMPD'
    2. IF last 4 places of parameter contains the value as "Alpha numeric" then pass level1 column on where condition.
    Sample code : A123XPAA00
    Expeted Result: Select * from Codes where Level1 ='A123XPAA00'
    3. IF last 4 places of parameter contains the value as 0000 then pass level1 column on where condition.
    Sample code : A123XP0000
    Expeted Result: Select * from Codes where Level1 ='A123XP0000'
    4. IF last 4 places of parameter contains the value as (cannot be all 0's) and cannot contain "Alphabets" then pass level2 column on where condition.
    Sample code : A123XP1001
    Expeted Result: Select * from Codes where Level2 ='A123XP1001'
    Could any one please help me on writing this logic inside the view.
    Thanks in advance.

    Do you want to make sure that at least one alphabet and one number is there?
    select case
         when regexp_like('1111','^[a-zA-Z]+$') -"This says - Only alphabets, not even space
              THEN 'Alphabets'
         when regexp_like('1111','^[a-zA-Z0-9]*$') --"This says - Only alpha-numeric, not even space
          and regexp_like('1111','[a-zA-Z]') --"To make sure atleast one alphabet is there
          and regexp_like('1111','[0-9]') --"To make sure atleast one number is there
              THEN 'AlphaNumeric'
           else 'NULL' --"This is a string. Not actual NULL
          end
    from dual;
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • REP-1425 report formula DO_SQL error putting value into column

    Hi all
    I have opened a report 2.5 in Oracle9i Reports Developer and, it converted ok. However, when I run the report (paper layout), the message
    rep-1425 report formula DO_SQL error putting value
    into column. Column may not be referenced by parameter
    triggers
    appears. There are several report level formula columns and corresponding placeholder columns that are the cause of this error. The formula has the following :
    SRW.DO_SQL('SELECT RPAD(''DAILY TABLE AUDIT REPORT'',60,''.'')||TO_CHAR(SYSDATE,''DD-MON-YYYY'') INTO :REPORT_TIT FROM DUAL');
    COMMIT;
    RETURN('');
    I can't work out what this error message really means as the column, report_tit is a placeholder column and, the formula column is not a parameter trigger!! The report_tit placeholder is used as a source for a layout field. I noticed that the layout field is defined as a placeholder column in the converted report but in the reports 2.5 version, it is defined as a layout field.
    I can do a work around by replacing the SRW.DO_SQL statement with a normal PL/SQL SELECT statement. However, I wonder if anyone else has had the same problem and, if anyone can help provide an answer as to what this error really means and, also, how I can retain the SRW.DO_SQL statement and/or an alternative work around to the one that I have described.
    Thanks.
    Therese Hughes
    Forest Products Commision

    Hi again
    The firewall proved to be the problem after all! The firewall set in Reports config-files is not used for WebServices, it has to be set within the stub:
    Properties prop = System.getProperties();
    prop.put("http.proxyHost","yourProxyServer");
    prop.put("http.proxyPort","youProxyServerPort");
    I inserted this in my java-code and after some problems (see below), restarting Report Builder turned the trick, the report works now.
    Cheers
    Tino
    Here there mail I set up before I found that restarting Report Builder helped:
    Thanks for your answer, putting in the proxy-settings actually helped some - the same error message is
    popping up, but instantly and not after 10 seconds like before:
    My proxy lines look like this, I also tried "http://proxy.ch.oracle.com", but "proxy.ch.oracle.com" proved to
    be the correct syntax:
    public Float getRate(String country1, String country2) throws Exception
    Float returnVal = null;
    Properties prop = System.getProperties();
    prop.put("http.proxyHost","proxy.ch.oracle.com");
    prop.put("http.proxyPort","8080");
    URL endpointURL = new URL(endpoint);
    Call call = new Call();
    I tested the new proxy-entries by disabling the proxy preference in JDeveloper, so I could verify the added
    proxy-lines in the code work - they do. If I change the proxy to some incorrect value like
    "proxyy.ch.oracle.com", they fail.
    After unsuccessfully trying recompile and re-import of Java classes, I rebuild the report from scratch and
    stumbled over the same problem. Now the question is, whether I'm still doing something wrong with the
    proxy or whether there is another problem after passing the firewall....
    -------------------------------------------------------------------------------------------------------------

  • System.Threading.Tasks parameter passing?

    How do we pass parameter into a function called by a task? Please take a look at below code which has a problem where all 3 task will only use the latest parameter value but if i were to use different variable names then it will be correct!?
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.Threading.Tasks;
    using System.IO;
    namespace TestTask
    public partial class Form1 : Form
    public Form1()
    InitializeComponent();
    private static void DoCalc(string AStr)
    string path = @"C:\" + AStr;
    StreamWriter sw = new StreamWriter(path);
    sw.Write(AStr);
    private void Form1_Load(object sender, EventArgs e)
    string LStr = "1";
    Task LTask = new Task(() => DoCalc(LStr));
    LTask.Start();
    // this work
    //string LStr2 = "2";
    //LTask = new Task(() => DoCalc(LStr2));
    // this does not work
    LStr = "2";
    LTask = new Task(() => DoCalc(LStr));
    LTask.Start();
    // this work
    //string LStr3 = "3";
    //LTask = new Task(() => DoCalc(LStr3));
    // this does not work
    LStr = "3";
    LTask = new Task(() => DoCalc(LStr));
    LTask.Start();

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading;
    using System.Data.Sql;
    using System.Data.SqlClient;
    using System.Data;
    namespace Hilos
        public class Cadence
            public string Nombre
                get;
                set;
            public ConsoleColor Color
                get;
                set;
            public int Numero
                get;
                set;
            public string fieldId
                get;
                set;
            public Cadence(string nombre, int num, string fiel,ConsoleColor color )
                this.Nombre = nombre;
                this.Numero = num;
                this.fieldId = fiel;
                this.Color = color;
                public Cadence()
        public class SimpleThread
            public void StartObject(object info)
                // This receives the value passed into the Thread.Start method.
                Cadence value = (Cadence)info;
                SqlConnection conn = new SqlConnection("#your config file#");
                conn.Open();
                string query = "select top 2 * from "+ value.Nombre;
                SqlCommand cmd = new SqlCommand(query, conn);
                DataSet datos=new DataSet ();
                using (SqlDataAdapter adapter = new SqlDataAdapter(cmd))
                    adapter.Fill(datos); 
                foreach (DataRow itemRow in datos.Tables[0].Rows)
                    for (int cell = 0; cell < datos.Tables[0].Columns.Count; cell++)
                        Console.ForegroundColor = value.Color;
                        Console.SetCursorPosition(0, int.Parse(value.fieldId));
                        Console.WriteLine("Hilo numero {0} :", value.Numero);                                    
                        Console.Write("                                                
                        Console.SetCursorPosition(0, int.Parse(value.fieldId) + 1);
                        Console.WriteLine(itemRow[cell] + "|");
                        Thread.Sleep(ConfigClass.segundos);
                Console.SetCursorPosition(0, int.Parse(value.fieldId) + 1);
                Console.Write("                                                        
                Console.SetCursorPosition(0, int.Parse(value.fieldId) + 1);
                Console.ForegroundColor = ConsoleColor.White;
                Console.Write("Done  \n");            
            public void  MainProcess()
                // Create an array of Thread references.
                Thread[] array = new Thread[4];
                //for (int i = 0; i < array.Length; i++)
                    // Start the thread with a ParameterizedThreadStart.
                    ParameterizedThreadStart start = new ParameterizedThreadStart(StartObject);
                    array[0] = new Thread(start);
                    array[0].Name = "uno";
                    array[0].Start(new Cadence("tablename", 1, "5",ConsoleColor.Yellow));
                    array[1] = new Thread(start);
                    array[1].Name = "Dos";
                    array[1].Start(new Cadence("tablename", 2, "8", ConsoleColor.Blue));
                    array[2] = new Thread(start);
                    array[2].Name = "Tres";
                    array[2].Start(new Cadence("tablename", 3, "11", ConsoleColor.Red));
                    array[3] = new Thread(start);
                    array[3].Name = "Cuatro";
                    array[3].Start(new Cadence("tablename", 4, "14", ConsoleColor.DarkGreen));
                // Join all the threads.
                    //for (int i = 0; i < array.Length; i++)
                    //    array[i].Join();
                    int index = 0;
                    bool stoped = true;
                    string thread="";
                    List<Thread> listaHilo = new List<Thread>();
                    while (stoped)
                        foreach (Thread item in array)
                            if (item.ThreadState == ThreadState.Stopped && !listaHilo.Contains(item) )
                                //stoped = false;
                                thread = item.Name;
                                Console.SetCursorPosition(0, 2);
                                Console.Write("                                        
                                Console.SetCursorPosition(0, 2);
                                Console.Write("DONE , hilo numero: {0}", thread);                         
                                listaHilo.Add(item); 
                            if (array.ToList().Count == listaHilo.Count)
                                stoped = false; 
                        Console.SetCursorPosition(0, 1);
                        Console.ForegroundColor = ConsoleColor.White;
                        Console.Write("Segundos : {0}", (index += 1));
                        Thread.Sleep(ConfigClass.segundos);
                Console.ReadLine();
            }//end funtion
        }//end class
        public static class ConfigClass
            public static int segundos= 250;        
    }

  • JRC bug: apostrophe in string parameter passed to Crystal Report with Command datasource to SQL Server

    Post Author: nl11087
    CA Forum: JAVA
    A single quote/apostrophe in string parameter passed to a Crystal Report with Command datasource connecting to a SQL Server database, using sqljdbc driver does not escape the special character correctly. When doing a preview in the Crystal Reports IDE it allows you to escape the input parameter as expected and work correctly, but through the JRC component it fails. For string parameters without special sql server characters I experience no problems at all. When replacing the Command with a direct table there is also no problem.
    Reproduction:
    1. create a database db1, create a table table1 with a String type column col1.
    2. Create new report Report1.rpt, create a connection to above, Add Command using 'SELECT col1, col2, col3 FROM table1 WHERE col1 = '{?Par1}' . Add a parameter field Par1 : String
    3. In your java stand alone application using JRC add the parameter Par1 with a value "Jon Doe's Value" containing a single apostrophe. Export to PDF. (I also tried MSWord and this failed too, similar behavior). Additionally, in another test try to replaceAll("'","''") to escape it, preventing the code to break, but now it does not retrieve the expected row anymore and you end up with an empty report.
    Exception StackTrace:
    com.crystaldecisions.reports.exportinterface.exceptions.ExportException: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.formatter.a.c.if(Unknown Source)
    at com.crystaldecisions.reports.formatter.a.c.a(Unknown Source)
    at com.businessobjects.reports.sdk.b.b.int(Unknown Source)
    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.x.a(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.q.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.dd.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.reports.sdk.PrintOutputController.export(Unknown Source)
    Caused by: com.crystaldecisions.reports.formatter.formatter.c: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.<init>(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.if(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.e.l.<init>(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.e.p.<init>(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.e.p.a(Unknown Source)
    at com.crystaldecisions.reports.formatter.a.c.a(Unknown Source)
    ... 17 more
    Caused by: com.crystaldecisions.reports.dataengine.be: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.dataengine.n.else(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.nr(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.bn(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.bp(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.else(Unknown Source)
    at com.crystaldecisions.reports.dataengine.s.a(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.a(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.aa(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.<init>(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.<init>(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.<init>(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.a(Unknown Source)
    ... 23 more
    Caused by: com.crystaldecisions.reports.reportdefinition.datainterface.n: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.reportdefinition.datainterface.p.a(Unknown Source)
    ... 35 more
    Caused by: com.crystaldecisions.reports.queryengine.driverImpl.m: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.queryengine.driverImpl.o.eC(Unknown Source)
    at com.crystaldecisions.reports.queryengine.driverImpl.o.if(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ap.ea(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ap.h(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ap.dV(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ax.if(Unknown Source)
    at com.crystaldecisions.reports.queryengine.bc.if(Unknown Source)
    at com.crystaldecisions.reports.queryengine.bc.do(Unknown Source)
    at com.crystaldecisions.reports.queryengine.bc.do(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ae.cy(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ae.cz(Unknown Source)
    at com.crystaldecisions.reports.queryengine.b1.bc(Unknown Source)
    ... 36 more
    Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near 's'.
    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
    at com.microsoft.sqlserver.jdbc.IOBuffer.processPackets(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement$StatementExecutionRequest.executeStatement(Unknown Source)
    at com.microsoft.sqlserver.jdbc.CancelableRequest.execute(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeRequest(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(Unknown Source)
    ... 48 more
    - JRCAgent3 detected an exception: An error occured while exporting the report
    at com.businessobjects.reports.sdk.b.b.int(Unknown Source)
    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.x.a(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.q.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.dd.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.reports.sdk.PrintOutputController.export(Unknown Source)

    Post Author: nl11087
    CA Forum: JAVA
    A single quote/apostrophe in string parameter passed to a Crystal Report with Command datasource connecting to a SQL Server database, using sqljdbc driver does not escape the special character correctly. When doing a preview in the Crystal Reports IDE it allows you to escape the input parameter as expected and work correctly, but through the JRC component it fails. For string parameters without special sql server characters I experience no problems at all. When replacing the Command with a direct table there is also no problem.
    Reproduction:
    1. create a database db1, create a table table1 with a String type column col1.
    2. Create new report Report1.rpt, create a connection to above, Add Command using 'SELECT col1, col2, col3 FROM table1 WHERE col1 = '{?Par1}' . Add a parameter field Par1 : String
    3. In your java stand alone application using JRC add the parameter Par1 with a value "Jon Doe's Value" containing a single apostrophe. Export to PDF. (I also tried MSWord and this failed too, similar behavior). Additionally, in another test try to replaceAll("'","''") to escape it, preventing the code to break, but now it does not retrieve the expected row anymore and you end up with an empty report.
    Exception StackTrace:
    com.crystaldecisions.reports.exportinterface.exceptions.ExportException: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.formatter.a.c.if(Unknown Source)
    at com.crystaldecisions.reports.formatter.a.c.a(Unknown Source)
    at com.businessobjects.reports.sdk.b.b.int(Unknown Source)
    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.x.a(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.q.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.dd.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.reports.sdk.PrintOutputController.export(Unknown Source)
    Caused by: com.crystaldecisions.reports.formatter.formatter.c: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.<init>(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.if(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.e.l.<init>(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.e.p.<init>(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.e.p.a(Unknown Source)
    at com.crystaldecisions.reports.formatter.a.c.a(Unknown Source)
    ... 17 more
    Caused by: com.crystaldecisions.reports.dataengine.be: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.dataengine.n.else(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.nr(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.bn(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.bp(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.else(Unknown Source)
    at com.crystaldecisions.reports.dataengine.s.a(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.a(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.aa(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.<init>(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.<init>(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.<init>(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.a(Unknown Source)
    ... 23 more
    Caused by: com.crystaldecisions.reports.reportdefinition.datainterface.n: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.reportdefinition.datainterface.p.a(Unknown Source)
    ... 35 more
    Caused by: com.crystaldecisions.reports.queryengine.driverImpl.m: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.queryengine.driverImpl.o.eC(Unknown Source)
    at com.crystaldecisions.reports.queryengine.driverImpl.o.if(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ap.ea(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ap.h(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ap.dV(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ax.if(Unknown Source)
    at com.crystaldecisions.reports.queryengine.bc.if(Unknown Source)
    at com.crystaldecisions.reports.queryengine.bc.do(Unknown Source)
    at com.crystaldecisions.reports.queryengine.bc.do(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ae.cy(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ae.cz(Unknown Source)
    at com.crystaldecisions.reports.queryengine.b1.bc(Unknown Source)
    ... 36 more
    Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near 's'.
    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
    at com.microsoft.sqlserver.jdbc.IOBuffer.processPackets(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement$StatementExecutionRequest.executeStatement(Unknown Source)
    at com.microsoft.sqlserver.jdbc.CancelableRequest.execute(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeRequest(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(Unknown Source)
    ... 48 more
    - JRCAgent3 detected an exception: An error occured while exporting the report
    at com.businessobjects.reports.sdk.b.b.int(Unknown Source)
    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.x.a(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.q.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.dd.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.reports.sdk.PrintOutputController.export(Unknown Source)

  • Issue with parameter passing in ie7 to php xml

    Hi
    I wondered if anyone could offer a little advice what the issue is here.
    I have a page with xml generated from php in a separte file and presented by a dataset in spry.
    The xml is OK and in firefox it all works but ie seems to barf on it.
    The situation is this:
    I have a jump menu on a front page that provides a url with anumeric parameter passed like this
    platforms.php?platform_id=1
    This parameter is picked up by php on the platforms.php page using the $_GET Array and is passed into the code in my Spry dataset to the file that runs my query and returns my xml- so basically the page displays a dataset filtered on this parameter id.
    It works perfectly in FF.
    In IE if I link straight to the page without a parameter at all- so platforms.php the page loads OK using the default parameter I have set up in the top of this page to send the default id of 1 to the code page so the spry query says platform_sql.php?platform_id=1 and the xml generator is fine with thisiel. ie I do a
    if(isset($_GET['platform_id'])){
                                                                     $platform=$_GET['platform_id'];
    }else{
    $platform=1;
    The dataset loads Ok in IE but when I pass a parameter in the url from my jump menu IE gives a blank SPRY table i- it momentarily appears with just the placeholders for my dataset elements then vanishes. The source code of the page shows the correct id was set in the spry data going to my query file.
    There is an error in ie saying there is a javascript error but its not any help- in ie fashion- FF shown no such errors.
    I thought this might be a data type thing again in the dataset but its not - I have set the elements returned to simple strings but it still does not work.
    Is there a problem passing in a parameter like this to a spry dataset?

    After about half a day of mucking round I found the problem and a solution to this problem.
    What appeared to have happened was that some of the older content in my database used html originally encoded using a WYSWYG editor called ktml.
    Later data uses Tiny MCE. It looks like the character set of the two formats is slightly different and as a result some characters rendered incorrectly when passed through XML parsing where it specifies the character set as utf-8.
    Firefox on the whole seems to ignore the issue though looking at the raw xml output of my php-xml code- where "-" characters were (dashes) there was a question mark character shown. None the less in actual use on my page the xml was produced and the dataset worked out.
    In IE, it barfed at these same characters and failed to return the xml dataset.
    What confused the issue more was some of my smaller datasets if they by chance never had a "-" character in rendered OK in IE- hence my default dataset (platform_id=1) worked in IE. After much experimenting I noticed other ids worked too if there was never such a character.
    How I got round it was to wrap my server side data in the utf8_encode() function, and now all my xml is clean.
    The javascript error being thrown was a red herring though I could not tell until I managed to run my page in ie7 with Visual Studio Express error console running- I had this on a spare machine at work so could debug with it.
    All sorted now- now just need to find away to wrap all my datasets in collapsible panels that work.
    K

  • How can I get a parameter back into a servlet invoked from an IMG tag ?

    I'm using a servlet to create several graphical plots per JSP i.e. per HTML page. Each graph is supposed to be different, according to a parameter which I want to pass back from my JSP. I'm getting several plots but they're all the same!
    I've tried setting an attribute in the session object before each IMG SRC= , but all I get is each plot the same! In fact, my debugging efforts show that the servlet is only called once despite 3 calls, each with a different session parameter value. I'm not sure the session parameter values are getting used properly.
    I just can't find a way of getting a parameter back into my servlet which is invoked from the IMG tag (i.e. SRC= "servlet name").
    Can anyone tell me the best way to pass a parameter back into a servlet which is invoked from an IMG tag? Can the request object be used? I can't, at the moment, see how it could be used?
    I'll certainly be very grateful if anyone can help with this - could even be useful for others as well!

    You said that, "by moving a copy of Mobile Docs back to the Library, from which I had moved it, my documents reapperared in Cloud." That says that you actually moved it. Obviously, I can't tell exactly what you did, but it sounds like you may have thought you were just putting it in the sidebar, but you actually put it somewhere else. The sidebar is not a location to put things, just a way to create a quick shortcut to access a file or folder, so you can't put things "back" from there.

  • Parameter passing issue for HTMLDB report page

    Hi,
    I have created a HTMLDB report based on SQL query in which the where clause column needs to takeup dynamic value each time.
    So I have defined a hidden item on the page PUSERID of Source type "Static Assigment".
    And this variable is used in SQL as
    Select Name
    from employees
    where employeeid = :PUSERID
    Now when i try to run this report and pass the parameter thru the URL by edititng the URL to have parameter value as
    http://localhost:33492/pls/htmldb/f?p=104:8:8320056215249064505:::::PUSERID:CPRASAD
    This shows the page with no data found...though when i run the query manually it returns the result.
    Select Name
    from employees
    where employeeid = 'CPRASAD'
    Plz let me know the correct procedure to make this work?
    Thanks
    AJ

    Thanks Serigo..it works!
    But why we need to remove the colon?Was it symbolizing that there was no parameter passed initially on URL and later when I was expecting one which was acting as two parametes in case of my url example(one parameter as nothing and another ad PUSERID)

  • Getting error Invalid length parameter passed

    Hi,
    I'm getting an error running my query. It say "Invalid length parameter passed to the LEFT or SUBSTRING  function. I will be getting the string in between of hyphen using the code below. May i ask your assistance or idea on how to fix this issue.
    thank you.
     Substring(ins.itemid,11,CHARINDEX('-',ins.itemid+'-',11)-11) AS MODEL
    Msg 537, Level 16,
    State 3, Line 1
    Invalid length parameter passed to the LEFT or SUBSTRING
    function.
    Sample data of Itemid.
    B300-4410-ONEMAX-U
    B300-1725-XWHT-U
    B300-3110-VT981-U
    B300-1720-DRZRKCROBLK-U
    B300-1720-DRDTHN32BLK-U

    That'll cause empty strings to show up into you're result set but shouldn't cause the the SUBSTRING function to fail. 
    The error is the result of the SUBSTRING function trying to bring back a negative number of characters.
    Try running the following and see what comes back...
    SELECT ins.itemid
    FROM dbo.TableName ins
    WHERE LEN(ins.itemid) < 11
    If you don't find any itemids what are less than 11 characters (I'm 99% sure you will), try using a little test script like the following to test suspect values...
    IF OBJECT_ID('tempdb..#temp') IS NOT NULL
    DROP TABLE #temp
    GO
    CREATE TABLE #temp (
    itemid VARCHAR(30)
    INSERT #temp (itemid) VALUES
    ('B300-4410-ONEMAX-U'),
    ('B300-1725- '),
    ('B300- 3110-VT981-U'),
    ('B300-1720-DRZRKCROBLK-U'),
    ('B300- 1720-DRDTHN32BLK-U')
    SELECT ins.itemid
    FROM #temp ins
    WHERE LEN(ins.itemid) < 11
    SELECT
    SUBSTRING(
    ins.itemid, 11, CHARINDEX('-',ins.itemid+'-',11)-11) AS MODEL FROM #temp ins
    HTH,
    Jason
    Jason Long

  • NEED PARAMETER PASSING SAMPLE INSTALLATION ZIP FILE...

    Hello All,
    I was viewing the following page:
    http://portalstudio.oracle.com/pls/ops/docs/FOLDER/COMMUNITY/PDK/
    articles/guidelines.parameter.passing.html
    Near the end of the page it reads, "For a detailed PL/SQL portlet
    sample, see the Parameter Passing sample included in the PL/SQL
    section including the Parameter Passing Sample Installation
    article and check out the source code in the downloadable zip
    file."
    The phrase "downloadable zip" near the end of this line is a link
    that is supposed to provide you with the zip file. When I click
    on this link I get the file to save as sample.zip. Files get
    downloaded but when I try to unzip it,
    I encounter error messages :
    Missing 1 bytes in Zip file (attempting to process anyway).
    Cannot open file: it does not appear to be a valid archive.
    If you downloaded this file, try downloading the file again.

    let say i have a code as below:
    public void init()
          String rootDirectory = JOptionPane.showInputDialog( this,
             "Please enter a directory name:" );
          FileTreePanel panel = new FileTreePanel( rootDirectory );
          getContentPane().add( panel );
       }and i use this code to call the batch file:
    import java.io.IOException;
    public class callbatch{
         public static void main(String args[]) {
              try {
                   Runtime runtime=Runtime.getRuntime();
                   Process process=runtime.exec("cmd /c start callnvcc.bat");
                   catch(IOException ioe) {
                        System.out.println(ioe);
         }how can i pass the rootDirectory into my callnvcc.bat?

  • Adding a CM: Invalid length parameter passed to the RIGHT function. (CINF)

    We started seeing this error message a week ago when attempting to add a Credit Memo.  We only see this error message when entering Credit Memos and not any other finacial documents.  I've done some preliminary research and haven't really come up with anything to point to the issue.  Prior to reporting this to my support partner, I wanted to see if anybody here has seen this before or give me some ideas to look into the source of the issue.
    Full error message: Microsoft SQL Native Client SQL Server Invalid length parameter passed to the RIGHT function. (CINF)

    Checking the list of form ID's at [http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/892] shows the A/R Credit Memo as 179 and the A/P Credit Memo as 181.  This also corresponds with what I see when viewing the system information on the form.

  • Parameter passing from master to subreport

    Is it possible to pass a multi-value parameter from a master report to one or more subreports? If so, how?
    Thanks for any help.
    Wayne E. Pfeffer

    Yes you can do this. I suggest the following: In your subreport make the report parameter a multi-value parameter. Test the subreport stand alone and make sure it works. Then drop the subreport into your main report, and map the subreport parameters to the main report parameters.
    Scenario 1 (multi value parameter pass through):
    The Main report has report parameter A which is a multi value parameter. You want to pass it to SubReport1 which has a report parameter B which is also defined as multi value parameter. In this case the mapping is just a simple parameter expression: =Parameters!A.Value
    The subreport RDL element would look like this:
              <Subreport Name="SubReport1">
                <Parameters>
                  <Parameter Name="B">
                    <Value>=Parameters!A.Value</Value>
                  </Parameter>
                </Parameters>
              </Subreport>  
    Scenario 2:
    The Main report has no report parameters. You have a SubReport1 with a report parameter B defined as multi value parameter. You want to pass e.g. three selected values "A", "B", "C" as parameter values to the subreport. You need to create a multidimensional object array on-the-fly, e.g. with the Split function, e.g.: =Split("A,B,C", ",")
    RDL example:
              <Subreport Name="SubReport1">
                <Parameters>
                  <Parameter Name="B">
                    <Value>=Split("A,B,C", ",")</Value>
                  </Parameter>
                </Parameters>
              </Subreport>
    Scenario 3:
    The Main report has a multi-value parameter A. You want to pass only the first selected value from the main report's parameter to the subreport and the subreport's report parameter B is a single-value parameter. You can do this by using e.g. =Parameters!A.Value(0)
    RDL example:
              <Subreport Name="SubReport1">
                <Parameters>
                  <Parameter Name="B">
                    <Value>=Parameters!A.Value(0)</Value>
                  </Parameter>
                </Parameters>
              </Subreport>
    -- Robert

Maybe you are looking for