Exemple #1
0
        private void villageWiseAnshWithoutAadeshAndTippadiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (cmbSelectDistrict.Text != "" && cmbSelectTehsil.Text != "" && cmbSelectGram.Text != "")
            {
                SqlConnection conn = new SqlConnection("Data Source=DESKTOP-DU76VKH\\SQLEXPRESS1;Initial Catalog=Rayedox_UPBhulekh_Agent;Integrated Security=True");
                SqlCommand    cmd;
                if (cmbCategory.Text.Trim() == "")
                {
                    cmd = new SqlCommand("select * from AnshAgentScrappedData where District_Name=N'" + DistrictName + "' and Tehsil_Name=N'" + TehsilName + "' and Gram_Name=N'" + VillageName + "'", conn);
                }
                else
                {
                    cmd = new SqlCommand("select * from AnshAgentScrappedData where District_Name=N'" + DistrictName + "' and Tehsil_Name=N'" + TehsilName + "' and Gram_Name=N'" + VillageName + "' and Category=N'" + cmbCategory.Text + "'", conn);
                }
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                DataSet1       ds = new DataSet1();
                da.Fill(ds.dsAnshAgentScrappedData);
                cmd.Dispose();
                da.Dispose();

                rptCustomVillageWiseAnshDetailsWithoutAadeshAndTippadi rpt = new rptCustomVillageWiseAnshDetailsWithoutAadeshAndTippadi();
                rpt.SetDataSource(ds);
                this.Invoke(new MethodInvoker(delegate()
                {
                    crystalReportViewer1.ReportSource = rpt;
                    crystalReportViewer1.RefreshReport();
                }));
            }
            else
            {
                MessageBox.Show("Please select District Name, Tehsil Name and Gram Name");
            }
        }
Exemple #2
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            rptCustomVillageWiseAnshDetailsWithoutAadeshAndTippadi rpt = new rptCustomVillageWiseAnshDetailsWithoutAadeshAndTippadi();

            rpt.Site = this.Site;
            return(rpt);
        }