Wednesday, August 4, 2010

Crystal Report in

To create crystal report in follow below steps
1. take a crystal report viewer on page (i have given name "crv" to it)
then write below code in code behind file.

using CrystalDecisions.Shared;
using CrystalDecisions.CrystalReports.Engine;

private void showreport()
ReportDocument report = new ReportDocument();
crv.ReportSource = report; //crv is your Crystal report viewer's name.

private void SetTableLocation(Tables tables)
ConnectionInfo connectionInfo = new ConnectionInfo();

connectionInfo.ServerName = @"DBSERVER2\SQL2005";
connectionInfo.DatabaseName = "dbMEAVer5web";
connectionInfo.UserID = "sa";
connectionInfo.Password = "admin55";

foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables)
TableLogOnInfo tableLogOnInfo = table.LogOnInfo;
tableLogOnInfo.ConnectionInfo = connectionInfo;

Solution by: Rajesh Rolen

Share This!

No comments:

Powered By Blogger · Designed By Seo Blogger Templates