Hi every one i am facing problem when i publish my project i am firstly bind the rpt through dsn and load it through c# code here is my code please help me if any one have answer of it thanks in advance dear
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<%@ Register assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" namespace="CrystalDecisions.Web" tagprefix="CR" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server"
AutoDataBind="true" EnableDatabaseLogonPrompt="False"
EnableParameterPrompt="False" />
</div>
</form>
</body>
</html>
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using CrystalDecisions.CrystalReports.Engine;
public partial class Default2 : System.Web.UI.Page
{
string Path;
protected void Page_Load(object sender, EventArgs e)
{
try
{
ReportDocument rep = new ReportDocument();
Path = Server.MapPath("CrystalReport.rpt");
rep.Load(Path);
this.CrystalReportViewer1.ReportSource = rep;
this.CrystalReportViewer1.DataBind();
}
catch
{
Response.Buffer = false;
Response.ClearContent();
}
}
protected void Page_UnLoad(object sender, EventArgs e)
{
this.CrystalReportViewer1.Dispose();
GC.Collect();
}
}