|
Hi
I have a crystal report 2008 in a asp.net 3.5 web page.
The report loads and work ok.
The problem is that every time you change page it is reloading the report then displaying the page.
So if a report takes a minute to load initially then every time you change page it will take a minute.
I am using an SQL Server 2005
When i run the report in Crystal Reports 2008 Designer paging is very fast.
When i run it in my asp.net 3.5 C# page then paging is slow.
Crystal report verion: CrystalDecisions.Web, Version=12.0.2000.0
Please find below my code.
Thank You for your help
page.aspx.cs
public ReportDocument MyReportObject = new ReportDocument();
string strTitle;
string strMenu;
string strDatabase;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
//Connect to database
var crConnectionInfo = new ConnectionInfo();
SqlConnectionStringBuilder csb = new SqlConnectionStringBuilder(ConfigurationManager.ConnectionStrings\"TheConnection\".ConnectionString);
{
crConnectionInfo.ServerName = csb.DataSource;
crConnectionInfo.DatabaseName = csb.InitialCatalog;
crConnectionInfo.UserID = csb.UserID;
crConnectionInfo.Password = csb.Password;
}
TableLogOnInfos mytableloginfos = new TableLogOnInfos();
mytableloginfos = CrystalReportViewerMain.LogOnInfo;
foreach (TableLogOnInfo myTableLogOnInfo in mytableloginfos)
{
myTableLogOnInfo.ConnectionInfo = crConnectionInfo;
}
}
}
protected void CrystalReportViewerMain_Unload(object sender, EventArgs e)
{
MyReportObject.Clone();
MyReportObject.Dispose();
}
protected void CrystalReportViewerMain_OnInit(object sender, EventArgs e)
{
MyReportObject.Load(Server.MapPath("TheReport"));
CrystalReportViewerMain.ReportSource = MyReportObject;
CrystalReportViewerMain.HasCrystalLogo = false;
//CrystalReportViewerMain.HasToggleGroupTreeButton = false;
CrystalReportViewerMain.DisplayGroupTree = false;
CrystalReportViewerMain.HasRefreshButton = true;
}
Please advise.
Thank you for your help
|