Single parameter report running from java application

hi,
I had developed one servlet to run the crystal report template which will take one parameter.
The service method from my servlet I am placing here.
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
          ReportClientDocument clientDocument = new ReportClientDocument();
          CrystalReportViewer viewer = new CrystalReportViewer();
          Fields fi= null;
          viewer.setName("one");
          try
               clientDocument.open("C:/Documents and Settings/Administrator/Desktop/lib-so/oneParamReport.rpt", 0);
          catch (ReportSDKException e)
               e.printStackTrace();
          Fields oFields = new Fields();  
                    ParameterField portfolio = new ParameterField();
                    portfolio.setName("Portfolio");
                   Values oValues = new Values();
                   ParameterFieldDiscreteValue oParameterFieldDiscreteValue = new ParameterFieldDiscreteValue();
                   oParameterFieldDiscreteValue.setValue(new Integer(16));
                   oValues.add(oParameterFieldDiscreteValue);
                   portfolio.setCurrentValues(oValues);
                   portfolio.setReportName(fileName);
                   oFields.add(portfolio);
          try {
               viewer.setParameterFields(oFields );
               viewer.processHttpRequest(request, response,request.getSession().getServletContext(), response.getWriter());
               viewer.dispose();
          } catch (ReportSDKExceptionBase e) {
               // TODO Auto-generated catch block
               e.printStackTrace();
while running this servlet I am getting one exception
"JRCAgent1 detected an exception: Error finding JNDI name (sql server)"
I am using jdk 6, sql server 2005, jboss 5, and crystal reports x1.
what could be the wrong in my code please tell me the reason and solution  for this .
thanks ,
mallikarjun
Edited by: mallikarjuna.ch on May 15, 2009 3:14 PM
Edited by: mallikarjuna.ch on May 15, 2009 3:15 PM
Edited by: mallikarjuna.ch on May 15, 2009 3:15 PM

thanks a lot neeraj for your response.I got resolved the database connection problem through programetically as shown bellow.
ITable table =  databaseController.getDatabase().getTables().getTable(0);
ITable oldtable = table;                     
table.setQualifiedName("sp2m.dbo." + table.getName());
IConnectionInfo connectionInfo = table.getConnectionInfo();
PropertyBag propertyBag = new PropertyBag();
propertyBag.put("Trusted_Connection", "false");
propertyBag.put("Server Name", "testsvr2"); //Optional property.
String CONNECTION_STRING="Use JDBC=b(true);Connection URL=s(jdbc:microsoft:sqlserver://testsvr2:1433); /Database Class Name=s(com.microsoft.jdbc.sqlserver.SQLServerDriver);Server=s(testsvr2); /User ID=s(sa);Password=cispl;Database=s(sp2m);Trusted_Connection=b(false); /JDBC Connection String=s(!com.microsoft.jdbc.sqlserver.SQLServerDriver!jdbc:microsoft:sqlserver://testsvr2:1433; /     DatabaseName=;user=;password=!)";
                    propertyBag.put("Connection String", CONNECTION_STRING);
                    propertyBag.put("Database Name", "sp2m");
                    propertyBag.put("Server Type", "JDBC (JNDI)");
                    String URI="!com.microsoft.jdbc.sqlserver.SQLServerDriver!jdbc:microsoft:sqlserver://testsvr2:1433;DatabaseName=;user=;password=!";
                    propertyBag.put("URI", URI);
                    propertyBag.put("Use JDBC", "true");
                    propertyBag.put("Database DLL", "crdb_jdbc.dll");
                    System.out.println("is this setlocation");            
                    connectionInfo.setAttributes(propertyBag);
                    connectionInfo.setUserName("sa");
                    connectionInfo.setPassword("cispl");
                    connectionInfo.setKind(ConnectionInfoKind.SQL);
                    table.setConnectionInfo(connectionInfo);
                    try {
                         databaseController.setTableLocationEx(oldtable,table);
                    } catch (ReportSDKException e) {
                         e.printStackTrace();
i am connecting mydatabase like above through programetically. it is coming fine , also it was working fine with crystal report tool, now I am getting new problem i.e crystal report engine not accepting parameter values set by me through program and asking to enter the parameters by generating one jsp page like as an interface in crystal report tool. Onece I submit that values it is generating the output properly .I have to avoid this unwanted page and I have to pass my parameter values from my jsp.
please help me in this,
thank u.
Edited by: mallikarjuna.ch1 on May 17, 2009 8:14 AM
Edited by: mallikarjuna.ch1 on May 17, 2009 8:27 AM
Edited by: mallikarjuna.ch1 on May 17, 2009 8:43 AM

Similar Messages

  • Running a script from java application

    How do I execute a script (sms_setver which requires parameters such ms9qa) from java application using Runtime.exec(). I tried Runtime.getRuntime().exec("sms_setver ms9qa"). But, I get this error:
    Caught: java.io.IOException: CreateProcess: sms_setver ms9qa error=2

    Same way it is actually run from a console command line.
    If you are doing this in windows then it might be using the extension to determine how to run it. If from unix then it might be using the shebang line.
    At any rate figure it out and use that instead. Usually it involves either explicitly using the shell or some other executable and the script is a parameter to that process.

  • Running a java application from a java application

    hello ,
    please who knows how i can run a java application 'B' from inside another java application 'A' and get the error messages (if any) from the application 'B'

    how are you executing application B from application A? Please explain the java code you are using?

  • Running a Java application from a Swing GUI

    Hi,
    I was wondering if there is a simple way to run a Java application from a GUI built with Swing. I would presume there would be, because the Swing GUI is a Java application itself, technically.
    So, I want a user to click a button on my GUI, and then have another Java application, which is in the same package with the same classpaths and stuff, run.
    Is there a simple way to do this? Do any tutorials exist on this? If someone could give me any advice, or even a simple "yes this is possible, and it is simple" or "this is possible, but difficult" or "no this is not possible" answer, I would appreciate it. If anyone needs more information, I'll be happy to provide it.
    Thanks,
    Dan

    I don't know if it is possible to run the main method from another Java app by simply calling it...
    But you could just copy and paste the stuff from your main method into a new static method called something like runDBQuery and have all the execution run from there.
    How does that sound? Is it possible?
    What I'm suggeting is:
    Original
    public class DBQuery{
    public static void methodA(){
    public static void doQuery(){
    methodA();
    public static void main(String[] args){
    // Your method calls
    //Your initializing
    doQuery();
    }Revised:
    public class DBQuery{
    public static void methodA(){
    public static void doQuery(){
    methodA();
    public static void doMyQuery(){
    // Your method calls
    //Your initializing
    doQuery();
    // No main needed!!
    //public static void main(String[] args){
    // Your method calls
    //doQuery();
    //}

  • Accessing XML Publisher Reports from Java application

    How to accesss the XDO Reports from Java application?
    I am wondering that we need to get the URL for accessing the report and call the URL with in Java program?
    Is that right? Is there any other option? Any help is greatly appreciated.

    You need to write some class based on the BI Publisher APIs taking data, template, output format, etc.
    Pehaps the following Blog of Tim Dexter shines some light on your question
    http://blogs.oracle.com/xmlpublisher/2007/02/27#a166
    Marcos

  • Can we run EXE file/ Another Java Program from Java Application? How?

    Can we run EXE file and another java program from java application?
    Thanks in advance

    Example running adobe acrobat
    String command = "C:\\Program Files\\Adobe\\Acrobat 5.0\\Reader\\AcroRd32.exe /t "+selectedDocument+" \\\\CONTROL\\HP LaserJet 4L";
    Runtime rn = Runtime.getRuntime();
    Process process = rn.exec(command);
    process.waitFor();rykk

  • Running .bat files from java applications

    Has anyone tried to run a .bat file from a java application?
    I know I can run java commands by getting the application's runtime, but I've a number of *.bat files I like to run from the application without having to extract the commands from the .bat files.
    thks,

    Crikey! You were answered very shortly after you posted your question, and you STILL haven't bothered to come back. And are you going to create a new userid the next time you ask a question, since bat2004 seems tied to this particular question?

  • Running exe files from java applications

    Hello All,
    Is it possible to run executable files from java applications?
    I need to run an exe file on the client from the server machine, the exe could reside on either the server or any other machine on the LAN. Is it possible to specify the path of where the exe resides, and run it on a client machine?

    HI,
    I tried to launch a MS Word application using runtime.exec but it gives me some problem
    The foll. code to launch a txt file using notepad works.
    Runtime rt = Runtime.getRuntime();
    String[] callAndArgs = {"notepad.exe","C:\\coo7\\wizard.txt"};
    Process child = rt.exec(callAndArgs);
    However, oif I try to launch a MS Word application, it asks for the entire path of WINWORD.exe, (unlike just specifying notepad.exe as the first argument in String[] callAndArgs) and this can vary from one machine to another.. how do I get around this?
    The foll. code snippet works but the complete path of where WINWORD.exe might be installed on any machine, is not fixed:-(
    Runtime rt = Runtime.getRuntime();
    String[] callAndArgs = {"C:\\Program Files\\Office\\Office10\\WINWORD.exe","C:\\coo7\\wizard.doc"};
    Process child = rt.exec(callAndArgs);
    Any idea/suggestions pls..

  • Is it possible to run a java application within a web browser?

    Hello everyone here! I have a question about running a java application within a web browser and I would appreciate it very much if anyone here can give me some answers.
    I have a standalone java application written with AWT. Basically this free application lets users to select spectral lines from a big file based on some criteria and plot those selected lines. Yes, it is a very simple application. Now I want to run this application within a web browser so that users don't need to download the application from the ftp site and thus don't need to install in their machine. Is it possible to run this application within browser? If yes, can we get the same plotting function as we run the application separately and where should I start out?
    Thanks in advance!
    kuilian

    Please see the signed applet discussion group for details of how to avoid the applet security restrictions. You can sign the applet, or use the policy file containing {AllPermission} for testing purposes (though not suitable for widespread deployment).
    Regards
    Matthew

  • Running a Java Application in Windows

    Hi, Can anyone tell me how to run a Java Application in Windows? I've tried to run it using TextPad 4.5 but it gives me an exception saying it can't find a class defenition. I'm actually using IBM VisualAge for Java to develop the app and it runs fine INSIDE VisualAge and I've exported my compiled class files and so on, to run it stand-alone in Windows. I'm using some custom objects and inner classes, could these be the problem?

    YES! SUCCESS! I exported my class files from VAJ and along with the manifest file that it adds automatically. I opened up the jar with Winrar, extracted the manifest file and added the Main-class: header pointing to my executable and then put it back in the jar with winrar. And PRESTO! I can now run it with javaw! Thanks for your help peeps...

  • Get parameters from html page from java application standalone ...

    Hi all,
    I work in one solution that i have values in Html Page and i want get the parameters values from html and cath they in java application standalone.
    The Html page is in same host than de java application.
    I want know if this is possible. I wnat know if without HttpServlet i can get the parameters from Html Page pure.
    Thanks in Advance for the ideas,
    Antonio.

    Hi Abdul,
    The problem is my client want one solution where i have one page simple page Html and one application java standalone. This application runs in one machine, but we don't have web server. So the question is: Is possible without web server i can get the parameters values that is inside the html page from java application. I remember you that the application java is one .jar that run's with one command line from crontab "java -jar teste.jar".

  • Storing chinese in client odb from java application

    Hi all,
    first i like to thank Greg Rekounas for his wonderful support and contribution....
    This is my server setup.
    os-windows 2000 sp4
    db-oracle 9ir2 (unicode with AL32UTF8 charset)
    lite-oracle10g r2 (with latest patchset)
    nls_lang- AMERICAN_AMERICA.AL32UTF8
    storing and retriving chinese in oracle 9i database from isql*plus works.
    lite configuration.
    1. In $OLITE_HOME\mobile_oc4j\j2ee\mobileserver\applications
    \mobileserver\setup\common\webtogo\webtogo.ora file edited the JAVA_OPTION
    to:
    JAVA_OPTION=-Djava.compiler=NONE -Dfile.encoding=UTF8
    2. In $OLITE_HOME\mobile_oc4j\j2ee\mobileserver\applications
    \mobileserver\setup\dmc\common\win32.inf file, added the following:
    a. In the <file> section, added the following:
    <item>
    <src>/common/win32/olilUTF8.dll</src>
    <des>$APP_DIR$\bin\olilUTF8.dll</des>
    </item>
    b. In the <ini> section, added the following:
    <item name='POLITE.INI' section='All Databases'>
    <item name="DB_CHAR_ENCODING">UTF8</item>
    </item>
    <item name='POLITE.INI' section='SYNC'>
    <item name="DB_ENCODING">UTF8</item>
    </item>
    published the application developed in java using packaging wizard.
    downloaded the client in the pc with the following config:
    windows 2000 (english)
    nls - default.
    installed chinese language support.
    tried to access 9i database from isql*plus and stored & viewed chinese characters sucessfully.
    tried to store a chinese character from java application in the client odb -- failed.
    values are getting inserted from the application but when i view them back it shows & # 2 6 0 8 5 ; (i have included a space in between all 8 characters.
    but when i copy this no and paste in msword it shows 日(chinese character)
    i dont know the exact reason for the above scenerio...................
    Also please help me on this too.......
    why can i store & view chinese characters sucessfully in isql*plus from the client machine while i cannot do the same on client odb from java application even though the lite config are done to support utf8?
    is anything i left out?
    should i do any codes changes in java?(java application is of verision jdk1.4_13)
    Thanks,
    Ashok kumar.G

    Sorry for late replay!! in the SharePoint server both the Claim based and Classic mode is enabled in the server, but still I want to get authenticated via Classic mode just like it happens in SharePoint  2007 and 2010, so do i have to use a different
    set of classes to do that if yes can you please tell me those ?

  • How do i run a java application in jdk1.3

    im trying to run a java application in jdk 1.3. I created it in jbuilder and i was trying to use the applet viewer.

    http://java.sun.com/j2se/1.3/docs/tooldocs/win32/appletviewer.html
    Jesper

  • How can I run a java-application on starting of Windows 2000

    How can I run a java-application without any user on starting of Windows 2000?
    For example, if the computer is restarted and nobody enter into it yet, my java-application should run anyway.
    How can I do that?

    Hi, you have to put it in a Windows service.
    To do this you have a program, Srvany.exe that allow to insert a .exe or .bat program in a Windows service.
    For example, i develop a program, TomcatGuardian and i put it in a service because i need to run it in a server without Administrator logged in.
    Regards,
    Ivan.

  • Running a java application in command prompt

    hi, I'm new to this forum.
    I would like to know what exactly needs to be specified to run a java application in a normal DOS command prompt.
    I know it is something like:
    javaw -classpath .\class GUI.applicationGUI
    where applicationGUI is the main class, right? What else do I need to do, since I have some other non-GUI classes that I need, inside the class folder ?
    Thanks for your time.

    You need to import those classes. And you need to make packages.
    In classes 1, 2 and 3 put:
    package class;
    In class 4 put;
    package class.GUI;
    Then you need to make the connection:
    In classes 1,2 and 3 put:
    import class.GUI.*;
    In class 4 put:
    import class.*;
    Compile each directory separately while in the respective directory. javac *.java
    Then go back to the directory above the directory "class" and run
    java class/GUI/name_of_file_containing_main_method

Maybe you are looking for

  • Wlan problem with nokia n95 8g RM-320

    i have nokia n95 8g RM-320  frimware 35.0.00.1 wlan stopped working and i did a lot of things but nothing happened 1- format phone memory 2- reinstall software many times 3- restore factory settings 4- restore beackup without settings the problem is

  • 'prompt with description only' in viewer panel

    I'm seeing some odd behaviour in the crviewer when I use a report with parameters with the 'prompt with description only' flag set to true. This works fine initially, the parameter prompt dialog is shown and I can see a list of descriptions to pick f

  • Mac Pro and Final Cut Studio 5.1.2

    I've had problems trying to export mpeg files from final cut pro using compressor after having updated all applications to their current versions (FCP 5.1.2, Compressor 2.3, Qmaster 2.3, QT 7.1.3...) including firmware, OS and security updates. Since

  • Grant role to user in form 6i

    Dear all, I have a role called ets_manager. How can i grant it to my user steve in forms 6i? I mean what is the script? I have a button when button pressed i want the role be granted to a user Thanks in advance. regards

  • Best prepaid service when using a  3gs Iphone in San Francisco:

    I am interested in buying my first IPhone (a 3gs) and I would like to utilize it with a prepaid service such as  Straight Talk. Is there is particular prepaid provider that is recommended for the San Francisco area? Also related to that question is i