is webform in that form there is button when click on button then want to report on another form for this i create this
Webform
- protected void Report_Click(object sender, EventArgs e)
- {
- report_class r = new report_class();
- data crystalReport = new data();
- r.BindReport(crystalReport,Convert.ToDateTime(fromdate.Value), Convert.ToDateTime(todate.Value), regiondrop.SelectedValue);
- Response.Redirect("Reports.aspx");
-
-
- }
then i create another class report_class
- public void BindReport(data crystalReport, DateTime fromdate, DateTime todate, string region)
- {
- T1 t = new T1();
- List<griddataresult_Result> dsc = t.griddataresult(fromdate, todate, region).ToList();
- DataTable dt = new DataTable();
- dt.Columns.Add("ID", typeof(int));
- dt.Columns.Add("Owner", typeof(string));
- foreach (var c in dsc)
- {
-
- dt.Rows.Add(c.ID, c.Owner);
- }
-
- crystalReport.DataDefinition.FormulaFields["region"].Text = "'" + region + "'";
- crystalReport.DataDefinition.FormulaFields["fromdate"].Text = "'" + fromdate + "'";
- crystalReport.DataDefinition.FormulaFields["todate"].Text = "'" + todate + "'";
- crystalReport.SetDataSource(dt);
-
- }
then i report.aspx i drag crystalreportviewer and i wirte this code
- protected void Page_Load(object sender, EventArgs e)
- {
- report_class r = new report_class();
- data crystalReport = new data();
- crystalReport.Load("data.rpt");
-
- ConnectionInfo crConnectionInfo = new ConnectionInfo();
- crConnectionInfo.ServerName = "xx";
- crConnectionInfo.DatabaseName = "xx";
- crConnectionInfo.UserID = "xx";
- crConnectionInfo.Password = "xx";
- TableLogOnInfo crTableLogoninfo = new TableLogOnInfo();
-
- foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in crystalReport.Database.Tables)
- {
- crTableLogoninfo = CrTable.LogOnInfo;
- crTableLogoninfo.ConnectionInfo = crConnectionInfo;
- CrTable.ApplyLogOnInfo(crTableLogoninfo);
- }
-
-
- CrystalReportViewer1.ReportSource = crystalReport;
- CrystalReportViewer1.ToolPanelView = CrystalDecisions.Web.ToolPanelViewType.None;
- CrystalReportViewer1.DataBind();
-
-
-
-
- }
and
- <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="True" Height="1202px" ReportSourceID="CrystalReportSource1" ToolPanelWidth="200px" Width="1104px" ToolPanelView="None" />
-
- <CR:CrystalReportSource ID="CrystalReportSource1" runat="server">
- <Report FileName="data.rpt">
- </Report>
- </CR:CrystalReportSource>
So when i click on button then Reports.aspx page there is pop up appear with fields Servername,databasename,username,password so by default DataSet1 is already written in servername field , databasename field is disabled and then i write correct username and password in last 2 field when i hit enter then again pop up appear
and always appear this pop up
First there so i dont need this pop up and how to solve this ?