Crystal report from JSP using the JRC

Hi, I am trying to call crystal report from JSP using the JRC.
But i am getting the Error as 'Logon Failed'. my web.xml entry is
<env-entry>
<env-entry-name>jdbc/Test</env-entry-name>
<env-entry-value>!oracle.jdbc.driver.OracleDriver!jdbc:oracle:thin:{userid}/{password}@//10.0.0.1:1521/TestDB</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
i am setting the userid and password in the code. Please see the below code for your reference. Please help me to solve the issue.
<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ page import="com.crystaldecisions.report.web.viewer.CrystalReportViewer"%>
<%@ page import="com.crystaldecisions.sdk.occa.report.data.*"%>
<%@ page import="com.crystaldecisions.reports.reportengineinterface.JPEReportSourceFactory" %>
<%@ page import="com.crystaldecisions.sdk.occa.report.reportsource.IReportSourceFactory2" %>
<%@ page import="com.crystaldecisions.sdk.occa.report.reportsource.IReportSource" %>
<%@ page import="com.crystaldecisions.reports.reportengineinterface.JPEReportSource" %>
<html>
<head>
<title>Crystal Report with Database Logon information</title> </head>
<body bgcolor="#ffffff">
<%
try
String report = "/TEMPLATE.rpt";
IReportSourceFactory2 rptSrcFactory = new JPEReportSourceFactory();
JPEReportSource reportSource = (JPEReportSource) rptSrcFactory.createReportSource(report, request.getLocale());
CrystalReportViewer viewer = new CrystalReportViewer();
viewer.setReportSource(reportSource);
viewer.setHasRefreshButton(true);
IConnectionInfo newConnInfo = new ConnectionInfo();
newConnInfo.setUserName("TEST");
newConnInfo.setPassword("TEST");
ConnectionInfos newConnInfos = new ConnectionInfos();
newConnInfos.add(newConnInfo);
viewer.setDatabaseLogonInfos(newConnInfos);
viewer.setEnableLogonPrompt(false);
viewer.setOwnPage(true);
viewer.setOwnForm(true);
out.println("Connection Information: "+viewer.getDatabaseLogonInfos().getConnectionInfo(0).getAttributes().toString());
viewer.processHttpRequest(request, response, getServletConfig().getServletContext(),null);
viewer.dispose();
catch(Exception e)
throw new JspException( e);
%>
</body>
</html>

I never really had much luck with this approach.
Mind you I was using Crystal Reports 10, and as far as I recall it didn't allow setting/changing of database at this level.
Things to check
- can you create a database connection on your page with this URL/username/password?
- what server are you using? Tomcat? WebLogic?
I found this in your other post:
Connection Information: {Server Name=ee6rpt, Connection String=DSN=s(ee6rpt);User ID=s(ee62test);Password=;UseDSNProperties=b(false), Database Name=, Database DLL=crdb_odbc.dll}That would indicate it is using odbc to connect to the database (crdb_odbc.dll). ODBC is a bad idea with java.
The way I have got it to work for me (after much trial and error) was to in Crystal Reports to connect using the Oracle Driver, and specifying a tnsname - eg define REPORT_DS in tnsnames.ora.
When running through the JRC, it looked for a JNDI datasource under that same name "REPORT_DS".
Don't know if that will help you or not.
Good luck,
evnafets

Similar Messages

  • Crystal report in JSP using activeX viewer

    Hi,I'm trying to integrate JSP and crystal report.
    can you give me a sample code to display crystal report in JSP using activeX viewer(not pure HTML)
    I'm using crystal report 9,there are ASP sample come with CR9,but no JSP.also I don't want use Crystal Enterprise9 even I know the URL reporting may be the eaier way.

    Hi,I'm trying to integrate JSP and crystal report.
    can you give me a sample code to display crystal
    report in JSP using activeX viewer(not pure HTML)
    I'm using crystal report 9,there are ASP sample come
    with CR9,but no JSP.also I don't want use Crystal
    Enterprise9 even I know the URL reporting may be the
    eaier way.Hi, did u manage to get the ActiveX Viewer up with JSP? I'm also trying to do the same thing. If you could, pls kindly email me the basic source codes to [email protected]? Thanks

  • Printing Problem in Crystal Report From JSP

    Hi,
    I m calling crystal report from JSP.Report is parameterized.I m passing parameters from JSP.Report is displaying on the page,but when I try to print or export the report by pressing Print or export Button ,it displays an error message "Some parameters are missing values".
    Please guide my,what should I do? Following is the code.
    Good Bye
    AQ
    Vector fieldVector = new Vector();
    SPParameters spParams = new SPParameters();
    ReportFactory     reportFactory = new ReportFactory();
    // Setteing the report Name (Path Appended)
    reportFactory.setReportName(ReportsCoreDataConstants.REPORT_PATH.concat("Test_Rep2.rpt"));
    //Setting the parameters for the report
    ParameterField paramFeilds = null;
    System.out.println("fiscalYearCode:"+fiscalYearCode);     
    paramFeilds = spParams.createParams("IPFISCALCODE",fiscalYearCode);
    paramFeilds.setReportName("");
    fieldVector.add(paramFeilds);
    //Creating the ReportSourceInstance
    reportFactory.setFields(fieldVector);
    String exp = "";
    try {
         ReportFactory l_reportFactory=null;
         l_reportFactory = reportFactory;
         if (l_reportFactory != null) {
         CrystalReportViewer viewer = new CrystalReportViewer();
         viewer.setParameterFields(l_reportFactory.getFields());
         viewer.setOwnPage(true);
         viewer.setDisplayGroupTree(false);
         viewer.setHasZoomFactorList(false);
         viewer.setHasLogo(false);
         viewer.setHasPrintButton(true);
         viewer.setHasRefreshButton(true);
         viewer.setHasToggleGroupTreeButton(false);
         viewer.setHasViewList(false);
         viewer.setPrintMode(CrPrintMode.ACTIVEX);
         viewer.setSeparatePages(true);
         viewer.setEnableParameterPrompt(false);
         viewer.setReuseParameterValuesOnRefresh(true);
         viewer.setReportSource(l_reportFactory.createReport( request.getLocale() ));
         viewer.refresh();
         viewer.processHttpRequest(request, response, getServletConfig().getServletContext(),out);
         viewer.dispose();
    } catch(Exception e) {
         exp = e.toString();
         System.out.println("Exception in JSP : " + e.toString());
         e.printStackTrace();
    }

    I think ScreenRaghu is right. If you look at the generated source, your jsp becomes an action and processHttpRequest() method is invoked everytime some action happens. So when you click the export button, request object no longer has the values your report needs. Either put the values in session or via link or db or whatelse.

  • Calling XML Publisher Report from OAF using the conc programs xml output

    Hi all
    I am trying to call a report from oa Framework. I have developed the Template in the Ms-Word and for Generating the xml data i used the view object defined in OAF, this approach is working for me...i used the following code to do this in the AM as mentioned in many places...
    public XMLNode getEmpDataXML()
    OAViewObject vo = (OAViewObject)findViewObject("EmpVO1");
    XMLNode xmlNode = (XMLNode) vo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS);
    return xmlNode;
    now i want that instead of the view object i should use the xml generated by the report which is registered as concurrnet program with output as xml.
    I am submitting the concurrent program and able to get the request id ...
    Now from here what should i do.. please suggest...

    Hi,
    I am thinking of doing something very similar. What i was planning on doing is submitting the request, and then redirecting the user to the concurrent request page. They can then use the standard functionality to view output and get the xml to use the appropriate template.
    i would be interested in how you get the concurrent request id from the submitted job.
    Many thanks
    Rupesh

  • Some Crystal Reports are not using the Cache Server

    Hi...we are currently running BOE XI R2 SP2.  I setup a server group with a Cache Server and a Page Server.  In the CMC, I set this cache server to keep reports cached for 15 minutes.  On the Process tab of some reports, I specifically set the report to use this new server group.  On some of the reports this works as expected.  For others, it does not appear to be since the cache folder's Date Modified date does not change.  So far the only similarity between the reports that do not use cache is that these reports have sub-reports.  Has anyone experienced this before?  If so, how did you resolve it? 
    Thanks!

    Hi Rich,
    the connectivity on the Designer an don the BusinessObjects system is identical. Is region the only characteristic being used in the report ? which connectivity did you use in Crystal Reports ?
    ingo

  • Crystal Reports from PHP using COM

    I have tried copying various snippets of PHP code to render a Crystal Report in PDF which I can then stream to the browser, but I never get past the creation of the CrystalRunTime.Application.  (Earlier examples had CrystalDesignRunTime.Application instead; they did not work either).  Any suggestions what is wrong here?
    $ObjectFactory= new COM("CrystalReports12.ObjectFactory.1") or die ("Error on load");
    echo "<p>ObjectFactory created.<p>About to create CrystalRunTime.Application...";
    try {
         $crapp = $ObjectFactory-> CreateObject("CrystalRunTime.Application");
    } catch (com_exception $e) {
         echo("Error on instance creation:<br>".$e->getMessage().'<p>'.$e->getTraceAsString());
         echo "<p>".$e;
         exit;
    Here is the output:
    ObjectFactory created.
    About to create CrystalRunTime.Application...Error on instance creation:
    Source: Unknown
    Description: Unknown
    #0 C:\xampp\htdocs\tempo\comtest.php(11): com->CreateObject('CrystalRunTime....') #1
    exception 'com_exception' with message 'Source: Unknown
    Description: Unknown' in C:\xampp\htdocs\tempo\comtest.php:11 Stack trace: #0 C:\xampp\htdocs\tempo\comtest.php(11): com->CreateObject('CrystalRunTime....') #1

    $ObjectFactory= New COM("CrystalReports11.ObjectFactory.1");
                   //------ Create a instance of library Application -------
                   try
                        $CRobj = $ObjectFactory->CreateObject("CrystalRunTime.Application.11");
                   catch (com_exception $e)
                        echo("<br>Error on instance creation:<br>".$e->getMessage().'<p>'.$e->getTraceAsString().'</p>');
                        echo "<p><pre>".print_r($e, true)."</pre></p>";
                        exit;
    Source: Unknown
    Description: Unknown
    #0 C:\xampp\htdocs\analytics\generate_cr.php(103): com->CreateObject('CrystalRunTime....') #1 {main}
    com_exception Object
        [message:protected] => Source: Unknown
    Description: Unknown
        [string:Exception:private] =>
        [code:protected] => -2147352567
        [file:protected] => C:\xampp\htdocs\analytics\generate_cr.php
        [line:protected] => 103
        [trace:Exception:private] => Array
                [0] => Array
                        [file] => C:\xampp\htdocs\analytics\generate_cr.php
                        [line] => 103
                        [function] => CreateObject
                        [class] => com
                        [type] => ->
                        [args] => Array
                                [0] => CrystalRunTime.Application.11
        [previous:Exception:private] =>
    Edited by: EddieM on Dec 9, 2009 9:34 PM

  • Crystal reports and JSP

    Hi there, I would like to call crystal reports from JSP. How can I do that?
    My system is:
    Webserver: iPlanet 4.0 SP4
    Crystal reports: 8.5 Developer version
    Database: Oracle 8i version 8.1.6
    S.O.: Solaris.
    I tried the documentation from Seagate but there isn't examples and explanations in how to do this.
    Do I need some component? Where can I get it, if I do?
    Thankyou,
    Gines

    Please visit:
    www.geocities.com/pmk16
    Regards,
    pmk16

  • Open a crystal report from WAD with passing  the variables values

    Hi,
    I need to know is there any way to link SAP WAD to crystal reports (open a crystal report from WAD)and pass the values of the variables which are entered in the Web App. (e.g. Customer id,year) should be passed to the Crystal Report.
    Maybe we need to pass parameter by WAD URL but this is just my assumption and have no idea how to do this with passing variable values.
    right now I know the method of how Bex queries which are used as data source for crystal reports but in my current scenario we have the structure like this that bex queries link with WAD and then WAD is linked with crystal reports.
    No doubt that Crystal report is target option in RRI but there the source is Bex Query only but in current scenario we are looking  WAD (web template) as a source to crystal report or crystal report called in WAD.
    Please suggest something on same.
    Thanks
    Take care
    Vishal sharma

    Hello Vishal.
    Did you find a solution for this problem?
    I'm facing right now the same problem, I need a way to link SAP WAD to crystal reports (open a crystal report from WAD) and pass the values of the variables which are entered in the Web App. (e.g. Customer id,year) should be passed to the Crystal Report.
    Have found an answer to this issue? If yes, please kindly inform how have you solved this.
    Best Regars
    Armando Santos

  • How to open Crystal Report from the SAP GUI ?

    Hi experts,
        We have developed some reports for our ECC 6.0 system by using Crystal Report 2008 and SAP integration kit , these reports are published to BO edge 3.1 server.  To view the report, our user have to open IE and login Infoview first.
       For convenience, we want to open Crystal report from SAPGUI directly without login BOE, How can we do it? 
    Thanks.

    Hi
    please take a look here
    Crystal Reports
    Regards,
    STratos

  • Using Crystal reports in JSP

    Hi,
    I want to use Crystal report in jsp . I am running the jsp files in tomcat apache4.0 server.
    while executing the jsp files in tomcat , following class files are not being found:
    import="com.crystaldecisions.sdk.occa.report.application.*,
    com.crystaldecisions.sdk.occa.report.data.*,
    com.crystaldecisions.sdk.occa.report.lib.*
    can anyone plz tell where to get the required JAR file containing this classes or how to use crystal report in jsp.
    Regards,
    tommy

    The jars should be in your installed Crystal Reports folder( \Crystal Decisions\..\java\lib or something like that...). The problem is that your server (Tomcat and others) ignores the system classpath completely (it sets its own in its startup script).
    Therefore, in order for Tomcat to find the jars, those jars have to be placed in in %CATALINA_HOME%\common\lib\. There, they will be available for all your applications. If you don't want them available globally, put them in your particular webapp's WEB-INF\lib directory.

  • How to delete all the crystal reports from SAP B1 ?

    Dear Experts,
    I have one problem and I need to Delete all the Crystal PLD's and Crystal Reports from SAP B1.
    I can delete a PLD or Report using delete option from Report and layout manager or layout designer.
    But I need to select delete option for each PLD and It makes very time.I have some 200 Reports and I need to delete fully.
    Is there any possible to multi delete option in SAP B1?
    I have searched many but i will not receive proper solution. Any one can explain how to do This?
    Thanks ,
    Karthikeyan.P
    MSBI Developer-Chennai

    Dear Karthikeyan,
    Manual deletion is actually the most safe way to delete them. If you try update B1 tables directly, you are against SAP support rule.
    Thanks,
    Gordon

  • Using Crystal Reports 2008 SP3 with the Brother 9500PC, 9700PC, and P9800PC

    We have using Crystal Reports with the Brother Label printers for years until we were forced to use Crystal 2008.  The label printers have worked in the past and we usually create a label template in the printer driver and this configuration is stored in the Crystal Report.  These label printers can use several different size cartridges.  When creating a report using the Editor, the report displays and prints correctly using the template embedded into the report.  This is using the updated SP3.3 service pack.  The problem is in the Run Time application that is embedded in another application to run the reports.  When printing a label from the application, the report previews just fine with the correct size and format.  However, when you try to print the label, the run time driver ignores the template embedded in the report and instead uses the default settings for the printer driver.  So, if I have a 1 inch cartridge in the printer, and the default settings for the printer is a 1 1/2 inch cartridge, then the report will try to print assuming there is a 1 1/2 inch cartridge which will cause the application to fail.  This is a problem with Crystal 2008 (12) and we would like to find a solution to this.  Thanks, Doug

    Hi Cameron, 
    You can setup custom label sizes in Crystal.  In the folder where you installed Crystal Reports is a text file called Labels_en.txt.  This contains the label definition Crystal uses.  You can add a new label in here. 
    Now when you open Crystal and create a new report by selecting the Mailing Label Repotr Wizard, you will see your new label when you get to that step. 
    When save a report, the report will do two things.  If you have set the report to a specific printer, Crystal saves the printer and paper settings inside the RPT.  When the print engine runs the report, if it can't find the printer saved in the report it will default to the default printer. 
    What I believe is happening is the application is loading the report and because it can't find the label printer it was designed with it's going to the default printer.  So you do have to set the PrintReportOptions in your application to redirect the report to the correct printer, driver and papersize. 
    This has pretty much been the way since version 4 that I can remember.  The positive side is you don't have to set all the parameters yourself.  You can get the PrintReportOptions from the report when you open it.  Then you just need to pass the printer name, driver and port.  The rest of the options (papersize) will already be populated from the Get. 
    Good luck,
    Brian

  • How to call the crystal report in jsp page

    dear friends
    i want to run or call the crystal report in jsp page.
    if u know that can u send sample code for that to my id
    [email protected]

    Hi Sudhakar,
    Could you please be more speicific about the task you want to accomplish?
    Cheers
    Giri :-)

  • How run reports JDE from BPEL using the Adapter for JD Edwards OneWorld?

    Hi,
    I need to load on line a lot of invoices from Bpel to JD Edwards using the Adapter for JD Edwards OneWorld (iWay).
    Using Business Functions as Web Services it wasn't a not good idea because of this Adapter is poorly constructed and doesn't allow simultaneous loads, a memory leak occurs on JDE server. And to load them invoice by invoice is very slow.
    A choice is to use Z tables and load them through schedules, but Bpel loses total control.
    I heard that I can run processes reports that enable to extract the data from the Z tables and load them into JDE.
    How can I execute reports JD Edwards invoked from BPEL using the Adapter for JD Edwards OneWorld?
    Thanks
    Francisco

    Hi Dario,
    BizTalk 2013 R2 (JDE LOB Adapter) is not tested against latest release of JDE EnterpriseOne 9.1.
    It only supports with 8.12 and 9.0 version of JDE.
    Refer the discussion here:
    Integrating BizTalk with JDE EnterpriseOne
    Rachit
    Please mark as answer or vote as helpful if my reply does

  • Printing the datas through Crystal Report from Java

    How can I Print the datas through Crystal Report from java?

    How can I Print the datas through Crystal Report from
    java?
    What the hell are "the datas"?
    Jesus, I can understand this is a shrinking planet, Global community, and all that happy horse pucky. Typos or small grammar errors are no big deal, I make them all the time. But when I have to spend more time interpretting the question than figuring out the answer, it drives me crazy.

Maybe you are looking for