private DataDynamics.ActiveReports.SubReport GetSubReport() { DataDynamics.ActiveReports.SubReport subrep = new DataDynamics.ActiveReports.SubReport(); subrep.Name = string.Format("Subreport{0}", _NextSubReportNumber); subrep.Height = 0.1F; subrep.Left = 0F; subrep.Width = 6.8F; subrep.Top = 2 * _NextSubReportNumber * 0.1F; _NextSubReportNumber++; this.detail.Controls.Add(subrep); return(subrep); }
private void rptConfigTypes_ReportStart(object sender, EventArgs e) { if (!_IsFirst) { AddPageBreak(); } DataTable dt = VWA4Common.DB.Retrieve("SELECT * FROM " + _ReportType + "Category WHERE ParentCatID = 0 ORDER BY Rank, CatName"); int i = 0; if (_ReportType == "User") { lblTypeCatalog.Text = "Team Member Types (" + ((_TypeCatalogID == "" || _TypeCatalogID == "0") ? "Master" : _TypeCatalogName) + ")"; } else if (_ReportType == "BEO") { lblTypeCatalog.Text = "Event Order Types (" + ((_TypeCatalogID == "" || _TypeCatalogID == "0") ? "Master" : _TypeCatalogName) + ")"; } else { lblTypeCatalog.Text = _ReportType + " Types (" + ((_TypeCatalogID == "" || _TypeCatalogID == "0") ? "Master" : _TypeCatalogName) + ")"; } if (dt != null && dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { DataDynamics.ActiveReports.SubReport subrep = new DataDynamics.ActiveReports.SubReport(); subrep.Name = string.Format("Subreport{0}", i); subrep.Height = 0F; subrep.Left = 0F; subrep.Width = 7F; subrep.Top = 2 * i * 0.00001F; subrep.Report = new rptConfigSubTypes(_InputParameters, _ReportType, row["CatID"].ToString(), row["CatName"].ToString(), _TypeCatalogID); this.detail.Controls.Add(subrep); i++; } } this.Document.Printer.Landscape = false; this.PrintWidth = this.PageSettings.PaperWidth - (this.PageSettings.Margins.Left + this.PageSettings.Margins.Right); }
private void rptConfigSubTypes_ReportStart(object sender, EventArgs e) { string sql, typeFields = "", join = ""; switch (_ReportType) { case "Food": typeFields = ", VolumeWeight, VolumeUnits, VolumeUnitType"; if (_TypeCatalogID != "" && _TypeCatalogID != "0") { typeFields += ", FoodCost AS Cost"; } txtCostLabel.Text = "Cost:"; txtVolumeWeight.Text = "Volume Weight:"; txtCost.DataField = "Cost"; txtEnabledLabel.Text = "Enabled:"; txtEnabled.DataField = "Enabled"; break; case "Loss": typeFields = ", OverproductionFlag, TrimWasteFlag, HandlingFlag"; txtCostLabel.Text = "Flags:"; txtVolumeWeight.Text = "Enabled:"; txtCost.OutputFormat = ""; txtWeight.DataField = "Enabled"; txtWeight.OutputFormat = ""; txtEnabledLabel.Visible = false; txtEnabled.Visible = false; txtMaleRatioLabel.Visible = false; txtMaleRatio.Visible = false; break; case "Container": typeFields = ", Volume, VolumeUnitType"; if (_TypeCatalogID != "" && _TypeCatalogID != "0") { typeFields += ", ContainerTareWeight AS TareWeight, ContainerCost AS Cost"; } else { typeFields += ", TareWeight, Cost"; } txtCostLabel.Text = "Tare Weight:"; txtCost.DataField = "TareWeight"; txtCost.OutputFormat = "#0.00 lb"; txtVolumeWeight.Text = "Volume:"; //txtWeight.DataField = "ClientName"; //txtWeight.OutputFormat = ""; txtEventDateLabel.Text = "Cost: "; txtEventDate.DataField = "Cost"; txtEventDate.OutputFormat = "$#,##0.00"; txtEnabledLabel.Text = "Enabled:"; txtEnabled.DataField = "Enabled"; break; case "BEO": typeFields = ", EventDate, GuestCount, MRatio, ClientName, BEONumber"; txtCostLabel.Text = "Event Order #:"; txtCost.DataField = "BEONumber"; txtCost.OutputFormat = "#0"; txtVolumeWeight.Text = "Client:"; txtWeight.DataField = "ClientName"; txtWeight.OutputFormat = ""; txtEventDateLabel.Text = "Event Date: "; txtGuestCountLabel.Text = "Guest Count: "; txtMaleRatioLabel.Text = "M/F Ratio: "; txtEnabledLabel.Text = "Enabled:"; txtEnabled.DataField = "Enabled"; join = " LEFT JOIN EventClients ON BEOType.Client = EventClients.ID "; break; case "User": case "Station": case "Disposition": case "Daypart": typeFields = ""; txtCostLabel.Text = "Enabled:"; txtCost.DataField = "Enabled"; txtCost.OutputFormat = ""; txtVolumeWeight.Visible = false; txtWeight.Visible = false; txtGuestCountLabel.Visible = false; txtGuestCount.Visible = false; txtEnabledLabel.Visible = false; txtEnabled.Visible = false; txtMaleRatioLabel.Visible = false; txtMaleRatio.Visible = false; break; default: MessageBox.Show("Report Type was not recognized"); return; } if (_TypeCatalogID == "" || _TypeCatalogID == "0") { sql = "SELECT * FROM " + _ReportType + "Type " + join + " WHERE CatID = " + _CatID + " ORDER BY Rank, TypeName"; } else { sql = "SELECT " + _ReportType + "SubTypes.Enabled, " + _ReportType + "SubTypes.TypeID, " + " TypeName, ReportTypeName, SpanishTypeName, ModifiedDate" + typeFields + " FROM (" + _ReportType + "SubTypes INNER JOIN " + _ReportType + "Type ON " + _ReportType + "Type.TypeID = " + _ReportType + "SubTypes.TypeID) " + join + " WHERE CatID = " + _CatID + " AND TypeCatalogID = " + _TypeCatalogID + " ORDER BY Rank, TypeName"; } DataTable dt = VWA4Common.DB.Retrieve(sql); txtMenu.Text = "(" + _CatName + ")"; this.DataSource = dt; DataTable subCat = VWA4Common.DB.Retrieve("SELECT * FROM " + _ReportType + "Category WHERE ParentCatID = " + _CatID + " ORDER BY Rank, CatName"); int i = 0; if (subCat != null) { foreach (DataRow row in subCat.Rows) { DataDynamics.ActiveReports.SubReport subrep = new DataDynamics.ActiveReports.SubReport(); subrep.Name = string.Format("Subreport{0}", i); subrep.Height = 0.1F; subrep.Left = 0F; subrep.Width = 7F; subrep.Top = 2 * i * 0.1F; subrep.Report = new rptConfigSubTypes(_InputParameters, _ReportType, row["CatID"].ToString(), _CatName + "\\" + row["CatName"].ToString(), _TypeCatalogID); this.groupFooter1.Controls.Add(subrep); i++; } } this.Document.Printer.Landscape = false; this.PrintWidth = this.PageSettings.PaperWidth - (this.PageSettings.Margins.Left + this.PageSettings.Margins.Right); }