Facing problem using crystal report in VS 2005
Hi,
I am working on Visual Studio 2005 using C#
I am creating report using inbuilt crystal report services
I am using crystal report viewer on my aspx page
When ever I run the page first time my report shows good results
As soon as i click on the export button or pagination button or zoom drop down from the crystal report viewer control
My page refreshes and nothings works properly.
If I change the zoom then it works for the first time, then it does not change and pagination comes in the way
1/ 1+
and if I click export and print option than the page refreshes and it is not working properly
Below is my code for cs and aspx code
My code behind code
protected void Page_Load(object sender, EventArgs e)
{
CrystalReportViewer1.DataBind();
Page.Title = "Student Progress Report";
// Button2.Attributes.Add("Onclick", "pickDate('txtFromDate')");
GenerateReport();
//CrystalReportViewer1.Visible = false;
}
protected void GenerateReport()
{
string strreportPath = ConfigurationManager.AppSettings["reportPath"].ToString();
string strDatabaseUsernameForReports = ConfigurationManager.AppSettings["DatabaseUsernameForReports"].ToString();
string strDatabasePasswordForReports = ConfigurationManager.AppSettings["DatabasePasswordForReports"].ToString();
string strDatabaseServernameForReports = ConfigurationManager.AppSettings["DatabaseServernameForReports"].ToString();
string strDatabasenameForReports = ConfigurationManager.AppSettings["DatabasenameForReports"].ToString();
ReportDocument report = new ReportDocument();
report.Load(@"" + strreportPath + "ImageReport.rpt");
report.SetDatabaseLogon(strDatabaseUsernameForRepo rts, strDatabasePasswordForReports, strDatabaseServernameForReports, strDatabasenameForReports);
report.SetParameterValue("@username", "Dinesh Bali");
CrystalReportViewer1.ReportSource = report;
CrystalReportViewer1.Visible = true;
}
below is my aspx page the code is
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true" />
Please help me at the earliest
|