Print Page | Close Window

Crystal report with ODBC Connectivity

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=21705
Printed Date: 24 Apr 2024 at 7:11pm


Topic: Crystal report with ODBC Connectivity
Posted By: Maheshwari
Subject: Crystal report with ODBC Connectivity
Date Posted: 28 Sep 2015 at 7:32pm
HI,

I have connected the crystal report with the Sqlserver Odbc Connectivity,In java application having jdbc connectivity ,It is connecting to the crystal report,but not connecting to the database.

byteArrayInputStream = (ByteArrayInputStream) reportClientDocument.getPrintOutputController().export(ReportExportFormat.PDF);
     response.setHeader("Content-disposition", "inline;filename="+reportName+".pdf");
     response.setContentType("application/pdf");



Replies:
Posted By: Maheshwari
Date Posted: 29 Sep 2015 at 1:54am
Hi,
I got the result for the above problem,crystal report is connected with sqlserver(Odbc),java application is using jdbc connectivity.throwing Error finding JNDI name .below code resolve the issue.

web.xml
<resource-ref>
    <description>Resource reference to a factory for
    java.sql.Connection</description>
    <res-ref-name>jdbc/jdb</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
</resource-ref>

context.xml

Resource name="jdbc/jdb" auth="Container" type="javax.sql.DataSource"
                   maxActive="100" maxIdle="30" maxWait="10000"
                   username="dd" password="dd" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
               url="jdbc:sqlserver://000.000.0.01:1233;databaseName=xxx"/>

Regards,



Print Page | Close Window