calling crystal report

  • Thread starter Thread starter Hrvoje Voda
  • Start date Start date
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using CrystalDecisions.ReportSource;
using CrystalDecisions.Reporting.WebControls;


public class ParamterForm : System.Web.UI.Page
{

protected CrystalDecisions.Web.CrystalReportViewer CRViewer;

private Tables crTables;

private CrystalDecisions.CrystalReports.Engine.Table crTable;

private TableLogOnInfo crTableLogOnInfo;

ReportClass crReportDocument;

private ConnectionInfo crConnectionInfo = new crReportDocument= new
CrystalReport1();


databaseServer = "Test";
databaseName = "Test";
databaseUser = "Test";
UserPassword = "Test";

crConnectionInfo.ServerName = databaseServer;
crConnectionInfo.DatabaseName = databaseName;
crConnectionInfo.UserID = databaseUser;
crConnectionInfo.Password = UserPassword;

crTables = crReportDocument.Database.Tables;

for (int i = 0; i < crTables.Count; i++)
{
crTable = crTables ;
crTableLogOnInfo = crTable.LogOnInfo;
crTableLogOnInfo.ConnectionInfo = crConnectionInfo;
crTable.ApplyLogOnInfo(crTableLogOnInfo);
//Response.Write( crTable.Location +"<BR>" );
crTable.Location =
crTable.Location.Substring(crTable.Location.LastIndexOf (".") + 1) ;
//Response.Write( crTable.Location +"<BR>");
//Response.Write(
crTable.Location.Substring(crTable.Location.LastIndexOf (".") + 1)
+"<BR>");
}
CRViewer.ReportSource = crReportDocument;




Regards,

Ayaz Ahmed
Project Manager
Creative Chaos (Pvt.) Ltd.
"Managing Your Digital Risk"
http://www.csquareonline.com
Mobile +92 300 2280950
Office +92 21 455 2414
Email: (e-mail address removed)
(e-mail address removed)
 
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using CrystalDecisions.ReportSource;
using CrystalDecisions.Reporting.WebControls;


public class ParamterForm : System.Web.UI.Page
{

protected CrystalDecisions.Web.CrystalReportViewer CRViewer;

private Tables crTables;

private CrystalDecisions.CrystalReports.Engine.Table crTable;

private TableLogOnInfo crTableLogOnInfo;

ReportClass crReportDocument;

private ConnectionInfo crConnectionInfo = new crReportDocument= new
CrystalReport1();


databaseServer = "Test";
databaseName = "Test";
databaseUser = "Test";
UserPassword = "Test";

crConnectionInfo.ServerName = databaseServer;
crConnectionInfo.DatabaseName = databaseName;
crConnectionInfo.UserID = databaseUser;
crConnectionInfo.Password = UserPassword;

crTables = crReportDocument.Database.Tables;

for (int i = 0; i < crTables.Count; i++)
{
crTable = crTables ;
crTableLogOnInfo = crTable.LogOnInfo;
crTableLogOnInfo.ConnectionInfo = crConnectionInfo;
crTable.ApplyLogOnInfo(crTableLogOnInfo);
//Response.Write( crTable.Location +"<BR>" );
crTable.Location =
crTable.Location.Substring(crTable.Location.LastIndexOf (".") + 1) ;
//Response.Write( crTable.Location +"<BR>");
//Response.Write(
crTable.Location.Substring(crTable.Location.LastIndexOf (".") + 1)
+"<BR>");
}
CRViewer.ReportSource = crReportDocument;




Regards,

Ayaz Ahmed
Project Manager
Creative Chaos (Pvt.) Ltd.
"Managing Your Digital Risk"
http://www.csquareonline.com
Mobile +92 300 2280950
Office +92 21 455 2414
Email: (e-mail address removed)
(e-mail address removed)
 
Back
Top