Beispiel #1
0
        private void SetDataSourceProducts(ReportDocument Report)
        {
            ReportDataset rptds = new ReportDataset();
            string ProductGroupName = string.Empty;
            if (cboGroup.SelectedItem.Value != Constants.ZERO_STRING) ProductGroupName = cboGroup.SelectedItem.Text;
            string SubGroupName = string.Empty;
            if (cboSubGroup.SelectedItem.Value != Constants.ZERO_STRING) SubGroupName = cboSubGroup.SelectedItem.Text;

            Products clsProduct = new Products();
            System.Data.DataTable dtProductInventoryReport = clsProduct.InventoryReport(ProductGroupName, SubGroupName, txtProductCodeSearch.Text);

            //ProductVariationsMatrix clsMatrix = new ProductVariationsMatrix(clsProduct.Connection, clsProduct.Transaction);
            //System.Data.DataTable dtMatrixInventoryReport = clsMatrix.InventoryReport(ProductGroupName, SubGroupName, txtProductCodeSearch.Text);
            clsProduct.CommitAndDispose();

            foreach (System.Data.DataRow dr in dtProductInventoryReport.Rows)
            {
                DataRow drNew = rptds.Products.NewRow();

                foreach (DataColumn dc in rptds.Products.Columns)
                    drNew[dc] = dr[dc.ColumnName];

                rptds.Products.Rows.Add(drNew);
            }

            Report.SetDataSource(rptds);

        }