Esempio n. 1
0
        private void ALL_Report_Invoice_Sales_Load(object sender, EventArgs e)
        {
            try
            {
                ReportParameterCollection reportParameters = new ReportParameterCollection();

                con.Open();
                SqlCommand cmd = con.CreateCommand();
                SP_Invoice_Parchase_Report m = new SP_Invoice_Parchase_Report();

                cmd.CommandType = CommandType.StoredProcedure;

                cmd.CommandText = "SP_ALL_Report_Invoice_Sales";
                cmd.Parameters.AddWithValue("@From_Invoice_Date", FRM_ALL_Report_Invoice_Sales.fRM_ALL.dateTime_from.Value);
                cmd.Parameters.AddWithValue("@To_Invoice_Date", FRM_ALL_Report_Invoice_Sales.fRM_ALL.dateTime_To.Value);

                SqlDataAdapter da = new SqlDataAdapter(cmd);
                da.Fill(m, m.Tables[0].TableName);

                this.reportViewer1.LocalReport.SetParameters(reportParameters);
                ReportDataSource reportDataSource = new ReportDataSource("Ds_SP_ALL_Report_Invoice_Sales", m.Tables[0]);



                //--------------------------------------------------------------------------------------------------------


                //SP_PictureCompany ms2 = new SP_PictureCompany();
                SP_Invoice_Parchase_Report m2 = new SP_Invoice_Parchase_Report();

                SqlCommand cmd2 = con.CreateCommand();

                cmd2.CommandType = CommandType.StoredProcedure;

                cmd2.CommandText = "SP_PictureCompany";

                SqlDataAdapter da2 = new SqlDataAdapter(cmd2);
                da2.Fill(m2, m2.Tables[0].TableName);

                this.reportViewer1.LocalReport.SetParameters(reportParameters);
                ReportDataSource reportDataSource2 = new ReportDataSource("DS_img", m2.Tables[0]);



                this.reportViewer1.LocalReport.DataSources.Clear();
                this.reportViewer1.LocalReport.DataSources.Add(reportDataSource);
                this.reportViewer1.LocalReport.DataSources.Add(reportDataSource2);
                this.reportViewer1.RefreshReport();
                con.Close();
            }
            catch (Exception)

            {
            }
        }
        private void Report_Item_Now_Load(object sender, EventArgs e)
        {
            try
            {
                ReportParameterCollection reportParameters = new ReportParameterCollection();

                con.Open();
                SqlCommand cmd = con.CreateCommand();
                SP_Invoice_Parchase_Report m = new SP_Invoice_Parchase_Report();

                cmd.CommandType = CommandType.StoredProcedure;

                cmd.CommandText = "SP_Report_Item_No";
                cmd.Parameters.AddWithValue("@R_Sores_No", FRM_Report_Item_Now.fRM_Report_Item_Now.textBox_Store_No.Text);

                SqlDataAdapter da = new SqlDataAdapter(cmd);
                da.Fill(m, m.Tables[0].TableName);

                this.reportViewer1.LocalReport.SetParameters(reportParameters);
                ReportDataSource reportDataSource = new ReportDataSource("DS_SP_Report_Item_No", m.Tables[0]);



                //--------------------------------------------------------------------------------------------------------


                //SP_PictureCompany ms2 = new SP_PictureCompany();
                SP_Invoice_Parchase_Report m2 = new SP_Invoice_Parchase_Report();

                SqlCommand cmd2 = con.CreateCommand();

                cmd2.CommandType = CommandType.StoredProcedure;

                cmd2.CommandText = "SP_PictureCompany";

                SqlDataAdapter da2 = new SqlDataAdapter(cmd2);
                da2.Fill(m2, m2.Tables[0].TableName);

                this.reportViewer1.LocalReport.SetParameters(reportParameters);
                ReportDataSource reportDataSource2 = new ReportDataSource("DS_img", m2.Tables[0]);



                this.reportViewer1.LocalReport.DataSources.Clear();
                this.reportViewer1.LocalReport.DataSources.Add(reportDataSource);
                this.reportViewer1.LocalReport.DataSources.Add(reportDataSource2);
                this.reportViewer1.RefreshReport();
                con.Close();
            }
            catch (Exception ee)

            {
                MessageBox.Show(ee.Message);
            }
        }
        private void Report_Entry_Bond_Load(object sender, EventArgs e)
        {
            try
            {
                ReportParameterCollection reportParameters = new ReportParameterCollection();

                con.Open();
                SqlCommand cmd = con.CreateCommand();
                SP_Invoice_Parchase_Report m = new SP_Invoice_Parchase_Report();
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.CommandText = "SP_Entry_Bond_Report";
                cmd.Parameters.AddWithValue("@Bond_No", FRM_Report_Entry_Bond.fRM_Report.textBox_Bond_No.Text);
                cmd.Parameters.AddWithValue("@Myear", FRM_Report_Entry_Bond.fRM_Report.textBox_Year.Text);

                SqlDataAdapter da = new SqlDataAdapter(cmd);
                da.Fill(m, m.Tables[0].TableName);
                SP_Invoice_Parchase_Report m2 = new SP_Invoice_Parchase_Report();

                SqlCommand cmd2 = con.CreateCommand();

                cmd2.CommandType = CommandType.StoredProcedure;

                cmd2.CommandText = "SP_PictureCompany";

                SqlDataAdapter da2 = new SqlDataAdapter(cmd2);
                da2.Fill(m2, m2.Tables[0].TableName);

                this.reportViewer1.LocalReport.SetParameters(reportParameters);
                ReportDataSource reportDataSource2 = new ReportDataSource("DS_img", m2.Tables[0]);

                this.reportViewer1.LocalReport.SetParameters(reportParameters);
                ReportDataSource reportDataSource = new ReportDataSource("DS_Entry_Bond_Report", m.Tables[0]);

                this.reportViewer1.LocalReport.DataSources.Clear();
                this.reportViewer1.LocalReport.DataSources.Add(reportDataSource);
                this.reportViewer1.LocalReport.DataSources.Add(reportDataSource2);

                this.reportViewer1.RefreshReport();
                con.Close();
            }
            catch (Exception)

            {
            }
        }
        private void Report__Trans_AllStoers_Load(object sender, EventArgs e)
        {
            try
            {
                ReportParameterCollection reportParameters = new ReportParameterCollection();

                con.Open();
                SqlCommand cmd = con.CreateCommand();
                SP_Invoice_Parchase_Report m = new SP_Invoice_Parchase_Report();
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.CommandText = "SP_Report_Trans_ALL_Stores";
                cmd.Parameters.AddWithValue("@Flag", FRM_Report_Trans_Stores.Flag.ToString());
                storeno = FRM_Report_Trans_Stores.fRM_Report_Trans_Stores.textBox_Store_No.Text;
                if (storeno == "")
                {
                    storeno = "1";
                }

                cmd.Parameters.AddWithValue("@StoreNo", storeno);
                cmd.Parameters.AddWithValue("@From_Odate", FRM_Report_Trans_Stores.fRM_Report_Trans_Stores.dateTime_from.Value);
                cmd.Parameters.AddWithValue("@To_Odate", FRM_Report_Trans_Stores.fRM_Report_Trans_Stores.dateTime_To.Value);

                SqlDataAdapter da = new SqlDataAdapter(cmd);
                da.Fill(m, m.Tables[0].TableName);

                reportParameters.Add(new ReportParameter("From_Date", FRM_Report_Trans_Stores.fRM_Report_Trans_Stores.dateTime_from.Value.ToShortDateString()));
                reportParameters.Add(new ReportParameter("To_Date", FRM_Report_Trans_Stores.fRM_Report_Trans_Stores.dateTime_To.Value.ToShortDateString()));

                this.reportViewer1.LocalReport.SetParameters(reportParameters);
                ReportDataSource reportDataSource = new ReportDataSource("DS_Report_Trans_ALL_Stores", m.Tables[0]);


                //--------------------------------------------------------------------------------------------------------


                //SP_PictureCompany ms2 = new SP_PictureCompany();
                SP_Invoice_Parchase_Report m2 = new SP_Invoice_Parchase_Report();

                SqlCommand cmd2 = con.CreateCommand();

                cmd2.CommandType = CommandType.StoredProcedure;

                cmd2.CommandText = "SP_PictureCompany";

                SqlDataAdapter da2 = new SqlDataAdapter(cmd2);
                da2.Fill(m2, m2.Tables[0].TableName);

                this.reportViewer1.LocalReport.SetParameters(reportParameters);
                ReportDataSource reportDataSource2 = new ReportDataSource("DS_img", m2.Tables[0]);



                this.reportViewer1.LocalReport.DataSources.Clear();
                this.reportViewer1.LocalReport.DataSources.Add(reportDataSource);
                this.reportViewer1.LocalReport.DataSources.Add(reportDataSource2);

                this.reportViewer1.RefreshReport();
                con.Close();
            }
            catch (Exception ex)

            {
                MessageBox.Show(ex.Message);
            }
        }