Crystal Reports with Teradata
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


Crystal Reports with Teradata Expand / Collapse
Author
Message
Posted 6/24/2008 2:30:25 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 7/7/2008 2:17:32 AM
Posts: 24, Visits: 90
I have a set of reports developed in Crystal Reports with SQL SERVER as Database. Now i need to port these reports on Teradata. I am facing following problems.
1: I have a piece of code which sets Database information in Report Document like DatabaseName, UserName, Password. This code works fine when SQL Server is used as a Database. But when i changed database to Teradata, the same code failed to generate a Report.
2: My reports are developed using OLE DB connection object for SQL SERVER. Reports have a reference to Columns from Database tables.
3: When i tried to Create a new OLE DB connection object, re-configured the selected columns and generated a new Report it started working.
4: If i create a Stored Procedure and use the stored procedure columns in Report file instead of direct reference to columns of database table, then report is generated.
e.g: I have a user details report which displays a list of Users configured in my application. This report file has columns directly selected from database tables. Now if i write a Stored Procedure which returns me the same result and then use this result to map to a report file, then it works fine.

Code snippet for Setting Database credentials:
//rptDoc is an object of Report Document
// crConnectionInfo has all the details like DBName,UserName,Password.
crSections = rptDoc.ReportDefinition.Sections;
foreach (Section crSection in crSections)
{
crReportObjects = crSection.ReportObjects;
foreach (ReportObject crReportObject in crReportObjects)
{

if (crReportObject.Kind == ReportObjectKind.SubreportObject)
{
crSubreportObject = (SubreportObject)crReportObject;
//open the subreport object and logon as for the general report
crSubreportDocument = crSubreportObject.OpenSubreport(crSubreportObject.SubreportName);
crDatabase = crSubreportdocument.Database;
crTables = crDatabase.Tables;
for (int j = 0; j < crTables.Count; j++)
{
crTable = crTables[j];
crTableLogOnInfo = crTable.LogOnInfo;
crTableLogOnInfo.ConnectionInfo = crConnectionInfo;
crTable.ApplyLogOnInfo(crTableLogOnInfo);
}
}
}
}
crDatabase = rptDoc.Database;
crTables = crDatabase.Tables;
for (int j = 0; j < crTables.Count; j++)
{
crTable = crTables[j];
crTableLogOnInfo = crTable.LogOnInfo;
crTableLogOnInfo.ConnectionInfo = crConnectionInfo;
crTable.ApplyLogOnInfo(crTableLogOnInfo);
}

All the suggestions will be appreciated.



Satish Gaikwad
Post #11950
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 2:19pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.078. 9 queries. Compression Disabled.