public static void Generate(Telerik.ReportViewer.Html5.WebForms.ReportViewer rv, IEnumerable<object> data, string extension, SortDescriptorCollection sortDescriptors, GroupDescriptorCollection grpDescriptors) { Telerik.Reporting.Report report1 = new Telerik.Reporting.Report(); report1.DataSource = data; string sortCol = ""; string sortDir = ""; //multi sort can be done by iterating through collection like for group if (sortDescriptors.Count > 0) { ColumnSortDescriptor sd = sortDescriptors[0] as ColumnSortDescriptor; sortCol = sd.Column.UniqueName; sortDir = sd.SortDirection.ToString(); } //Page Header Section Telerik.Reporting.PageHeaderSection pageHeaderSection1 = new Telerik.Reporting.PageHeaderSection(); pageHeaderSection1.Height = new Telerik.Reporting.Drawing.Unit(0.3, Telerik.Reporting.Drawing.UnitType.Inch); pageHeaderSection1.Style.BackgroundColor = Color.Gray; Telerik.Reporting.TextBox txtHead = new Telerik.Reporting.TextBox(); txtHead.Value = "Title"; txtHead.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(3.2395832538604736D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.02083333395421505D, Telerik.Reporting.Drawing.UnitType.Inch)); txtHead.Name = "reportTitle"; txtHead.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(5.5603775978088379D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.20000000298023224D, Telerik.Reporting.Drawing.UnitType.Inch)); pageHeaderSection1.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { txtHead }); IEnumerator dataColl = data.GetEnumerator(); int count = 0; int first = 0; object obj = null; while (dataColl.MoveNext()) { if (first == 0) { obj = dataColl.Current; foreach (PropertyInfo info in obj.GetType().GetProperties()) { count++; } first++; } } Telerik.Reporting.Drawing.Unit x = Telerik.Reporting.Drawing.Unit.Inch(0); Telerik.Reporting.Drawing.Unit y = Telerik.Reporting.Drawing.Unit.Inch(0); Telerik.Reporting.ReportItemBase[] headColumnList = new Telerik.Reporting.ReportItem[count]; Telerik.Reporting.ReportItemBase[] detailColumnList = new Telerik.Reporting.ReportItem[count]; Telerik.Reporting.Group group = new Telerik.Reporting.Group(); SizeU size = new SizeU(Telerik.Reporting.Drawing.Unit.Inch((double)(22) / count), Telerik.Reporting.Drawing.Unit.Inch(0.6)); int column = 0; foreach (PropertyInfo info in obj.GetType().GetProperties()) { string columnName = info.Name; Telerik.Reporting.HtmlTextBox headerCol = CreateTxtHeader(columnName, column); headerCol.Style.BackgroundColor = Color.LemonChiffon; headerCol.Style.BorderStyle.Default = BorderType.Solid; headerCol.Style.BorderWidth.Default = Unit.Pixel(1); headerCol.CanGrow = true; headerCol.Location = new Telerik.Reporting.Drawing.PointU(x, y); headerCol.Size = size; headColumnList[column] = headerCol; Telerik.Reporting.TextBox textBox = CreateTxtDetail(columnName, column); textBox.Style.BorderStyle.Default = BorderType.Solid; textBox.Style.BorderWidth.Default = Unit.Pixel(1); textBox.CanGrow = true; textBox.Location = new Telerik.Reporting.Drawing.PointU(x, y); textBox.Size = size; detailColumnList[column] = textBox; textBox.ItemDataBinding += new EventHandler(textBox_ItemDataBound); x += Telerik.Reporting.Drawing.Unit.Inch(headerCol.Size.Width.Value); column++; } Telerik.Reporting.ReportItemBase[] groupColumnList = new Telerik.Reporting.ReportItem[grpDescriptors.Count]; int i = grpDescriptors.Count; if (grpDescriptors.Count > 0) { Telerik.Reporting.GroupHeaderSection groupHeaderSection1 = new Telerik.Reporting.GroupHeaderSection(); foreach (ColumnGroupDescriptor grpDescriptor in grpDescriptors) { string grpCol = grpDescriptor.Column.UniqueName; group.Groupings.Add(new Grouping("=Fields." + grpCol)); if (grpDescriptor.SortDirection.ToString().ToLower() == "descending") { group.Sortings.Add(new Sorting("=Fields." + grpCol, SortDirection.Desc)); } else { group.Sortings.Add(new Sorting("=Fields." + grpCol, SortDirection.Asc)); } i--; Telerik.Reporting.TextBox hdCol = new Telerik.Reporting.TextBox(); hdCol.Style.BackgroundColor = Color.Orange; hdCol.Style.BorderStyle.Default = BorderType.Solid; hdCol.Style.BorderWidth.Default = Unit.Pixel(1); hdCol.KeepTogether = true; hdCol.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(5.5603775978088379D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.20000000298023224D, Telerik.Reporting.Drawing.UnitType.Inch)); hdCol.Value = "=[" + grpCol + "]"; groupColumnList[i] = hdCol; group.GroupHeader = groupHeaderSection1; //to avoid extra row after group col group.GroupHeader.Height = Telerik.Reporting.Drawing.Unit.Inch(0); } groupHeaderSection1.Items.AddRange(groupColumnList); } if (sortCol.Length > 0) { group.Groupings.Add(new Grouping("=Fields." + sortCol)); if (sortDir.ToLower() == "descending") { group.Sortings.Add(new Sorting("=Fields." + sortCol, SortDirection.Desc)); } else { group.Sortings.Add(new Sorting("=Fields." + sortCol, SortDirection.Asc)); } } ReportHeaderSection reportHeaderSection1 = new Telerik.Reporting.ReportHeaderSection(); reportHeaderSection1.Height = new Telerik.Reporting.Drawing.Unit(0.3, Telerik.Reporting.Drawing.UnitType.Inch); reportHeaderSection1.Items.AddRange(headColumnList); report1.Groups.Add(group); //Detail Section Telerik.Reporting.DetailSection detailSection1 = new Telerik.Reporting.DetailSection(); detailSection1.Height = new Telerik.Reporting.Drawing.Unit(0.3, Telerik.Reporting.Drawing.UnitType.Inch); detailSection1.Items.AddRange(detailColumnList); //Page Footer Section Telerik.Reporting.PageFooterSection pageFooterSection1 = new Telerik.Reporting.PageFooterSection(); pageFooterSection1.Height = new Telerik.Reporting.Drawing.Unit(0.3, Telerik.Reporting.Drawing.UnitType.Inch); pageFooterSection1.Style.BackgroundColor = Color.LightGray; pageFooterSection1.PrintOnFirstPage = true; pageFooterSection1.PrintOnLastPage = true; Telerik.Reporting.TextBox txtFooter = new Telerik.Reporting.TextBox(); txtFooter.Value = "='Page ' + PageNumber + ' of ' + PageCount"; txtFooter.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(4.2395832538604736D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.02083333395421505D, Telerik.Reporting.Drawing.UnitType.Inch)); txtFooter.Name = "pageInfoTextBox"; txtFooter.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(5.5603775978088379D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.20000000298023224D, Telerik.Reporting.Drawing.UnitType.Inch)); Telerik.Reporting.PictureBox picBoxFooter = new Telerik.Reporting.PictureBox(); picBoxFooter.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(5.2395832538604736D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.02083333395421505D, Telerik.Reporting.Drawing.UnitType.Inch)); picBoxFooter.Value = @"C:\CCMSGoldStandard_Local\CCMSGoldStandard\CCMSAppShell\Images\no.png"; picBoxFooter.Style.TextAlign = Telerik.Reporting.Drawing. HorizontalAlign.Center; picBoxFooter.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1, ((Telerik.Reporting.Drawing.UnitType)(Telerik.Reporting.Drawing.UnitType.Inch))), new Telerik.Reporting.Drawing.Unit(.5D, ((Telerik.Reporting.Drawing.UnitType)(Telerik.Reporting.Drawing.UnitType.Inch)))); picBoxFooter.Sizing = ImageSizeMode.AutoSize; pageFooterSection1.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { txtFooter, picBoxFooter }); //add all section to report report1.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { pageHeaderSection1, reportHeaderSection1, detailSection1, pageFooterSection1 }); report1.PageSettings.Landscape = false; report1.PageSettings.Margins.Bottom = new Telerik.Reporting.Drawing.Unit(1D, Telerik.Reporting.Drawing.UnitType.Inch); report1.PageSettings.Margins.Left = new Telerik.Reporting.Drawing.Unit(.25, Telerik.Reporting.Drawing.UnitType.Inch); report1.PageSettings.Margins.Right = new Telerik.Reporting.Drawing.Unit(.25, Telerik.Reporting.Drawing.UnitType.Inch); report1.PageSettings.Margins.Top = new Telerik.Reporting.Drawing.Unit(1D, Telerik.Reporting.Drawing.UnitType.Inch); Telerik.Reporting.Drawing.SizeU paperSize = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(22, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(22, Telerik.Reporting.Drawing.UnitType.Inch)); report1.PageSettings.PaperSize = paperSize; report1.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.Custom; Hashtable deviceInfo = new Hashtable(); deviceInfo["FontEmbedding"] = "Subset"; if (extension.ToLower() == "csv") { deviceInfo["NoHeader"] = true; deviceInfo["NoStaticText"] = true; } Telerik.Reporting.Processing.ReportProcessor RP = new Telerik.Reporting.Processing.ReportProcessor(); byte[] buffer = RP.RenderReport(extension.ToUpper(), report1, deviceInfo).DocumentBytes; string myPath = "C:"; string file = myPath + @"\" + DateTime.Now.ToString("HHmmss") + "." + extension; FileStream fs = new FileStream(file, FileMode.Create); fs.Write(buffer, 0, buffer.Length); fs.Flush(); fs.Close(); Process.Start(file); }
protected void ButtonDene_Click(object sender, EventArgs e) { //Create new CultureInfo var cultureInfo = new System.Globalization.CultureInfo("tr-TR"); // Set the language for static text (i.e. column headings, titles) System.Threading.Thread.CurrentThread.CurrentUICulture = cultureInfo; // Set the language for dynamic text (i.e. date, time, money) System.Threading.Thread.CurrentThread.CurrentCulture = cultureInfo; EFDal ed = new EFDal(); var instanceReportSource = new Telerik.Reporting.InstanceReportSource(); instanceReportSource.ReportDocument = new KalibrasyonRaporlari.KYS(); this.KYSReport.ReportSource = instanceReportSource; Telerik.Reporting.Report report = (Telerik.Reporting.Report)instanceReportSource.ReportDocument; report.ReportParameters["BolgeKodu"].Value = 1; //report.ReportParameters[0].Value = 1; report.ReportParameters["BasTar"].Value = DateTime.Parse("2015-01-01"); report.ReportParameters["SonTar"].Value = DateTime.Parse("2015-06-01"); Telerik.Reporting.TextBox txtAciklama = report.Items.Find("txtAciklama", true)[0] as Telerik.Reporting.TextBox; txtAciklama.Value = ed.BolgeKodundanBolgeAdiniDon(Convert.ToInt32(report.ReportParameters["BolgeKodu"].Value)) + " bölgesi için " + report.ReportParameters["BasTar"].Value.ToString().Replace(" 00:00:00", "") + " ve " + report.ReportParameters["SonTar"].Value.ToString().Replace(" 00:00:00", "") + " tarihleri arasında gecikme sürelerini aşağıda görebilirsiniz"; }
/// <summary> /// Creates a new telerik textbox and adds it to the data section of the telerik report /// </summary> public static void GenerateDataField(string val) { MyDataBoxes[count2] = new Telerik.Reporting.TextBox(); DetailSection.Items.Add(MyDataBoxes[count2]); MyDataBoxes[count2].CanGrow = true; MyDataBoxes[count2].Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Inch(CapLocX2), Telerik.Reporting.Drawing.Unit.Inch(0.02083333395421505D)); MyDataBoxes[count2].Style.Visible = false; MyDataBoxes[count2].Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(1.2666666507720947D), Telerik.Reporting.Drawing.Unit.Inch(0.40000000596046448D)); MyDataBoxes[count2].StyleName = "Data"; MyDataBoxes[count2].Value = val; MyDataBoxes[count2].Visible = true; CapLocX2 += 1.3D; count2++; }
/// <summary> /// Creates a new telerik textbox and adds it to the header section for the report /// </summary> public static void GenerateTextField(string val) { MyCaptionBoxes[count] = new Telerik.Reporting.TextBox(); GroupHeader.Items.Add(MyCaptionBoxes[count]); MyCaptionBoxes[count].CanGrow = true; MyCaptionBoxes[count].Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Inch(CapLocX), Telerik.Reporting.Drawing.Unit.Inch(0.02083333395421505D)); MyCaptionBoxes[count].Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(1.2666666507720947D), Telerik.Reporting.Drawing.Unit.Inch(0.40000000596046448D)); MyCaptionBoxes[count].Style.Visible = false; MyCaptionBoxes[count].StyleName = "Caption"; MyCaptionBoxes[count].Value = val; MyCaptionBoxes[count].Visible = true; CapLocX += 1.3D; count++; }
public tlrBF9(DataSet dataSet, string fromMonth, string fromYear, string toMonth, string toYear) { double TrainingEx, TotalGross, PerOfTrain, MinimunTrain, Diffrance; TrainingEx = TotalGross = PerOfTrain = Diffrance = MinimunTrain = 0.0; InitializeComponent(); txtFinancialEnded.Value = string.Format("From 1/{0}/{1} to {2}/{3}/{4}", fromMonth, fromYear, DateTime.DaysInMonth(int.Parse(toYear), int.Parse(toMonth)), toMonth, toYear); DateTime pdate = DateTime.Parse(dataSet.Tables[0].Rows[0]["printTime"].ToString()); txtCompanyCode.Value = string.Format(": {0}", dataSet.Tables[0].Rows[0]["pCode"].ToString()); txtCompanyName.Value = string.Format(": {0}", dataSet.Tables[0].Rows[0]["pName"].ToString()); txtPrintDate.Value = string.Format("Date Printed {0}/{1}/{2} {3}:{4}:{5}", pdate.Day, pdate.ToString("MMM"), pdate.Year, pdate.Hour, pdate.Minute, pdate.Second); for (int count = 1; count < dataSet.Tables.Count; count++) { Telerik.Reporting.TextBox txtN = detail.Items.Find(string.Format("txt{0}n", count), true)[0] as Telerik.Reporting.TextBox; Telerik.Reporting.TextBox txtR = detail.Items.Find(string.Format("txt{0}r", count), true)[0] as Telerik.Reporting.TextBox; txtN.Value = dataSet.Tables[count].Rows[0]["ColumnName"].ToString(); string result = dataSet.Tables[count].Rows[0]["Result"].ToString(); if (count == 3) { TrainingEx = double.Parse(dataSet.Tables[1].Rows[0]["Result"].ToString()); TotalGross = double.Parse(dataSet.Tables[2].Rows[0]["Result"].ToString()); if (TotalGross == 0) { PerOfTrain = 0.00; } else { PerOfTrain = TrainingEx / TotalGross; } result = PerOfTrain.ToString("#0.00"); } if (count == 4) { MinimunTrain = TotalGross * 2 / 100; result = MinimunTrain.ToString("#0.00"); } if (count == 5) { Diffrance = TrainingEx - MinimunTrain; result = Diffrance.ToString("#0.00"); } txtR.Value = result; } }
/// <summary> /// Refreshes the data on the telerik report so new data can be added. /// </summary> public static void ResetDefaults() { for (int i = 0; i < count; i++) { MyDataBoxes[i].Value = ""; MyCaptionBoxes[i].Value = ""; MyDataBoxes[i] = new Telerik.Reporting.TextBox(); MyCaptionBoxes[i] = new Telerik.Reporting.TextBox(); } GroupHeader.Items.Clear(); DetailSection.Items.Clear(); count = 0; count2 = 0; CapLocX = 0.02083333395421505D; CapLocX2 = 0.02083333395421505D; }
public tlrBF1(DataSet dataSet, string fromMonth, string fromYear, string toMonth, string toYear) { double profit, profitBeforTax, profitAfterTax, ProfitNet; profit = profitBeforTax = profitAfterTax = ProfitNet = 0.0; InitializeComponent(); txtFinancialEnded.Value = string.Format("For financial year ended {0}/{1}/{2}", System.DateTime.DaysInMonth(int.Parse(toYear), int.Parse(toMonth)), toMonth, toYear); //txthead.Value = string.Format("{5} 1/{0}/{1} To {2}/{3}/{4}", fromMonth, fromYear, System.DateTime.DaysInMonth(int.Parse(toYear), int.Parse(toMonth)), toMonth, toYear, txthead.Value); DateTime pdate = DateTime.Parse(dataSet.Tables[0].Rows[0]["printTime"].ToString()); txtCompanyCode.Value = string.Format(": {0}", dataSet.Tables[0].Rows[0]["pCode"].ToString()); txtCompanyName.Value = string.Format(": {0}", dataSet.Tables[0].Rows[0]["pName"].ToString()); txtPrintDate.Value = string.Format("Date Printed {0}/{1}/{2} {3}:{4}:{5}", pdate.Day, pdate.ToString("MMM"), pdate.Year, pdate.Hour, pdate.Minute, pdate.Second); for (int count = 1; count < dataSet.Tables.Count; count++) { Telerik.Reporting.TextBox txtN = detail.Items.Find(string.Format("txt{0}n", count), true)[0] as Telerik.Reporting.TextBox; Telerik.Reporting.TextBox txtR = detail.Items.Find(string.Format("txt{0}r", count), true)[0] as Telerik.Reporting.TextBox; txtN.Value = dataSet.Tables[count].Rows[0]["ColumnName"].ToString(); string result = dataSet.Tables[count].Rows[0]["Result"].ToString(); if (count == 3) { profit = double.Parse(dataSet.Tables[1].Rows[0]["Result"].ToString()) - double.Parse(dataSet.Tables[2].Rows[0]["Result"].ToString()); result = profit.ToString("#0.00"); } if (count == 5) { profitBeforTax = profit - double.Parse(dataSet.Tables[4].Rows[0]["Result"].ToString()); result = profitBeforTax.ToString("#0.00"); } if (count == 8) { profitAfterTax = profitBeforTax - double.Parse(dataSet.Tables[6].Rows[0]["Result"].ToString()) - double.Parse(dataSet.Tables[7].Rows[0]["Result"].ToString()); result = profitAfterTax.ToString("#0.00"); } if (count == 10) { ProfitNet = profitAfterTax + double.Parse(dataSet.Tables[9].Rows[0]["Result"].ToString()); result = ProfitNet.ToString("#0.00"); } txtR.Value = result; } }
public static Telerik.Reporting.TextBox CreateTxtDetail(string FieldName, int i) { Telerik.Reporting.TextBox txtHead = new Telerik.Reporting.TextBox(); txtHead.Value = "=[" + FieldName + "]"; txtHead.Name = FieldName; //txtHead.Dock = DockStyle.Left; //txtHead.CanGrow = true; return txtHead; }
/// <summary> /// Creates the table. /// </summary> /// <param name="columns">The columns.</param> /// <returns>Table.</returns> private Table CreateTable(IEnumerable<TableColumn> columns) { var table = new Table(); var i = 0; foreach (var col in columns) { var header = new TextBox(); header.Style.Font.Size = Unit.Point(10); header.Style.BackgroundColor = Color.Gainsboro; header.Style.BorderStyle.Default = BorderType.Double; header.Size = new SizeU(col.Width, Unit.Inch(0.2)); header.Value = col.Name; table.ColumnGroups.Add(new TableGroup { ReportItem = header }); table.Body.Columns.Add(new TableBodyColumn(col.Width)); ReportItem cell; if (col.DataType != null && col.DataType == typeof(byte[])) { cell = new PictureBox(); ((PictureBox)cell).Sizing = ImageSizeMode.ScaleProportional; ((PictureBox)cell).Value = string.Format(@"=UserFunctions.GetImageValue(Fields.[{0}])", col.Data); } else { cell = new TextBox(); ((TextBox)cell).CanGrow = true; ((TextBox)cell).Value = string.Format("=Fields.[{0}]", col.Data); } cell.Style.Font.Size = Unit.Point(9); cell.Style.VerticalAlign = VerticalAlign.Middle; cell.Style.BorderStyle.Default = BorderType.Double; cell.Size = new SizeU(col.Width, Unit.Inch(0.2)); table.Body.SetCellContent(0, i++, cell); } var tableGroupRow = new TableGroup(); tableGroupRow.Groupings.Add(new Grouping()); table.RowGroups.Add(tableGroupRow); return table; }
public tlrBF3(DataSet dataSet, string fromMonth, string fromYear, string toMonth, string toYear) { double Equity, Liability, Property, TradeBalance, Loans, Investments, Cash, Assets; Equity = Liability = Property = TradeBalance = Loans = Investments = Cash = Assets = 0.0; InitializeComponent(); //txtFinancialEnded.Value = string.Format("(For financial year ended 31/12/{0})", toYear); //txtFinEndDate.Value = string.Format("{5} 1/{0}/{1} To {2}/{3}/{4}", fromMonth, fromYear, System.DateTime.DaysInMonth(int.Parse(toYear), int.Parse(toMonth)), toMonth, toYear, txthead.Value); txtCompanyCode.Value = string.Format(": {0}", dataSet.Tables[0].Rows[0]["pCode"].ToString()); txtCompanyName.Value = string.Format(": {0}", dataSet.Tables[0].Rows[0]["pName"].ToString()); //DateTime fdate = DateTime.Parse(dataSet.Tables[0].Rows[0]["FinancialEnd"].ToString()); // DateTime fdate = DateTime.Parse(dataSet.Tables[0].Rows[0]["FinancialEnd"].ToString()); DateTime pdate = DateTime.Parse(dataSet.Tables[0].Rows[0]["printTime"].ToString()); txtFinEndDate.Value = string.Format("As at {0}/{1}/{2}", System.DateTime.DaysInMonth(int.Parse(fromYear), int.Parse(fromMonth)), fromMonth, fromYear); //txtFinEndDate.Value = string.Format("As at {0}/{1}/{2}", System.DateTime.DaysInMonth(fdate.Year, fdate.Month), fdate.Month, fdate.Year); txtPrintDate.Value = string.Format("Date Printed {0}/{1}/{2} {3}:{4}:{5}", pdate.Day, pdate.ToString("MMM"), pdate.Year, pdate.Hour, pdate.Minute, pdate.Second); for (int count = 1; count < dataSet.Tables.Count; count++) { Telerik.Reporting.TextBox txtN = detail.Items.Find(string.Format("txt{0}n", count), true)[0] as Telerik.Reporting.TextBox; Telerik.Reporting.TextBox txtR = detail.Items.Find(string.Format("txt{0}r", count), true)[0] as Telerik.Reporting.TextBox; txtN.Value = dataSet.Tables[count].Rows[0]["ColumnName"].ToString(); string result = dataSet.Tables[count].Rows[0]["Result"].ToString(); if (count == 1) { Equity = double.Parse(dataSet.Tables[2].Rows[0]["Result"].ToString()) + double.Parse(dataSet.Tables[3].Rows[0]["Result"].ToString()) + double.Parse(dataSet.Tables[4].Rows[0]["Result"].ToString()) + double.Parse(dataSet.Tables[5].Rows[0]["Result"].ToString()); result = Equity.ToString("#0.00"); } if (count == 6) { Liability = double.Parse(dataSet.Tables[7].Rows[0]["Result"].ToString()) + double.Parse(dataSet.Tables[8].Rows[0]["Result"].ToString()) + double.Parse(dataSet.Tables[9].Rows[0]["Result"].ToString()) + double.Parse(dataSet.Tables[10].Rows[0]["Result"].ToString()) + double.Parse(dataSet.Tables[11].Rows[0]["Result"].ToString()) + double.Parse(dataSet.Tables[12].Rows[0]["Result"].ToString()); result = Liability.ToString("#0.00"); } if (count == 13) { Property = double.Parse(dataSet.Tables[14].Rows[0]["Result"].ToString()) + double.Parse(dataSet.Tables[15].Rows[0]["Result"].ToString()); result = Property.ToString("#0.00"); } if (count == 16) { Loans = double.Parse(dataSet.Tables[16].Rows[0]["Result"].ToString()); result = Loans.ToString("#0.00"); } if (count == 17) { Investments = double.Parse(dataSet.Tables[17].Rows[0]["Result"].ToString()); result = Investments.ToString("#0.00"); } if (count == 18) { Cash = double.Parse(dataSet.Tables[18].Rows[0]["Result"].ToString()); result = Cash.ToString("#0.00"); } if (count == 19) { TradeBalance = double.Parse(dataSet.Tables[21].Rows[0]["Result"].ToString()) + double.Parse(dataSet.Tables[22].Rows[0]["Result"].ToString()); Assets = TradeBalance + double.Parse(dataSet.Tables[23].Rows[0]["Result"].ToString()); result = Assets.ToString("#0.00"); } if (count == 20) { result = TradeBalance.ToString("#0.00"); } txtR.Value = result; } txtTotalLiabil.Value = (Equity + Liability).ToString("#0.00"); txtTotalAssets.Value = (Property + Loans + Investments + Cash + Assets).ToString("#0.00"); }
//TODO: Method is too complex. Refactor! /// <summary> /// Builds the detail report. /// </summary> /// <param name="reportDocument">The report document.</param> public void BuildDetailReport(ICustomReport reportDocument) { var currentReport = reportDocument.Reports.First(); var visibleSections = new List<Section>(); var visibleFields = new List<PropertyInfo>(); var textHeight = 0.2; var valueTextHeight = 0.6; var valueMargin = 0.1; var fieldMargin = 0.1; var sectionMargin = 0.3; //This report parameter holds id of the detail item _itemId = int.Parse(currentReport.ReportParameters["itemId"].Value.ToString()); //This report parameter holds the current template system name. _processName = currentReport.ReportParameters["processName"].Value.ToString(); GetEditableRoot(currentReport); var itemProperties = _item.GetAllPropertiesForInstance(); var allItemSections = itemProperties.Where(x => x.Key.Name == "Sections").Reverse() .SelectMany(x => x.Key.GetValue(x.Value, null) as IList<ISection>) .Distinct(new SectionEqualityComparerByGuid()); foreach (Section section in allItemSections) { var sections = currentReport.ReportParameters["sections"].Value.ToString().Split(';'); var sectionIsVisible = false; var index = 0; while (!sectionIsVisible && index < sections.Length) { if (sections[index] == section.Name) { sectionIsVisible = true; } index++; } if (sectionIsVisible) { visibleSections.Add(section); } } _fieldAttrDict = GetFieldAttributes(itemProperties.Select(x => x.Key)); var fields = _fieldAttrDict.Where(x => visibleSections.Select(s => s.Name).Contains(x.Value.SectionName)) .Select(x => x.Key); foreach (var field in fields) { var fieldNames = currentReport.ReportParameters["fields"].Value.ToString().Split(';'); var fieldIsVisible = false; var index = 0; while (!fieldIsVisible && index < fieldNames.Length) { if (fieldNames[index] == field.Name) { fieldIsVisible = true; } index++; } if (fieldIsVisible) { visibleFields.Add(field); } } double startY = 0; var availableWidth = currentReport.Width.Value; foreach (var section in visibleSections) { var sectionHeaderSize = new SizeU(new Unit(availableWidth, UnitType.Inch), new Unit(textHeight, UnitType.Inch)); var headerLoc = new PointU(new Unit(0), new Unit(startY, UnitType.Inch)); var sectionHeader = new TextBox { Value = section.Name, Location = headerLoc, Size = sectionHeaderSize, StyleName = "Section", Multiline = false, CanGrow = false }; startY += textHeight + fieldMargin; currentReport.Items["detail"].Items.Add(sectionHeader); double percentageOfRowUsed = 0; var sectionFields = visibleFields.Where(x => _fieldAttrDict[x].SectionName == section.Name).OrderBy(y => _fieldAttrDict[y].FieldPosition).ToArray(); for (var i = 0; i < sectionFields.Length; i++) { if (percentageOfRowUsed + _fieldAttrDict[sectionFields[i]].WidthPercentage > 1.0) { startY += textHeight + valueMargin + valueTextHeight + fieldMargin; percentageOfRowUsed = 0; } var location = new PointU(new Unit((availableWidth * percentageOfRowUsed), UnitType.Inch), new Unit(startY, UnitType.Inch)); var fieldPanel = new Panel { Location = location }; location = new PointU(Unit.Inch(0), Unit.Inch(0)); var fieldHeaderSize = new SizeU(new Unit((availableWidth * _fieldAttrDict[sectionFields[i]].WidthPercentage) - 0.1, UnitType.Inch), new Unit(textHeight, UnitType.Inch)); var fieldHeader = new TextBox { Location = location, Size = fieldHeaderSize, StyleName = "Field", Multiline = true, CanGrow = true }; fieldHeader.Value = GetDisplayName(sectionFields[i]); var valueLocation = new PointU(Unit.Inch(0), Unit.Inch(textHeight + valueMargin)); var valueSize = new SizeU(new Unit((availableWidth * _fieldAttrDict[sectionFields[i]].WidthPercentage) - 0.1, UnitType.Inch), new Unit(valueTextHeight, UnitType.Inch)); var fieldValue = new TextBox { Location = valueLocation, Size = valueSize, StyleName = "Value", Multiline = true, CanGrow = true }; var backgroundProperty = _item.GetPropertyByName(sectionFields[i].Name + Constants.FieldBackColorPostfix); if (backgroundProperty != null) { var colorAsLong = _item.GetValueByPropertyName(backgroundProperty.Name); if (colorAsLong != 0) { var bytes = BitConverter.GetBytes(colorAsLong); if (bytes[3] == 0) bytes[3] = 255; var color = Color.FromArgb(bytes[3], bytes[2], bytes[1], bytes[0]); fieldValue.Style.BackgroundColor = color; } } var pictureBox = new PictureBox { Location = valueLocation, Size = valueSize, StyleName = "Value" }; List<Chart> chartsList = null; Table fieldValueTable = null; var displayFieldPath = string.Format("[{0}]", string.Join("].[", _item.GetFullPropertyPath(sectionFields[i].Name))); if (_fieldAttrDict[sectionFields[i]].FieldEditor == "Approval") { fieldValue.Value = string.Format("=ApprovalEnumConverter({0}.ApprovalState)", displayFieldPath); } else if (_fieldAttrDict[sectionFields[i]].IsSingleCrossRef) { var displayField = _fieldAttrDict[sectionFields[i]].DisplayFieldList[0]; var crossRefMember = itemProperties.FirstOrDefault( x => x.Key.Name == string.Format("{0}Member", sectionFields[i].Name)); if (!crossRefMember.Equals(default(KeyValuePair<PropertyInfo, IDynamicObject>))) { var crossRefMemberValue = crossRefMember.Key.GetValue(crossRefMember.Value, null) as IDynamicObject; if (crossRefMemberValue != null) { var infoList = TheDynamicTypeManager.GetInfoListById<IInfoList>( _fieldAttrDict[sectionFields[i]].CrossRefProcessName, ((IEditableRoot)crossRefMemberValue).Id); if (infoList.Count > 0) { var crossRefInfoValue = infoList[0] as IDynamicObject; var infoProps = crossRefInfoValue.GetAllPropertiesForInstance(); var displayFieldProp = infoProps.FirstOrDefault(x => x.Key.Name == displayField).Key; if (displayFieldProp != null) { fieldValue.Value = displayFieldProp.GetValue(infoProps[displayFieldProp], null).ToString(); } } } } } else if (_fieldAttrDict[sectionFields[i]].IsMultiCrossRef) { var crList = _item.GetValueByPropertyName(sectionFields[i].Name) as ICrossRefItemList; if (crList != null) { foreach (var item in crList) { fieldValue.Value += item + Environment.NewLine; } } } else if (_fieldAttrDict[sectionFields[i]].FieldEditor == typeof(DateTime).Name || _fieldAttrDict[sectionFields[i]].FieldEditor == "ScheduleDate") { fieldValue.Value = string.Format("=GetDateTimeValue({0}, \"{1}\")", displayFieldPath, _fieldAttrDict[sectionFields[i]].DateTimeFormat.Value); } else if (_fieldAttrDict[sectionFields[i]].FieldEditor == "Result") { var resultListFieldName = string.Format("{0}_ResultList", sectionFields[i].Name); var resultist = itemProperties.FirstOrDefault( x => x.Key.Name == resultListFieldName); if (!resultist.Equals(default(KeyValuePair<PropertyInfo, IDynamicObject>))) { var resultistValue = resultist.Key.GetValue(resultist.Value, null) as IEnumerable<ChoiceInfo>; var resultistPath = string.Format("[{0}]", string.Join("].[", _item.GetFullPropertyPath(resultListFieldName))); if (resultistValue != null) { fieldValue.Value = string.Format("=GetChoiceName({0}, {1})", resultistPath, displayFieldPath); } } else fieldValue.Value = string.Format("=Fields.{0}", displayFieldPath); } else if (_fieldAttrDict[sectionFields[i]].FieldEditor == "FileProcess") { if ((sectionFields[i].GetValue(itemProperties[sectionFields[i]], null) as IDynamicObject) != null) fieldValue.Value = string.Format("=Fields.{0}.OriginalFileName", displayFieldPath); else fieldValue.Value = string.Format("=Fields.{0}", displayFieldPath); } else if (_fieldAttrDict[sectionFields[i]].FieldEditor == Constants.ChoiceFieldType) { var xml = sectionFields[i].GetValue(itemProperties[sectionFields[i]], null).ToString(); if (!string.IsNullOrEmpty(xml)) { var choices = XElement.Parse(xml); var isGlobal = choices.FirstAttribute.Value; if (Convert.ToBoolean(isGlobal)) { var id = choices.LastAttribute.Value; var globalChoice = TheDynamicTypeManager.GetEditableRoot<IEditableRoot>(Constants.GlobalChoiceProcessName, Convert.ToInt32(id)); var newXml = (string)globalChoice.GetType().GetProperty("ChoiceDetails").GetValue(globalChoice, null); if (!string.IsNullOrEmpty(newXml)) choices = XElement.Parse(newXml); } if (choices.Descendants().Any()) { var choiceInfoList = new List<ChoiceInfo>(); foreach (var element in choices.Descendants()) { choiceInfoList.Add(new ChoiceInfo { Choice = element.Attribute("Choice").Value, Score = double.Parse(element.Attribute("Score").Value), AcceptanceCriteria = (ChoiceInfo.AcceptanceCriterias)Enum.Parse(typeof(ChoiceInfo.AcceptanceCriterias), element.Attribute("AcceptanceCriteria").Value, false) }); } var columns = new List<TableColumn> { new TableColumn("Choice", "Choice", fieldHeader.Size.Width * 0.5), new TableColumn("Score", "Score", fieldHeader.Size.Width * 0.2), new TableColumn("AcceptanceCriteria", "Criteria", fieldHeader.Size.Width * 0.3) }; fieldValueTable = CreateTable(columns); fieldValueTable.Location = valueLocation; fieldValueTable.DataSource = choiceInfoList; } } } else if (_fieldAttrDict[sectionFields[i]].FieldEditor == ColumnTypes.AuditTrail.ToString()) { var columns = new List<TableColumn> { new TableColumn("UserName", "UserName", fieldHeader.Size.Width / 6), new TableColumn("ChangeType", "Type", fieldHeader.Size.Width / 6), new TableColumn("FieldName", "FieldName", fieldHeader.Size.Width / 6), new TableColumn("OldValue", "OldValue", fieldHeader.Size.Width / 6), new TableColumn("NewValue", "NewValue", fieldHeader.Size.Width / 6), new TableColumn("UpdateDate", "UpdateDate", fieldHeader.Size.Width / 6) }; fieldValueTable = CreateTable(columns); fieldValueTable.Location = valueLocation; var audits = sectionFields[i].GetValue(itemProperties[sectionFields[i]], null); var auditList = ((IEnumerable)audits).Cast<AuditInfo>().ToList(); for (var j = 0; j < auditList.Count; j++) { if (!string.IsNullOrEmpty(auditList[j].FieldName)) { foreach (var fieldParametrese in _fieldAttrDict) { if (fieldParametrese.Key.Name == auditList[j].FieldName && fieldParametrese.Value.FieldEditor == "RichText") { var converter = new HtmlToText(); var oldValue = converter.ConvertHtml(auditList[j].OldValue as string); var newValue = converter.ConvertHtml(auditList[j].NewValue as string); var newAudit = new AuditInfo(auditList[j].Id, auditList[j].ChangeType, auditList[j].ItemId, auditList[j].FieldName, oldValue, newValue, auditList[j].UpdateDate, auditList[j].UserName); auditList[j] = newAudit; } } } } fieldValueTable.DataSource = auditList; } else if (_fieldAttrDict[sectionFields[i]].IsReverseCrossRef) { //fieldValue.Value = string.Format("=Fields.{0}.ToString()", displayFieldPath); var item = _item.GetValueByPropertyName(sectionFields[i].Name); if (item != null) fieldValue.Value = item.ToString(); } else if (_fieldAttrDict[sectionFields[i]].IsMultiReverseCrossRef) { var list = _item.GetValueByPropertyName(sectionFields[i].Name) as IList; if (list != null) { foreach (IReverseCrossReferenceItem item in list) { fieldValue.Value += item + "\n"; } } } else if (_fieldAttrDict[sectionFields[i]].FieldEditor == "RichText") { fieldValue.Value = string.Format("=GetPlainTextValue({0})", displayFieldPath); } else if (_fieldAttrDict[sectionFields[i]].FieldEditor == ColumnTypes.Checklist.ToString()) { var meta = new Dictionary<string, Type>(); var data = new List<object>(); short count = 0; var checklistObject = (ChecklistEdit)sectionFields[i].GetValue(_item, null); // checklist cache data string resultPropertyName = null; if (checklistObject.AnswerProcessList.Count > 0) { var tempProps = ((IEditableRoot)checklistObject.AnswerProcessList[0]).GetAllPropertiesForType(); foreach (var prop in tempProps) { var resultAttr = (FieldEditorAttribute)(from d in prop.GetCustomAttributes(typeof(FieldEditorAttribute), false) select d).FirstOrDefault(); if (resultAttr != null && resultAttr.DataType == Constants.ResultFieldType) { resultPropertyName = prop.Name; break; } } } // end checklist cache var displayFields = sectionFields[i].GetCustomAttributes<ChecklistDisplayFieldAttribute>().ToList(); foreach (IEditableRoot editObject in checklistObject.AnswerProcessList) { var properties = editObject.GetAllPropertiesForType(); foreach (var property in properties) { if (displayFields.All(x => x.SystemName != property.Name)) { continue; } var csAttr = (CommonSettingsAttribute)(from d in property.GetCustomAttributes(typeof(CommonSettingsAttribute), false) select d).FirstOrDefault(); var feAttr = (FieldEditorAttribute)(from d in property.GetCustomAttributes(typeof(FieldEditorAttribute), false) select d).FirstOrDefault(); if (csAttr != null && csAttr.Section != null) { if (checklistObject.AnswerProcessList.IndexOf(editObject) == 0) { var columnName = property.Name == resultPropertyName ? "Linked Item" : GetDisplayName(property); meta.Add(columnName, property.PropertyType == typeof(byte[]) ? typeof(byte[]) : typeof(string)); count++; } var value = property.GetValue(editObject, null); if (value is string && string.IsNullOrWhiteSpace((string)value)) { data.Add(string.Empty); continue; } //image if (property.PropertyType == typeof(byte[])) { data.Add(value); continue; } //file if (typeof(IFileProcess).IsAssignableFrom(property.PropertyType)) { data.Add(((IFileProcess)value).OriginalFileName); continue; } //sample if (typeof(ISampleList).IsAssignableFrom(property.PropertyType)) { var answerList = _item.GetValueByPropertyName(string.Format("{0}List", sectionFields[i].Name)); if (answerList is IEnumerable) { var sampleEdit = ((IEnumerable<IEditableRoot>)answerList).FirstOrDefault(); if (sampleEdit != null) { var xml = sampleEdit.GetValueByPropertyName(string.Format("{0}{1}", property.Name, Constants.SampleSettingPostfix)) as string; if (!string.IsNullOrEmpty(xml)) { var sampleTypeFieldName = XElement.Parse(xml).Attribute("SampleTypeFieldName").Value; var sampleTypeValue = sampleEdit.GetValueByPropertyName(sampleTypeFieldName); if (sampleTypeValue != null) { var sampleType = (SampleTypes)Enum.Parse(typeof(SampleTypes), sampleTypeValue, false); var result = new List<string>(); foreach (ISampleEdit item in (ISampleList)value) { switch (sampleType) { case SampleTypes.Boolean: result.Add(string.Format("{0} {1}", item.Label, item.SampleBoolean)); break; case SampleTypes.Number: result.Add(string.Format("{0} {1}", item.Label, item.SampleNumeric)); break; case SampleTypes.Alphanumeric: result.Add(string.Format("{0} {1}", item.Label, item.SampleAlphanumeric)); break; } } data.Add(string.Join(Environment.NewLine, result)); continue; } } } } } if (feAttr != null && resultPropertyName != null && (feAttr.DataType == Constants.ChoiceFieldType || property.Name == resultPropertyName)) { var choiceProperty = properties.FirstOrDefault(x => x.Name == resultPropertyName); double? choiceValue = null; if (choiceProperty != null) { choiceValue = (double?)choiceProperty.GetValue(editObject, null); } if (choiceValue.HasValue) { var resultProperty = properties.FirstOrDefault(x => x.Name == resultPropertyName + Constants.ResultListPostfix); var choiceInfoList = resultProperty.GetValue(editObject, null) as IEnumerable<ChoiceInfo>; if (choiceInfoList == null) { data.Add(string.Empty); continue; } var choiceInfo = choiceInfoList.FirstOrDefault(x => x.Score != null && x.Score == choiceValue); if (choiceInfo != null) { data.Add(property.Name == resultPropertyName ? choiceInfo.NewItemLinkContent : choiceInfo.Choice); continue; } if (choiceValue == default(double) && choiceInfo == null) { data.Add(string.Empty); continue; } } } try { data.Add(Convert.ToString(value)); } catch { data.Add(string.Empty); } } } } // populate table var workTable = new DataTable(); foreach (var column in meta) { workTable.Columns.Add(column.Key, column.Value); } for (var j = 0; j < data.Count; j += count) { var row = new object[count]; for (var k = 0; k < count; k++) { row[k] = data[j + k]; } workTable.Rows.Add(row); } // create report table var columns = meta.Select(x => new TableColumn(x.Key, x.Key, fieldHeader.Size.Width / meta.Count, x.Value)).ToList(); fieldValueTable = CreateTable(columns); fieldValueTable.Location = valueLocation; fieldValueTable.DataSource = workTable; } else if (_fieldAttrDict[sectionFields[i]].FieldEditor == "Image") { byte[] imageBytes = (byte[])sectionFields[i].GetValue(itemProperties[sectionFields[i]], null); if (imageBytes != null) { var ms = new MemoryStream(imageBytes); if (ms != null && ms.Length > 0) { pictureBox.Value = Image.FromStream(ms); pictureBox.Height = new Unit(((Image) pictureBox.Value).Height, UnitType.Pixel); } } } else if (_fieldAttrDict[sectionFields[i]].FieldEditor == "Checkbox") { if ((bool)_fieldAttrDict[sectionFields[i]].IsSwitchToggle.Value) { fieldValue.Value = string.Format("=GetBoolValue(\"{0}\", \"{1}\", \"{2}\", {3})", _fieldAttrDict[sectionFields[i]].UndefinedLabel.Value, _fieldAttrDict[sectionFields[i]].TrueLabel.Value, _fieldAttrDict[sectionFields[i]].FalseLabel.Value, displayFieldPath); } else { fieldValue.Value = string.Format("={0}", displayFieldPath); } } else if (_fieldAttrDict[sectionFields[i]].FieldEditor == Constants.SampleFieldType) { var xml = _item.GetValueByPropertyName(string.Format("{0}{1}", sectionFields[i].Name, Constants.SampleSettingPostfix)) as string; if (!string.IsNullOrEmpty(xml)) { var sampleTypeFieldName = XElement.Parse(xml).Attribute("SampleTypeFieldName").Value; var sampleTypeValue = _item.GetValueByPropertyName(sampleTypeFieldName); if (sampleTypeValue != null) { var sampleType = (SampleTypes)Enum.Parse(typeof(SampleTypes), sampleTypeValue, false); var list = _item.GetValueByPropertyName(sectionFields[i].Name); string sampleColumnName = null; switch (sampleType) { case SampleTypes.Boolean: sampleColumnName = "SampleBoolean"; break; case SampleTypes.Number: sampleColumnName = "SampleNumeric"; break; case SampleTypes.Alphanumeric: sampleColumnName = "SampleAlphanumeric"; break; } var columns = new List<TableColumn> { new TableColumn("Label", "Nr", fieldHeader.Size.Width/2), new TableColumn(sampleColumnName, "Value", fieldHeader.Size.Width/2), }; fieldValueTable = CreateTable(columns); fieldValueTable.Location = valueLocation; fieldValueTable.DataSource = list; } } } else if (_fieldAttrDict[sectionFields[i]].FieldEditor == "SpcChart") { //var settings = sectionFields[i].GetValue(itemProperties[sectionFields[i]], null) as string; //chartsList = GetCharts(sectionFields[i], settings, valueLocation, valueSize); fieldValue.Value = "SPC Chart not supported on Easy Report"; } else if (_fieldAttrDict[sectionFields[i]].FieldType.ColumnType == ColumnTypes.Numeric || _fieldAttrDict[sectionFields[i]].FieldType.ColumnType == ColumnTypes.Double || _fieldAttrDict[sectionFields[i]].FieldType.ColumnType == ColumnTypes.Integer) { fieldValue.Value = string.Format(@"=GetNumericValue(Fields.{0}, ""{1}"", ""{2}"")", displayFieldPath, _fieldAttrDict[sectionFields[i]].Numeric.NumericType, currentReport.ReportParameters["userCurrency"].Value ); } else if (_fieldAttrDict[sectionFields[i]].DisplayListField != null) { var displayListProperty = sectionFields[i]; var processName = GetDeclaringProcessSystemName(displayListProperty); var itemType = TheDynamicTypeManager.GetDisplayListItemType(processName, displayListProperty.Name); var listOfFields = _fieldAttrDict[sectionFields[i]].DisplayListField.DisplayFieldList; var displayFields = new List<string>(); if (!string.IsNullOrEmpty(listOfFields)) { displayFields.AddRange(listOfFields.Split('|')); } // populate table var workTable = new DataTable(); // Add table columns. foreach (var propertyName in displayFields) { var property = itemType.GetPropertyByName(propertyName); if (property == null) continue; var columnType = property.PropertyType; if (columnType != typeof(byte[])) columnType = typeof(string); var column = workTable.Columns.Add(propertyName, columnType); column.Caption = GetDisplayName(property); } // Add table rows. foreach (IDynamicObject info in _item.GetValueByPropertyName(displayListProperty.Name)) { var row = workTable.NewRow(); foreach (DataColumn column in workTable.Columns) { var value = info.GetValueByPropertyName(column.ColumnName); if (value == null) continue; if (value is byte[]) { row[column] = value; } else { row[column] = value.ToString(); } } workTable.Rows.Add(row); } // create report table var columns = workTable.Columns.Cast<DataColumn>() .Select(c => new TableColumn(c.ColumnName, c.Caption, fieldHeader.Size.Width / workTable.Columns.Count, c.DataType)) .ToList(); fieldValueTable = CreateTable(columns); fieldValueTable.Location = valueLocation; fieldValueTable.DataSource = workTable; } else { fieldValue.Value = string.Format("=Fields.{0}", displayFieldPath); } ReportItem valueItem; if (fieldValueTable != null) valueItem = fieldValueTable; else valueItem = fieldValue; fieldPanel.Size = new SizeU(fieldHeaderSize.Width, Unit.Inch(textHeight + valueTextHeight)); if (pictureBox.Value != null) { fieldPanel.Items.AddRange(new ReportItemBase[] { fieldHeader, pictureBox }); } else if (chartsList != null && chartsList.Count > 0) { fieldPanel.Items.Add(fieldHeader); foreach (var chart in chartsList) fieldPanel.Items.Add(chart); } else { fieldPanel.Items.AddRange(new[] { fieldHeader, valueItem }); } currentReport.Items["detail"].Items.Add(fieldPanel); percentageOfRowUsed += _fieldAttrDict[sectionFields[i]].WidthPercentage; } startY += sectionMargin + valueTextHeight; } }
/// <summary> /// Creates the aggregate items. /// </summary> /// <param name="currentReport">The current report.</param> /// <param name="forGroups">if set to <c>true</c> [for groups].</param> /// <returns>List{TextBox}.</returns> private List<TextBox> CreateAggregateItems(Report currentReport, bool forGroups) { var height = new Unit(16); var aggregateItems = new Dictionary<string, List<TextBox>>(); var additionalInfoForLastAggregateItem = new Dictionary<Unit, float>(); //calculate server-side aggregates var aggregateDefinitions = _aggregateDict.ToList() .SelectMany(i => i.Value) .Where(d => !AggregateHelper.IsPageAggregateType(d.SummaryType)) .ToList(); var queryCriteria = new AggregateDataSourceQueryCriteria { ProcessName = _processName, FilterDefinition = GetFilterDefinition(currentReport) }; var serverAggregateResults = AggregateProcessor.CalculateAggregates(aggregateDefinitions, queryCriteria); foreach (var aggregateInfo in _aggregateDict) { var col = _colDict.FirstOrDefault(x => x.Value[0] == aggregateInfo.Key); if (!col.Equals(default(KeyValuePair<int, string[]>))) { var fieldValueMap = ((TextBox)currentReport.Items["detail"].Items["rowPanel"].Items[col.Key - 1]).Value.TrimStart('='); var locationX = ((TextBox)currentReport.Items["detail"].Items["rowPanel"].Items[col.Key - 1]).Location.X; var width = GetWidth(currentReport, aggregateInfo); var locationY = new Unit(0, locationX.Type); var list = new List<TextBox>(); foreach (var criteria in aggregateInfo.Value) { var textbox = new TextBox(); textbox.Style.Padding.Left = new Unit(1); textbox.Style.Padding.Right = new Unit(1); textbox.Style.Font.Size = new Unit(9); textbox.Style.Font.Name = "Arial Unicode MS"; textbox.Style.VerticalAlign = VerticalAlign.Middle; textbox.Size = new SizeU(Unit.Inch(width), height); textbox.CanGrow = true; textbox.TextWrap = true; textbox.Location = new PointU(locationX, locationY); if (_aggregateDict.Last().Equals(aggregateInfo)) { EventHandler textboxItemDataBoundHandler = (s, e) => { var ft = new FormattedText((string)((Telerik.Reporting.Processing.TextBox)s).Value, CultureInfo.CurrentCulture, FlowDirection.LeftToRight, new Typeface(new System.Windows.Media.FontFamily(((Telerik.Reporting.Processing.VisualElement)s).Style.Font.Name), new System.Windows.FontStyle(), new FontWeight(), new FontStretch()), ((Telerik.Reporting.Processing.VisualElement)s).Style.Font.Size.Value, System.Windows.Media.Brushes.Black); if (ft.Width > ((Telerik.Reporting.Processing.TextBox)s).Size.Width.Value) { foreach (var f in additionalInfoForLastAggregateItem) { ((Telerik.Reporting.Processing.ReportItem)s).Location = new PointU(f.Key, ((Telerik.Reporting.Processing.ReportItem)s).Location.Y); ((Telerik.Reporting.Processing.ReportItem)s).Size = new SizeU(Unit.Inch(f.Value + ((Telerik.Reporting.Processing.ReportItem)s).Size.Width.Value), height); if (((Telerik.Reporting.Processing.ReportItem)s).Size.Width.Value >= ft.Width) { break; } } } }; textbox.ItemDataBound += textboxItemDataBoundHandler; EventHandler textboxDisposedHandler = null; textboxDisposedHandler = (sender, args) => { textbox.ItemDataBound -= textboxItemDataBoundHandler; textbox.Disposed -= textboxDisposedHandler; }; textbox.Disposed += textboxDisposedHandler; } if (AggregateHelper.IsPageAggregateType(criteria.SummaryType)) { var aggregateFunction = forGroups ? "Exec" : "PageExec"; var aggregateFunctionParameter = forGroups ? ":scope:" : aggregateInfo.Key + "TextBox"; textbox.Value = string.Format( @"='{0}: ' + AfterCalculateAggregates({7}('{8}', {2}(BeforeCalculateAggregates(Fields.[{1}], ""{2}"", ""{3}"", ""{4}"", ""{5}"", ""{6}""))), ""{2}"", ""{3}"", ""{4}"", ""{5}"", ""{6}"")", AggregateHelper.GetAttribute(criteria.SummaryType).ShortName, aggregateInfo.Key, criteria.SummaryType, criteria.CustomConverter, criteria.TargetType, criteria.TypeName, criteria.ConverterParameter, aggregateFunction, aggregateFunctionParameter); } else { var result = serverAggregateResults.FirstOrDefault(r => r.ColumnName == criteria.ColumnName && r.SummaryType == criteria.SummaryType); textbox.Value = string.Format("{0}: {1}", AggregateHelper.GetAttribute(criteria.SummaryType).ShortName, result); } list.Add(textbox); locationY += height; } aggregateItems.Add(aggregateInfo.Key, list); } } if (aggregateItems.Count > 1) { var lastItem = aggregateItems.Last(); aggregateItems.Remove(lastItem.Key); var penultimateItem = aggregateItems.Last(); var indexOfPenultimateItem = _colDict.First(x => x.Value[0] == penultimateItem.Key).Key; var indexOfLastItem = _colDict.First(x => x.Value[0] == lastItem.Key).Key; if (indexOfLastItem - indexOfPenultimateItem > 1) // if exists at least one column between last and penultimate aggregate columns { // fill additional info for last aggrigate item var i = Convert.ToInt32((indexOfLastItem - indexOfPenultimateItem - 1) / 2); foreach (var column in _colDict) { if (column.Key >= i + indexOfPenultimateItem + 1 && column.Value[0] != lastItem.Key) { var item = ((ReportItem)currentReport.Items["detail"].Items["rowPanel"].Items.FirstOrDefault(x => x.Name == string.Format("{0}TextBox", column.Value[0]))); if (item != null) { additionalInfoForLastAggregateItem.Add(item.Location.X, item.Size.Width.Value); } } } var descending = additionalInfoForLastAggregateItem.Reverse(); additionalInfoForLastAggregateItem = descending.ToDictionary(x => x.Key, x => x.Value); // new size of penultimate item foreach (var textbox in penultimateItem.Value) { textbox.Size = new SizeU(Unit.Inch(textbox.Size.Width.Value / 2), height); } } aggregateItems.Add(lastItem.Key, lastItem.Value); } var returnList = new List<TextBox>(); foreach (var aggregateItem in aggregateItems) { returnList.AddRange(aggregateItem.Value); } return returnList; }
/// <summary> /// Adds the group level lines. /// </summary> /// <param name="collection">The collection.</param> private void AddGroupLevelLines(ReportItemBase.ItemCollection collection) { if (_indentOffset.Equals(0)) return; for (var i = 0; i < _indentOffset / 0.15; i++) { var indentCell = new TextBox(); indentCell.Style.BackgroundColor = Color.White; indentCell.Style.BorderColor.Left = Color.DarkGray; indentCell.Style.BorderStyle.Left = BorderType.Dotted; indentCell.Location = new PointU(new Unit(0.15 * i, UnitType.Inch), new Unit(0, UnitType.Inch)); indentCell.Size = new SizeU(new Unit(0.15, UnitType.Inch), new Unit(0.2, UnitType.Inch)); collection.Insert(i, indentCell); } }
/// <summary> /// Refreshes the data on the telerik report so new data can be added. /// </summary> public static void ResetDefaults() { for(int i = 0; i < count; i++) { MyDataBoxes[i].Value = ""; MyCaptionBoxes[i].Value = ""; MyDataBoxes[i] = new Telerik.Reporting.TextBox(); MyCaptionBoxes[i] = new Telerik.Reporting.TextBox(); } GroupHeader.Items.Clear(); DetailSection.Items.Clear(); count = 0; count2 = 0; CapLocX = 0.02083333395421505D; CapLocX2 = 0.02083333395421505D; }
/// case 1: /// | 0.0 | 0.1 | /// ------------- /// | 1.0 | 1.1 | /// private void CreateTable2x2Test() { var table1 = new Telerik.Reporting.Table(); var colGroup1 = new Telerik.Reporting.TableGroup(); var colGroup2 = new Telerik.Reporting.TableGroup(); var colGroup3 = new Telerik.Reporting.TableGroup(); var colGroup4 = new Telerik.Reporting.TableGroup(); var detailGroup = new Telerik.Reporting.TableGroup(); var rowGroup1 = new Telerik.Reporting.TableGroup(); var txtBox00 = new Telerik.Reporting.TextBox(); var txtBox01 = new Telerik.Reporting.TextBox(); var txtBox10 = new Telerik.Reporting.TextBox(); var txtBox11 = new Telerik.Reporting.TextBox(); this.detail.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { table1 }); table1.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(Telerik.Reporting.Drawing.Unit.Cm(3D))); table1.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(Telerik.Reporting.Drawing.Unit.Cm(3D))); table1.Body.Rows.Add(new Telerik.Reporting.TableBodyRow(Telerik.Reporting.Drawing.Unit.Cm(0.5D))); table1.Body.SetCellContent(0, 0, txtBox10); table1.Body.SetCellContent(0, 1, txtBox11); table1.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { txtBox00, txtBox01, txtBox10, txtBox11 }); colGroup2.Name = "colgroup-02"; colGroup1.ChildGroups.Add(colGroup2); colGroup1.Name = "colgroup-01"; colGroup1.ReportItem = txtBox00; colGroup4.Name = "colgroup-04"; colGroup3.ChildGroups.Add(colGroup4); colGroup3.Name = "colgroup-03"; colGroup3.ReportItem = txtBox01; table1.ColumnGroups.Add(colGroup1); table1.ColumnGroups.Add(colGroup3); rowGroup1.Name = "rowgroup-01"; detailGroup.ChildGroups.Add(rowGroup1); detailGroup.Groupings.Add(new Telerik.Reporting.Grouping(null)); detailGroup.Name = "detailgroup"; table1.RowGroups.Add(detailGroup); table1.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Cm(6D), Telerik.Reporting.Drawing.Unit.Cm(1D)); table1.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Cm(1.5D), Telerik.Reporting.Drawing.Unit.Cm(1.5D)); table1.Name = "table1"; // // txtBox00 // txtBox00.Name = "txtBox00"; txtBox00.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Cm(3D), Telerik.Reporting.Drawing.Unit.Cm(0.5D)); txtBox00.StyleName = ""; txtBox00.Value = "0.0"; // // txtBox01 // txtBox01.Name = "txtBox01"; txtBox01.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Cm(3D), Telerik.Reporting.Drawing.Unit.Cm(0.5D)); txtBox01.StyleName = ""; txtBox01.Value = "0.1"; // // txtBox10 // txtBox10.Name = "txtBox10"; txtBox10.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Cm(3D), Telerik.Reporting.Drawing.Unit.Cm(0.5D)); txtBox10.StyleName = ""; txtBox10.Value = "1.0"; // // txtBox11 // txtBox11.Name = "txtBox11"; txtBox11.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Cm(3D), Telerik.Reporting.Drawing.Unit.Cm(0.5D)); txtBox11.StyleName = ""; txtBox11.Value = "1.1"; }
private void RAttendanceSheet_ItemDataBinding(object sender, EventArgs e) { try { _rowCount = 0; textBoxWeek1Mon.Value = string.Empty; textBoxWeek2Mon.Value = string.Empty; textBoxWeek3Mon.Value = string.Empty; textBoxWeek4Mon.Value = string.Empty; textBoxWeek1Tue.Value = string.Empty; textBoxWeek2Tue.Value = string.Empty; textBoxWeek3Tue.Value = string.Empty; textBoxWeek4Tue.Value = string.Empty; textBoxWeek1Wed.Value = string.Empty; textBoxWeek2Wed.Value = string.Empty; textBoxWeek3Wed.Value = string.Empty; textBoxWeek4Wed.Value = string.Empty; textBoxWeek1Thu.Value = string.Empty; textBoxWeek2Thu.Value = string.Empty; textBoxWeek3Thu.Value = string.Empty; textBoxWeek4Thu.Value = string.Empty; textBoxWeek1Fri.Value = string.Empty; textBoxWeek2Fri.Value = string.Empty; textBoxWeek3Fri.Value = string.Empty; textBoxWeek4Fri.Value = string.Empty; Telerik.Reporting.Processing.Report rpt = (Telerik.Reporting.Processing.Report)sender; var startDate = ((DateTime)rpt.Parameters["StartDate"].Value).Date; var endDate = ((DateTime)rpt.Parameters["EndDate"].Value).Date; bool isFirstInsert = true; DateTime startDateReal = DateTime.Today; DateTime endDateReal = DateTime.Today; int weekIndex = 1; while (startDate <= endDate) { Telerik.Reporting.TextBox tb = null; switch (startDate.DayOfWeek) { case DayOfWeek.Monday: switch (weekIndex) { case 1: tb = textBoxWeek1Mon; break; case 2: tb = textBoxWeek2Mon; break; case 3: tb = textBoxWeek3Mon; break; case 4: tb = textBoxWeek4Mon; break; } break; case DayOfWeek.Tuesday: switch (weekIndex) { case 1: tb = textBoxWeek1Tue; break; case 2: tb = textBoxWeek2Tue; break; case 3: tb = textBoxWeek3Tue; break; case 4: tb = textBoxWeek4Tue; break; } break; case DayOfWeek.Wednesday: switch (weekIndex) { case 1: tb = textBoxWeek1Wed; break; case 2: tb = textBoxWeek2Wed; break; case 3: tb = textBoxWeek3Wed; break; case 4: tb = textBoxWeek4Wed; break; } break; case DayOfWeek.Thursday: switch (weekIndex) { case 1: tb = textBoxWeek1Thu; break; case 2: tb = textBoxWeek2Thu; break; case 3: tb = textBoxWeek3Thu; break; case 4: tb = textBoxWeek4Thu; break; } break; case DayOfWeek.Friday: switch (weekIndex) { case 1: tb = textBoxWeek1Fri; break; case 2: tb = textBoxWeek2Fri; break; case 3: tb = textBoxWeek3Fri; break; case 4: tb = textBoxWeek4Fri; break; } weekIndex++; break; } if (tb != null) { tb.Value = startDate.Day.ToString(); if (isFirstInsert) { startDateReal = startDate; isFirstInsert = false; } endDateReal = startDate; } startDate = startDate.AddDays(1); } //rpt.Parameters["StartDate"].Value = startDateReal; //rpt.Parameters["EndDate"].Value = endDateReal; htmlTextBoxDate.Value = startDateReal.ToString("MM-dd-yyyy") + " ~ " + endDateReal.ToString("MM-dd-yyyy"); } catch (Exception ex) { Debug.Print(ex.Message); } }
/// <summary> /// Required method for telerik Reporting designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SalesOrderDetails)); Telerik.Reporting.ReportParameter reportParameter1 = new Telerik.Reporting.ReportParameter(); Telerik.Reporting.Drawing.StyleRule styleRule1 = new Telerik.Reporting.Drawing.StyleRule(); Telerik.Reporting.Drawing.StyleRule styleRule2 = new Telerik.Reporting.Drawing.StyleRule(); Telerik.Reporting.Drawing.StyleRule styleRule3 = new Telerik.Reporting.Drawing.StyleRule(); Telerik.Reporting.Drawing.StyleRule styleRule4 = new Telerik.Reporting.Drawing.StyleRule(); this.labelsGroupHeader = new Telerik.Reporting.GroupHeaderSection(); this.panel1 = new Telerik.Reporting.Panel(); this.productNumberCaptionTextBox = new Telerik.Reporting.TextBox(); this.nameCaptionTextBox = new Telerik.Reporting.TextBox(); this.orderQtyCaptionTextBox = new Telerik.Reporting.TextBox(); this.unitPriceCaptionTextBox = new Telerik.Reporting.TextBox(); this.lineTotalCaptionTextBox = new Telerik.Reporting.TextBox(); this.labelsGroupFooter = new Telerik.Reporting.GroupFooterSection(); this.textBox1 = new Telerik.Reporting.TextBox(); this.textBox2 = new Telerik.Reporting.TextBox(); this.labelsGroup = new Telerik.Reporting.Group(); this.detail = new Telerik.Reporting.DetailSection(); this.productNumberDataTextBox = new Telerik.Reporting.TextBox(); this.nameDataTextBox = new Telerik.Reporting.TextBox(); this.orderQtyDataTextBox = new Telerik.Reporting.TextBox(); this.unitPriceDataTextBox = new Telerik.Reporting.TextBox(); this.lineTotalDataTextBox = new Telerik.Reporting.TextBox(); this.sqlDataSource1 = new Telerik.Reporting.SqlDataSource(); ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); // // labelsGroupHeader // this.labelsGroupHeader.Height = new Telerik.Reporting.Drawing.Unit(0.30000004172325134, Telerik.Reporting.Drawing.UnitType.Inch); this.labelsGroupHeader.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { this.panel1}); this.labelsGroupHeader.Name = "labelsGroupHeader"; this.labelsGroupHeader.PrintOnEveryPage = true; // // panel1 // this.panel1.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { this.productNumberCaptionTextBox, this.nameCaptionTextBox, this.orderQtyCaptionTextBox, this.unitPriceCaptionTextBox, this.lineTotalCaptionTextBox}); this.panel1.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0, Telerik.Reporting.Drawing.UnitType.Inch)); this.panel1.Name = "panel1"; this.panel1.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(7.5, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.30000004172325134, Telerik.Reporting.Drawing.UnitType.Inch)); this.panel1.Style.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(229)))), ((int)(((byte)(245)))), ((int)(((byte)(255))))); // // productNumberCaptionTextBox // this.productNumberCaptionTextBox.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(3.9378803194267675E-05, Telerik.Reporting.Drawing.UnitType.Inch)); this.productNumberCaptionTextBox.Name = "productNumberCaptionTextBox"; this.productNumberCaptionTextBox.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.3000000715255737, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.30000004172325134, Telerik.Reporting.Drawing.UnitType.Inch)); this.productNumberCaptionTextBox.Style.Font.Bold = true; this.productNumberCaptionTextBox.StyleName = "Caption"; this.productNumberCaptionTextBox.Value = "ProductNumber"; // // nameCaptionTextBox // this.nameCaptionTextBox.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(1.3000787496566773, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0, Telerik.Reporting.Drawing.UnitType.Inch)); this.nameCaptionTextBox.Name = "nameCaptionTextBox"; this.nameCaptionTextBox.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(2.7999212741851807, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.30000004172325134, Telerik.Reporting.Drawing.UnitType.Inch)); this.nameCaptionTextBox.Style.Font.Bold = true; this.nameCaptionTextBox.StyleName = "Caption"; this.nameCaptionTextBox.Value = "Name"; // // orderQtyCaptionTextBox // this.orderQtyCaptionTextBox.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(4.100039005279541, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(-1.2417634032146907E-08, Telerik.Reporting.Drawing.UnitType.Inch)); this.orderQtyCaptionTextBox.Name = "orderQtyCaptionTextBox"; this.orderQtyCaptionTextBox.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(0.91025900840759277, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.30000004172325134, Telerik.Reporting.Drawing.UnitType.Inch)); this.orderQtyCaptionTextBox.Style.Font.Bold = true; this.orderQtyCaptionTextBox.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Right; this.orderQtyCaptionTextBox.StyleName = "Caption"; this.orderQtyCaptionTextBox.Value = "Quantity"; // // unitPriceCaptionTextBox // this.unitPriceCaptionTextBox.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(5.0103774070739746, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0, Telerik.Reporting.Drawing.UnitType.Inch)); this.unitPriceCaptionTextBox.Name = "unitPriceCaptionTextBox"; this.unitPriceCaptionTextBox.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.222798228263855, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.30000004172325134, Telerik.Reporting.Drawing.UnitType.Inch)); this.unitPriceCaptionTextBox.Style.Font.Bold = true; this.unitPriceCaptionTextBox.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Right; this.unitPriceCaptionTextBox.StyleName = "Caption"; this.unitPriceCaptionTextBox.Value = "Unit Price"; // // lineTotalCaptionTextBox // this.lineTotalCaptionTextBox.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(6.2332539558410645, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0, Telerik.Reporting.Drawing.UnitType.Inch)); this.lineTotalCaptionTextBox.Name = "lineTotalCaptionTextBox"; this.lineTotalCaptionTextBox.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.2666666507720947, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.30000004172325134, Telerik.Reporting.Drawing.UnitType.Inch)); this.lineTotalCaptionTextBox.Style.Font.Bold = true; this.lineTotalCaptionTextBox.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Right; this.lineTotalCaptionTextBox.StyleName = "Caption"; this.lineTotalCaptionTextBox.Value = "Line Total"; // // labelsGroupFooter // this.labelsGroupFooter.Height = new Telerik.Reporting.Drawing.Unit(0.30000004172325134, Telerik.Reporting.Drawing.UnitType.Inch); this.labelsGroupFooter.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { this.textBox1, this.textBox2}); this.labelsGroupFooter.Name = "labelsGroupFooter"; this.labelsGroupFooter.Style.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(229)))), ((int)(((byte)(255))))); this.labelsGroupFooter.Style.Visible = true; // // textBox1 // this.textBox1.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(5.010338306427002, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox1.Name = "textBox1"; this.textBox1.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.2228368520736694, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.30000004172325134, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox1.Style.Font.Bold = true; this.textBox1.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(11, Telerik.Reporting.Drawing.UnitType.Point); this.textBox1.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Right; this.textBox1.Value = "Total"; // // textBox2 // this.textBox2.Format = "{0:C2}"; this.textBox2.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(6.2332935333251953, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox2.Name = "textBox2"; this.textBox2.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.2666668891906738, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.30000004172325134, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox2.Style.Font.Bold = true; this.textBox2.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Right; this.textBox2.Value = "=Sum(Fields.LineTotal)"; // // labelsGroup // this.labelsGroup.GroupFooter = this.labelsGroupFooter; this.labelsGroup.GroupHeader = this.labelsGroupHeader; this.labelsGroup.Name = "labelsGroup"; // // detail // this.detail.Height = new Telerik.Reporting.Drawing.Unit(0.30000004172325134, Telerik.Reporting.Drawing.UnitType.Inch); this.detail.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { this.productNumberDataTextBox, this.nameDataTextBox, this.orderQtyDataTextBox, this.unitPriceDataTextBox, this.lineTotalDataTextBox}); this.detail.Name = "detail"; // // productNumberDataTextBox // this.productNumberDataTextBox.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0, Telerik.Reporting.Drawing.UnitType.Inch)); this.productNumberDataTextBox.Name = "productNumberDataTextBox"; this.productNumberDataTextBox.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.3000000715255737, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.30000004172325134, Telerik.Reporting.Drawing.UnitType.Inch)); this.productNumberDataTextBox.Style.Padding.Left = new Telerik.Reporting.Drawing.Unit(2, Telerik.Reporting.Drawing.UnitType.Point); this.productNumberDataTextBox.StyleName = "Data"; this.productNumberDataTextBox.Value = "=Fields.ProductNumber"; // // nameDataTextBox // this.nameDataTextBox.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(1.3000787496566773, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0, Telerik.Reporting.Drawing.UnitType.Inch)); this.nameDataTextBox.Name = "nameDataTextBox"; this.nameDataTextBox.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(2.7999212741851807, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.30000004172325134, Telerik.Reporting.Drawing.UnitType.Inch)); this.nameDataTextBox.StyleName = "Data"; this.nameDataTextBox.Value = "=Fields.Name"; // // orderQtyDataTextBox // this.orderQtyDataTextBox.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(4.10007905960083, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0, Telerik.Reporting.Drawing.UnitType.Inch)); this.orderQtyDataTextBox.Name = "orderQtyDataTextBox"; this.orderQtyDataTextBox.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(0.91018062829971313, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.30000004172325134, Telerik.Reporting.Drawing.UnitType.Inch)); this.orderQtyDataTextBox.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Right; this.orderQtyDataTextBox.StyleName = "Data"; this.orderQtyDataTextBox.Value = "=Fields.OrderQty"; // // unitPriceDataTextBox // this.unitPriceDataTextBox.Format = "{0:C2}"; this.unitPriceDataTextBox.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(5.010338306427002, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0, Telerik.Reporting.Drawing.UnitType.Inch)); this.unitPriceDataTextBox.Name = "unitPriceDataTextBox"; this.unitPriceDataTextBox.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.2228771448135376, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.30000004172325134, Telerik.Reporting.Drawing.UnitType.Inch)); this.unitPriceDataTextBox.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Right; this.unitPriceDataTextBox.StyleName = "Data"; this.unitPriceDataTextBox.Value = "=Fields.UnitPrice"; // // lineTotalDataTextBox // this.lineTotalDataTextBox.Format = "{0:C2}"; this.lineTotalDataTextBox.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(6.2332539558410645, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0, Telerik.Reporting.Drawing.UnitType.Inch)); this.lineTotalDataTextBox.Name = "lineTotalDataTextBox"; this.lineTotalDataTextBox.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.2666666507720947, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.30000004172325134, Telerik.Reporting.Drawing.UnitType.Inch)); this.lineTotalDataTextBox.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Right; this.lineTotalDataTextBox.StyleName = "Data"; this.lineTotalDataTextBox.Value = "=Fields.LineTotal"; // // sqlDataSource1 // this.sqlDataSource1.ConnectionString = "Telerik.Reporting.Examples.CSharp.Properties.Settings.TelerikConnectionString"; this.sqlDataSource1.Name = "sqlDataSource1"; this.sqlDataSource1.Parameters.AddRange(new Telerik.Reporting.SqlDataSourceParameter[] { new Telerik.Reporting.SqlDataSourceParameter("@SalesOrderID", System.Data.DbType.Int32, "=Parameters.SaledOrderID.Value")}); this.sqlDataSource1.SelectCommand = resources.GetString("sqlDataSource1.SelectCommand"); // // SalesOrderDetails // this.DataSource = this.sqlDataSource1; this.Filters.AddRange(new Telerik.Reporting.Data.Filter[] { new Telerik.Reporting.Data.Filter("=Fields.SalesOrderID", Telerik.Reporting.Data.FilterOperator.Equal, "=Parameters.SaledOrderID.Value")}); this.Groups.AddRange(new Telerik.Reporting.Group[] { this.labelsGroup}); this.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { this.labelsGroupHeader, this.labelsGroupFooter, this.detail}); this.PageSettings.Landscape = false; this.PageSettings.Margins.Bottom = new Telerik.Reporting.Drawing.Unit(0.25, Telerik.Reporting.Drawing.UnitType.Inch); this.PageSettings.Margins.Left = new Telerik.Reporting.Drawing.Unit(0.5, Telerik.Reporting.Drawing.UnitType.Inch); this.PageSettings.Margins.Right = new Telerik.Reporting.Drawing.Unit(0.5, Telerik.Reporting.Drawing.UnitType.Inch); this.PageSettings.Margins.Top = new Telerik.Reporting.Drawing.Unit(0.25, Telerik.Reporting.Drawing.UnitType.Inch); this.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.Letter; reportParameter1.Name = "SaledOrderID"; reportParameter1.Value = "=43860"; this.ReportParameters.Add(reportParameter1); this.Style.BackgroundColor = System.Drawing.Color.White; styleRule1.Selectors.AddRange(new Telerik.Reporting.Drawing.ISelector[] { new Telerik.Reporting.Drawing.StyleSelector("Title")}); styleRule1.Style.Color = System.Drawing.Color.Black; styleRule1.Style.Font.Bold = true; styleRule1.Style.Font.Italic = false; styleRule1.Style.Font.Name = "Tahoma"; styleRule1.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(20, Telerik.Reporting.Drawing.UnitType.Point); styleRule1.Style.Font.Strikeout = false; styleRule1.Style.Font.Underline = false; styleRule2.Selectors.AddRange(new Telerik.Reporting.Drawing.ISelector[] { new Telerik.Reporting.Drawing.StyleSelector("Caption")}); styleRule2.Style.Color = System.Drawing.Color.Black; styleRule2.Style.Font.Name = "Tahoma"; styleRule2.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(11, Telerik.Reporting.Drawing.UnitType.Point); styleRule2.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle; styleRule3.Selectors.AddRange(new Telerik.Reporting.Drawing.ISelector[] { new Telerik.Reporting.Drawing.StyleSelector("Data")}); styleRule3.Style.Font.Name = "Tahoma"; styleRule3.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(11, Telerik.Reporting.Drawing.UnitType.Point); styleRule3.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle; styleRule4.Selectors.AddRange(new Telerik.Reporting.Drawing.ISelector[] { new Telerik.Reporting.Drawing.StyleSelector("PageInfo")}); styleRule4.Style.Font.Name = "Tahoma"; styleRule4.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(11, Telerik.Reporting.Drawing.UnitType.Point); styleRule4.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle; this.StyleSheet.AddRange(new Telerik.Reporting.Drawing.StyleRule[] { styleRule1, styleRule2, styleRule3, styleRule4}); this.Width = new Telerik.Reporting.Drawing.Unit(7.5, Telerik.Reporting.Drawing.UnitType.Inch); ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); }
/// <summary> /// Required method for telerik Reporting designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Invoice)); Telerik.Reporting.ReportParameter reportParameter1 = new Telerik.Reporting.ReportParameter(); Telerik.Reporting.ReportParameter reportParameter2 = new Telerik.Reporting.ReportParameter(); Telerik.Reporting.ReportParameter reportParameter3 = new Telerik.Reporting.ReportParameter(); this.OrderNumbersDataSource = new Telerik.Reporting.SqlDataSource(); this.detail = new Telerik.Reporting.DetailSection(); this.panel4 = new Telerik.Reporting.Panel(); this.textBox14 = new Telerik.Reporting.TextBox(); this.textBox10 = new Telerik.Reporting.TextBox(); this.textBox9 = new Telerik.Reporting.TextBox(); this.textBox8 = new Telerik.Reporting.TextBox(); this.textBox6 = new Telerik.Reporting.TextBox(); this.textBox4 = new Telerik.Reporting.TextBox(); this.textBox12 = new Telerik.Reporting.TextBox(); this.textBox13 = new Telerik.Reporting.TextBox(); this.textBox11 = new Telerik.Reporting.TextBox(); this.textBox16 = new Telerik.Reporting.TextBox(); this.textBox17 = new Telerik.Reporting.TextBox(); this.textBox18 = new Telerik.Reporting.TextBox(); this.textBox19 = new Telerik.Reporting.TextBox(); this.textBox21 = new Telerik.Reporting.TextBox(); this.textBox28 = new Telerik.Reporting.TextBox(); this.textBox29 = new Telerik.Reporting.TextBox(); this.textBox30 = new Telerik.Reporting.TextBox(); this.textBox31 = new Telerik.Reporting.TextBox(); this.textBox32 = new Telerik.Reporting.TextBox(); this.panel1 = new Telerik.Reporting.Panel(); this.textBox24 = new Telerik.Reporting.TextBox(); this.textBox23 = new Telerik.Reporting.TextBox(); this.textBox25 = new Telerik.Reporting.TextBox(); this.textBox26 = new Telerik.Reporting.TextBox(); this.textBox27 = new Telerik.Reporting.TextBox(); this.panel2 = new Telerik.Reporting.Panel(); this.textBox7 = new Telerik.Reporting.TextBox(); this.textBox2 = new Telerik.Reporting.TextBox(); this.textBox3 = new Telerik.Reporting.TextBox(); this.group1 = new Telerik.Reporting.Group(); this.groupFooterSection1 = new Telerik.Reporting.GroupFooterSection(); this.groupHeaderSection1 = new Telerik.Reporting.GroupHeaderSection(); this.panel5 = new Telerik.Reporting.Panel(); this.Text1 = new Telerik.Reporting.TextBox(); this.Field6 = new Telerik.Reporting.TextBox(); this.Text12 = new Telerik.Reporting.TextBox(); this.Id1 = new Telerik.Reporting.TextBox(); this.barcode2 = new Telerik.Reporting.Barcode(); this.pictureBox1 = new Telerik.Reporting.PictureBox(); this.textBox1 = new Telerik.Reporting.TextBox(); this.panel3 = new Telerik.Reporting.Panel(); this.Text8 = new Telerik.Reporting.TextBox(); this.InvoicesDataSource = new Telerik.Reporting.SqlDataSource(); this.pageFooterSection1 = new Telerik.Reporting.PageFooterSection(); this.textBox5 = new Telerik.Reporting.TextBox(); this.textBox22 = new Telerik.Reporting.TextBox(); this.subReport1 = new Telerik.Reporting.SubReport(); this.salesOrderDetails1 = new Telerik.Reporting.SalesOrderDetails(); ((System.ComponentModel.ISupportInitialize)(this.salesOrderDetails1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); // // OrderNumbersDataSource // this.OrderNumbersDataSource.ConnectionString = "Telerik.Reporting.Examples.CSharp.Properties.Settings.TelerikConnectionString"; this.OrderNumbersDataSource.Name = "OrderNumbers"; this.OrderNumbersDataSource.Parameters.AddRange(new Telerik.Reporting.SqlDataSourceParameter[] { new Telerik.Reporting.SqlDataSourceParameter("@ForYear", System.Data.DbType.String, "=Parameters.ForYear.Value"), new Telerik.Reporting.SqlDataSourceParameter("@ForMonth", System.Data.DbType.String, "=Parameters.ForMonth.Value")}); this.OrderNumbersDataSource.SelectCommand = resources.GetString("OrderNumbersDataSource.SelectCommand"); // // detail // this.detail.Height = new Telerik.Reporting.Drawing.Unit(3.2780463695526123D, Telerik.Reporting.Drawing.UnitType.Inch); this.detail.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { this.panel4, this.subReport1}); this.detail.KeepTogether = false; this.detail.Name = "detail"; // // panel4 // this.panel4.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { this.textBox14, this.textBox10, this.textBox9, this.textBox8, this.textBox6, this.textBox4, this.textBox12, this.textBox13, this.textBox11, this.textBox16, this.textBox17, this.textBox18, this.textBox19, this.textBox21, this.textBox28, this.textBox29, this.textBox30, this.textBox31, this.textBox32, this.panel1, this.panel2, this.textBox2, this.textBox3}); this.panel4.KeepTogether = false; this.panel4.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.0833333358168602D, Telerik.Reporting.Drawing.UnitType.Inch)); this.panel4.Name = "panel4"; this.panel4.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(7.5D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(2.7000000476837158D, Telerik.Reporting.Drawing.UnitType.Inch)); this.panel4.Style.BorderColor.Default = System.Drawing.Color.FromArgb(((int)(((byte)(173)))), ((int)(((byte)(221)))), ((int)(((byte)(252))))); this.panel4.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Solid; // // textBox14 // this.textBox14.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(1.0103377103805542D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.38954368233680725D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox14.Name = "textBox14"; this.textBox14.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.9937108755111694D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.19999997317790985D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox14.Value = "=Fields.Store"; // // textBox10 // this.textBox10.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(1.0103377103805542D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(1.8120609521865845D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox10.Name = "textBox10"; this.textBox10.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.9937108755111694D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.19999997317790985D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox10.Value = "=Fields.CustPhone"; // // textBox9 // this.textBox9.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(1.0103377103805542D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(1.5259628295898438D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox9.Name = "textBox9"; this.textBox9.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.993710994720459D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.19999997317790985D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox9.Value = "=Fields.CustFirstName + \" \" + Fields.CustLastName"; // // textBox8 // this.textBox8.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0.099921144545078278D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(1.5259628295898438D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox8.Name = "textBox8"; this.textBox8.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(0.72496062517166138D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.19999997317790985D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox8.Style.Font.Bold = true; this.textBox8.Style.Font.Name = "Verdana"; this.textBox8.Value = "Contact:"; // // textBox6 // this.textBox6.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(1.0103377103805542D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(1.1898593902587891D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox6.Name = "textBox6"; this.textBox6.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.9937108755111694D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.19999997317790985D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox6.Value = "=Fields.BillCountryRegion"; // // textBox4 // this.textBox4.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(1.0103377103805542D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.98978042602539062D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox4.Name = "textBox4"; this.textBox4.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.9937108755111694D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.19999997317790985D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox4.Value = "=Fields.BillPostalCode + \" \" + Fields.BillCity"; // // textBox12 // this.textBox12.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(1.0103377103805542D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.78970146179199219D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox12.Name = "textBox12"; this.textBox12.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.9937108755111694D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.19999997317790985D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox12.Value = "=IsNull(Fields.BillAddress2, \'No secondary Address\')"; // // textBox13 // this.textBox13.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(1.0103377103805542D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.58962249755859375D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox13.Name = "textBox13"; this.textBox13.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.9937108755111694D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.19999997317790985D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox13.Value = "=Fields.BillAddress1"; // // textBox11 // this.textBox11.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0.099921144545078278D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(1.8120609521865845D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox11.Name = "textBox11"; this.textBox11.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(0.72496062517166138D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.19999997317790985D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox11.Style.Font.Bold = true; this.textBox11.Style.Font.Name = "Verdana"; this.textBox11.Value = "Phone:"; // // textBox16 // this.textBox16.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(4.7736506462097168D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.389543741941452D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox16.Name = "textBox16"; this.textBox16.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(2.6291275024414062D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.19999997317790985D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox16.Value = "=Fields.Store"; // // textBox17 // this.textBox17.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(4.7736506462097168D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.58962267637252808D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox17.Name = "textBox17"; this.textBox17.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(2.6291275024414062D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.19999997317790985D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox17.Value = "=Fields.ShipAddress1"; // // textBox18 // this.textBox18.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(4.7736506462097168D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.78970146179199219D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox18.Name = "textBox18"; this.textBox18.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(2.6291275024414062D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.19999997317790985D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox18.Value = "=IsNull(Fields.ShipAddress2, \'No secondary Address\')"; // // textBox19 // this.textBox19.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(4.7736506462097168D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.98978042602539062D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox19.Name = "textBox19"; this.textBox19.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(2.6291275024414062D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.19999997317790985D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox19.Value = "=Fields.ShipPostalCode + \" \" + Fields.ShipCity + \", \" + Fields.ShipStateProvince " + ""; // // textBox21 // this.textBox21.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(4.7736506462097168D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(1.18985915184021D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox21.Name = "textBox21"; this.textBox21.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(2.6291275024414062D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.19999997317790985D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox21.Value = "=Fields.ShipCountryRegion"; // // textBox28 // this.textBox28.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(5.7430548667907715D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(2.332122802734375D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox28.Name = "textBox28"; this.textBox28.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.6736117601394653D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.19999997317790985D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox28.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle; this.textBox28.Value = "=Fields.ShipMethod"; // // textBox29 // this.textBox29.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(4.3639674186706543D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(2.332122802734375D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox29.Name = "textBox29"; this.textBox29.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.3790086507797241D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.19999997317790985D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox29.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle; this.textBox29.Value = "=Fields.PurchaseOrderNumber"; // // textBox30 // this.textBox30.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(2.3792455196380615D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(2.332122802734375D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox30.Name = "textBox30"; this.textBox30.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.9846428632736206D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.19999997317790985D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox30.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle; this.textBox30.Value = "=Fields.SalesFirstName + \" \" + Fields.SalesLastName"; // // textBox31 // this.textBox31.Format = "{0:d}"; this.textBox31.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0.099921144545078278D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(2.332122802734375D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox31.Name = "textBox31"; this.textBox31.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.1395833492279053D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.19999997317790985D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox31.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle; this.textBox31.Value = "=Now()"; // // textBox32 // this.textBox32.Format = "{0:d}"; this.textBox32.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(1.2395831346511841D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(2.332122802734375D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox32.Name = "textBox32"; this.textBox32.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.1395833492279053D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.19999997317790985D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox32.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle; this.textBox32.Value = "=Fields.OrderDate"; // // panel1 // this.panel1.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { this.textBox24, this.textBox23, this.textBox25, this.textBox26, this.textBox27}); this.panel1.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0.099921144545078278D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(2.05200457572937D, Telerik.Reporting.Drawing.UnitType.Inch)); this.panel1.Name = "panel1"; this.panel1.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(7.316746711730957D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.2800394594669342D, Telerik.Reporting.Drawing.UnitType.Inch)); this.panel1.Style.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(229)))), ((int)(((byte)(245)))), ((int)(((byte)(255))))); // // textBox24 // this.textBox24.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox24.Name = "textBox24"; this.textBox24.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.1395833492279053D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.2800000011920929D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox24.Style.Font.Bold = true; this.textBox24.Style.Font.Name = "Verdana"; this.textBox24.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(10D, Telerik.Reporting.Drawing.UnitType.Point); this.textBox24.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle; this.textBox24.Value = "Date"; // // textBox23 // this.textBox23.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(1.1396621465682983D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox23.Name = "textBox23"; this.textBox23.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.1395833492279053D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.2800000011920929D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox23.Style.Font.Bold = true; this.textBox23.Style.Font.Name = "Verdana"; this.textBox23.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle; this.textBox23.Value = "Order Date"; // // textBox25 // this.textBox25.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(2.2793638706207275D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox25.Name = "textBox25"; this.textBox25.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.9846034049987793D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.2800000011920929D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox25.Style.Font.Bold = true; this.textBox25.Style.Font.Name = "Verdana"; this.textBox25.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle; this.textBox25.Value = "Sales Person"; // // textBox26 // this.textBox26.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(4.2640457153320312D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox26.Name = "textBox26"; this.textBox26.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.3790086507797241D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.2800000011920929D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox26.Style.Font.Bold = true; this.textBox26.Style.Font.Name = "Verdana"; this.textBox26.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle; this.textBox26.Value = "Purchase Order"; // // textBox27 // this.textBox27.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(5.6431331634521484D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox27.Name = "textBox27"; this.textBox27.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.6736125946044922D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.2800000011920929D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox27.Style.Font.Bold = true; this.textBox27.Style.Font.Name = "Verdana"; this.textBox27.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle; this.textBox27.Value = "Shipment Method"; // // panel2 // this.panel2.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { this.textBox7}); this.panel2.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0.099921144545078278D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.099464893341064453D, Telerik.Reporting.Drawing.UnitType.Inch)); this.panel2.Name = "panel2"; this.panel2.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(7.3028569221496582D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.29003939032554626D, Telerik.Reporting.Drawing.UnitType.Inch)); this.panel2.Style.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(229)))), ((int)(((byte)(245)))), ((int)(((byte)(255))))); // // textBox7 // this.textBox7.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox7.Name = "textBox7"; this.textBox7.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(2.9041273593902588D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.28999999165534973D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox7.Style.Font.Bold = true; this.textBox7.Style.Font.Name = "Verdana"; this.textBox7.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle; this.textBox7.Value = "Customer Details"; // // textBox2 // this.textBox2.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0.099921144545078278D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.38958317041397095D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox2.Name = "textBox2"; this.textBox2.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(0.800000011920929D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.19999997317790985D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox2.Style.Font.Bold = true; this.textBox2.Style.Font.Name = "Verdana"; this.textBox2.Value = "Address:"; // // textBox3 // this.textBox3.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(4.0519428253173828D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.389543741941452D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox3.Name = "textBox3"; this.textBox3.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(0.72162878513336182D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.19999997317790985D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox3.Style.Font.Bold = true; this.textBox3.Style.Font.Name = "Verdana"; this.textBox3.Value = "Ship to:"; // // group1 // this.group1.GroupFooter = this.groupFooterSection1; this.group1.GroupHeader = this.groupHeaderSection1; this.group1.Name = "group1"; // // groupFooterSection1 // this.groupFooterSection1.Height = new Telerik.Reporting.Drawing.Unit(0.23541705310344696D, Telerik.Reporting.Drawing.UnitType.Inch); this.groupFooterSection1.Name = "groupFooterSection1"; this.groupFooterSection1.Style.Visible = false; // // groupHeaderSection1 // this.groupHeaderSection1.Height = new Telerik.Reporting.Drawing.Unit(1.2865371704101563D, Telerik.Reporting.Drawing.UnitType.Inch); this.groupHeaderSection1.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { this.panel5}); this.groupHeaderSection1.Name = "groupHeaderSection1"; // // panel5 // this.panel5.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { this.Text1, this.Field6, this.Text12, this.Id1, this.barcode2, this.pictureBox1, this.textBox1, this.panel3, this.Text8}); this.panel5.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0.010456085205078125D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(3.9339065551757812E-05D, Telerik.Reporting.Drawing.UnitType.Inch)); this.panel5.Name = "panel5"; this.panel5.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(19.023441314697266D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(3.2677044868469238D, Telerik.Reporting.Drawing.UnitType.Cm)); this.panel5.Style.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(240)))), ((int)(((byte)(255))))); this.panel5.Style.BorderColor.Default = System.Drawing.Color.FromArgb(((int)(((byte)(173)))), ((int)(((byte)(221)))), ((int)(((byte)(252))))); this.panel5.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Solid; // // Text1 // this.Text1.CanGrow = false; this.Text1.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(5.0309247970581055D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(0.9893181324005127D, Telerik.Reporting.Drawing.UnitType.Cm)); this.Text1.Name = "Text1"; this.Text1.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(4.852510929107666D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(1.523809552192688D, Telerik.Reporting.Drawing.UnitType.Cm)); this.Text1.Style.BackgroundColor = System.Drawing.Color.Empty; this.Text1.Style.BorderColor.Default = System.Drawing.Color.Black; this.Text1.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.None; this.Text1.Style.Color = System.Drawing.Color.Black; this.Text1.Style.Font.Bold = false; this.Text1.Style.Font.Italic = false; this.Text1.Style.Font.Name = "Verdana"; this.Text1.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(8D, Telerik.Reporting.Drawing.UnitType.Point); this.Text1.Style.Font.Strikeout = false; this.Text1.Style.Font.Underline = false; this.Text1.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Left; this.Text1.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Top; this.Text1.Style.Visible = true; this.Text1.Value = "275 Grove St., Suite 2-400, Newton, MA 02466\r\nPhone: +1.888.365.2779\r\nFax: +1.617" + ".249.2116"; // // Field6 // this.Field6.CanGrow = false; this.Field6.Format = "{0:d}"; this.Field6.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(16.280376434326172D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(2.2130587100982666D, Telerik.Reporting.Drawing.UnitType.Cm)); this.Field6.Name = "Field6"; this.Field6.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(2.7429654598236084D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(0.5D, Telerik.Reporting.Drawing.UnitType.Cm)); this.Field6.Style.BackgroundColor = System.Drawing.Color.Empty; this.Field6.Style.BorderColor.Default = System.Drawing.Color.Black; this.Field6.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.None; this.Field6.Style.Color = System.Drawing.Color.OrangeRed; this.Field6.Style.Font.Bold = true; this.Field6.Style.Font.Italic = false; this.Field6.Style.Font.Name = "Verdana"; this.Field6.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(10D, Telerik.Reporting.Drawing.UnitType.Point); this.Field6.Style.Font.Strikeout = false; this.Field6.Style.Font.Underline = false; this.Field6.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Left; this.Field6.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Bottom; this.Field6.Style.Visible = true; this.Field6.Value = "=Now()"; // // Text12 // this.Text12.CanGrow = false; this.Text12.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(10.177068710327148D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(2.2130589485168457D, Telerik.Reporting.Drawing.UnitType.Cm)); this.Text12.Name = "Text12"; this.Text12.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(2.6963250637054443D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(0.5D, Telerik.Reporting.Drawing.UnitType.Cm)); this.Text12.Style.BackgroundColor = System.Drawing.Color.Empty; this.Text12.Style.BorderColor.Default = System.Drawing.Color.Black; this.Text12.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.None; this.Text12.Style.Color = System.Drawing.Color.Black; this.Text12.Style.Font.Bold = true; this.Text12.Style.Font.Italic = false; this.Text12.Style.Font.Name = "Verdana"; this.Text12.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(10D, Telerik.Reporting.Drawing.UnitType.Point); this.Text12.Style.Font.Strikeout = false; this.Text12.Style.Font.Underline = false; this.Text12.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Right; this.Text12.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Bottom; this.Text12.Style.Visible = true; this.Text12.Value = "Sales Order:"; // // Id1 // this.Id1.CanGrow = false; this.Id1.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(12.8735933303833D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(2.2130589485168457D, Telerik.Reporting.Drawing.UnitType.Cm)); this.Id1.Name = "Id1"; this.Id1.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(2.0355603694915771D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(0.5D, Telerik.Reporting.Drawing.UnitType.Cm)); this.Id1.Style.BackgroundColor = System.Drawing.Color.Empty; this.Id1.Style.BorderColor.Default = System.Drawing.Color.Black; this.Id1.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.None; this.Id1.Style.Color = System.Drawing.Color.OrangeRed; this.Id1.Style.Font.Bold = true; this.Id1.Style.Font.Italic = false; this.Id1.Style.Font.Name = "Verdana"; this.Id1.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(11D, Telerik.Reporting.Drawing.UnitType.Point); this.Id1.Style.Font.Strikeout = false; this.Id1.Style.Font.Underline = false; this.Id1.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Left; this.Id1.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Bottom; this.Id1.Style.Visible = true; this.Id1.Value = "=Fields.SalesOrderID"; // // barcode2 // this.barcode2.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(12.792195320129395D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(0.24975340068340302D, Telerik.Reporting.Drawing.UnitType.Cm)); this.barcode2.Name = "barcode2"; this.barcode2.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(6.2312464714050293D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(1.7093372344970703D, Telerik.Reporting.Drawing.UnitType.Cm)); this.barcode2.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Center; this.barcode2.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Bottom; this.barcode2.Value = "=Fields.PurchaseOrderNumber"; // // pictureBox1 // this.pictureBox1.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0.18954388797283173D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.078749977052211761D, Telerik.Reporting.Drawing.UnitType.Inch)); this.pictureBox1.MimeType = "image/jpeg"; this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.6123565435409546D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.71079403162002563D, Telerik.Reporting.Drawing.UnitType.Inch)); this.pictureBox1.Style.BorderColor.Default = System.Drawing.Color.FromArgb(((int)(((byte)(173)))), ((int)(((byte)(221)))), ((int)(((byte)(252))))); this.pictureBox1.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Solid; this.pictureBox1.Style.BorderWidth.Default = new Telerik.Reporting.Drawing.Unit(1D, Telerik.Reporting.Drawing.UnitType.Point); this.pictureBox1.Value = ((object)(resources.GetObject("pictureBox1.Value"))); // // textBox1 // this.textBox1.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(1.9809513092041016D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.0983281135559082D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox1.Name = "textBox1"; this.textBox1.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.9106760025024414D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.29121589660644531D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox1.Style.Color = System.Drawing.Color.FromArgb(((int)(((byte)(44)))), ((int)(((byte)(90)))), ((int)(((byte)(184))))); this.textBox1.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(16D, Telerik.Reporting.Drawing.UnitType.Point); this.textBox1.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Left; this.textBox1.Value = "AdventureWorks"; // // panel3 // this.panel3.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(3.9418537198798731E-05D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(1.0682121515274048D, Telerik.Reporting.Drawing.UnitType.Inch)); this.panel3.Name = "panel3"; this.panel3.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(7.4895052909851074D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.21828572452068329D, Telerik.Reporting.Drawing.UnitType.Inch)); this.panel3.Style.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(229)))), ((int)(((byte)(255))))); // // Text8 // this.Text8.CanGrow = false; this.Text8.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(14.909354209899902D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(2.2130589485168457D, Telerik.Reporting.Drawing.UnitType.Cm)); this.Text8.Name = "Text8"; this.Text8.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.3708218336105347D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(0.5D, Telerik.Reporting.Drawing.UnitType.Cm)); this.Text8.Style.BackgroundColor = System.Drawing.Color.Empty; this.Text8.Style.BorderColor.Default = System.Drawing.Color.Black; this.Text8.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.None; this.Text8.Style.Color = System.Drawing.Color.Black; this.Text8.Style.Font.Bold = true; this.Text8.Style.Font.Italic = false; this.Text8.Style.Font.Name = "Verdana"; this.Text8.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(10D, Telerik.Reporting.Drawing.UnitType.Point); this.Text8.Style.Font.Strikeout = false; this.Text8.Style.Font.Underline = false; this.Text8.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Right; this.Text8.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Bottom; this.Text8.Style.Visible = true; this.Text8.Value = "Date:"; // // InvoicesDataSource // this.InvoicesDataSource.ConnectionString = "Telerik.Reporting.Examples.CSharp.Properties.Settings.TelerikConnectionString"; this.InvoicesDataSource.Name = "Invoices"; this.InvoicesDataSource.Parameters.AddRange(new Telerik.Reporting.SqlDataSourceParameter[] { new Telerik.Reporting.SqlDataSourceParameter("@SalesOrderNumber", System.Data.DbType.String, "=Parameters.OrderNumber.Value")}); this.InvoicesDataSource.SelectCommand = resources.GetString("InvoicesDataSource.SelectCommand"); // // pageFooterSection1 // this.pageFooterSection1.Height = new Telerik.Reporting.Drawing.Unit(0.1875D, Telerik.Reporting.Drawing.UnitType.Inch); this.pageFooterSection1.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { this.textBox5, this.textBox22}); this.pageFooterSection1.Name = "pageFooterSection1"; this.pageFooterSection1.Style.BorderColor.Default = System.Drawing.Color.FromArgb(((int)(((byte)(173)))), ((int)(((byte)(221)))), ((int)(((byte)(252))))); this.pageFooterSection1.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Solid; this.pageFooterSection1.Style.BorderWidth.Default = new Telerik.Reporting.Drawing.Unit(1D, Telerik.Reporting.Drawing.UnitType.Pixel); // // textBox5 // this.textBox5.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox5.Name = "textBox5"; this.textBox5.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(3.40625D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.1875D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox5.Style.BackgroundColor = System.Drawing.Color.Empty; this.textBox5.Style.Color = System.Drawing.Color.FromArgb(((int)(((byte)(44)))), ((int)(((byte)(90)))), ((int)(((byte)(184))))); this.textBox5.Style.Font.Italic = false; this.textBox5.Value = "=PageExec(\"lineTotalDataTextBox\",Count(Fields.ProductNumber)) + \" products, \" + P" + "ageExec(\"lineTotalDataTextBox\",Sum(Fields.OrderQty)) + \" items on page \" + Page" + "Number"; // // textBox22 // this.textBox22.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(5.2715086936950684D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(3.9418537198798731E-05D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox22.Name = "textBox22"; this.textBox22.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(2.1312694549560547D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.18742115795612335D, Telerik.Reporting.Drawing.UnitType.Inch)); this.textBox22.Style.Color = System.Drawing.Color.FromArgb(((int)(((byte)(44)))), ((int)(((byte)(90)))), ((int)(((byte)(184))))); this.textBox22.Style.Font.Italic = false; this.textBox22.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Right; this.textBox22.Value = "=PageExec(\"lineTotalDataTextBox\",sum(LineTotal))"; this.textBox22.Format = "{0:C2}"; // // subReport1 // this.subReport1.KeepTogether = false; this.subReport1.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(7.8837074397597462E-05D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(2.8858587741851807D, Telerik.Reporting.Drawing.UnitType.Inch)); this.subReport1.Name = "subReport1"; this.subReport1.Parameters.Add(new Telerik.Reporting.Parameter("SaledOrderID", "=Fields.SalesOrderID")); this.subReport1.ReportSource = this.salesOrderDetails1; this.subReport1.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(7.4999217987060547D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.27500006556510925D, Telerik.Reporting.Drawing.UnitType.Inch)); // // salesOrderDetails1 // this.salesOrderDetails1.Name = "salesOrderDetails1"; // // Invoice // this.DataSource = this.InvoicesDataSource; this.Filters.AddRange(new Telerik.Reporting.Data.Filter[] { new Telerik.Reporting.Data.Filter("=Fields.SalesOrderNumber", Telerik.Reporting.Data.FilterOperator.Equal, "=Parameters.OrderNumber.Value")}); this.Groups.AddRange(new Telerik.Reporting.Group[] { this.group1}); this.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { this.groupHeaderSection1, this.groupFooterSection1, this.detail, this.pageFooterSection1}); this.PageSettings.Landscape = false; this.PageSettings.Margins.Bottom = new Telerik.Reporting.Drawing.Unit(0.5D, Telerik.Reporting.Drawing.UnitType.Inch); this.PageSettings.Margins.Left = new Telerik.Reporting.Drawing.Unit(0.5D, Telerik.Reporting.Drawing.UnitType.Inch); this.PageSettings.Margins.Right = new Telerik.Reporting.Drawing.Unit(0.5D, Telerik.Reporting.Drawing.UnitType.Inch); this.PageSettings.Margins.Top = new Telerik.Reporting.Drawing.Unit(0.5D, Telerik.Reporting.Drawing.UnitType.Inch); this.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.Letter; reportParameter1.AutoRefresh = true; reportParameter1.AvailableValues.DataSource = this.OrderNumbersDataSource; reportParameter1.AvailableValues.DisplayMember = "SalesOrderNumber"; reportParameter1.AvailableValues.Sortings.AddRange(new Telerik.Reporting.Data.Sorting[] { new Telerik.Reporting.Data.Sorting("=Fields.SalesOrderNumber", Telerik.Reporting.Data.SortDirection.Asc)}); reportParameter1.AvailableValues.ValueMember = "SalesOrderNumber"; reportParameter1.Name = "OrderNumber"; reportParameter1.Text = "Order #"; reportParameter1.Value = "=First(Fields.SalesOrderNumber)"; reportParameter1.Visible = true; reportParameter2.Name = "ForYear"; reportParameter2.Type = Telerik.Reporting.ReportParameterType.Integer; reportParameter2.Value = "=2003"; reportParameter3.Name = "ForMonth"; reportParameter3.Type = Telerik.Reporting.ReportParameterType.Integer; reportParameter3.Value = "=7"; this.ReportParameters.Add(reportParameter1); this.ReportParameters.Add(reportParameter2); this.ReportParameters.Add(reportParameter3); this.Style.BackgroundColor = System.Drawing.Color.White; this.Width = new Telerik.Reporting.Drawing.Unit(7.5000009536743164D, Telerik.Reporting.Drawing.UnitType.Inch); ((System.ComponentModel.ISupportInitialize)(this.salesOrderDetails1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); }
/// <summary> /// Builds the report. /// </summary> /// <param name="reportDocument">The report document.</param> public void BuildReport(ICustomReport reportDocument) { var currentReport = reportDocument.Reports.First(); SetIdentity(currentReport); //_originalPageHeaderHeight = ((PageHeaderSection) currentReport.Items["pageHeader"]).Height; //This report parameter holds the current template system name. _processName = currentReport.ReportParameters["processName"].Value.ToString(); //This report parameter holds the currently visible columns of the grid and in what order they're in var cols = currentReport.ReportParameters["columns"].Value.ToString(); var columns = cols.Split(';').ToList(); _columns = new List<ColumnInfo>(); foreach (var col in columns) { _columns.Add(new ColumnInfo(col)); } var groupsStr = currentReport.ReportParameters["groups"].Value.ToString(); _groups = (string.IsNullOrEmpty(groupsStr) ? new string[0] : groupsStr.Split(';')).ToList(); //TODO: Uncomment if needed // _columns.AddRange(_groups); if (reportDocument.FitToPage) { if (currentReport.GetType().Name.ToLower().Contains("landscape")) { FitToPageColumnWidth = Math.Min(1, 10.0 / _columns.Count); FitToPageColumnCount = (short) Math.Max(10, _columns.Count); } if (currentReport.GetType().Name.ToLower().Contains("portrait")) { FitToPageColumnWidth = Math.Min(1.1, 7.0 / _columns.Count); FitToPageColumnCount = (short) Math.Max(7, _columns.Count); } currentReport.Width = new Unit(_columns.Count * FitToPageColumnWidth, UnitType.Inch); } _groupColumn = currentReport.ReportParameters["groupColumn"].Value.ToString(); var fldList = new List<FieldInfo>(_columns.Count); var processProperties = new Dictionary<PropertyInfo, string>(); var processType = TheDynamicTypeManager.GetInfoType<IInfoClass>(_processName); if (processType != null) { processProperties = processType.GetAllPropertiesWithPaths(); var properties = processProperties.Where(p => _columns.Any(c=>c.SystemName == p.Value)); foreach (var column in _columns) { foreach (var property in properties) { if (property.Value == column.SystemName) { fldList.Add(new FieldInfo(property.Key, column)); break; } } } _fieldAttrDict = GetFieldAttributes(processProperties.Select(x => x.Key)); } if (_fieldAttrDict == null) _fieldAttrDict = new Dictionary<PropertyInfo, FieldParametres>(); _colDict = new SortedDictionary<int, string[]>(); //Grouping foreach (var colName in _groups) { var group = new Telerik.Reporting.Group(); group.Name = colName; var groupHeaderSection = new GroupHeaderSection(); var groupFooterSection = new GroupFooterSection(); group.GroupHeader = groupHeaderSection; group.GroupFooter = groupFooterSection; var txt = new TextBox(); txt.Style.Font.Size = new Unit(10, UnitType.Point); txt.Style.Font.Bold = true; txt.Style.BackgroundColor = Color.FromArgb(255, 225, 225, 225); txt.Style.TextAlign = HorizontalAlign.Left; txt.Style.VerticalAlign = VerticalAlign.Middle; groupHeaderSection.Items.Add(txt); groupHeaderSection.Height = new Unit(21); groupHeaderSection.Style.BorderStyle.Default = BorderType.Solid; groupHeaderSection.Style.BorderColor.Default = Color.White; groupHeaderSection.Style.BorderColor.Left = Color.Transparent; var panel = new Panel(); panel.Height = new Unit(20); panel.Style.LineStyle = LineStyle.Solid; panel.Style.LineWidth = new Unit(2.0); panel.Style.BorderColor.Default = Color.Black; panel.Style.BorderWidth.Default = new Unit(2.0); panel.Style.BorderStyle.Default = BorderType.None; panel.Style.BorderStyle.Top = BorderType.Solid; panel.Style.BorderStyle.Bottom = BorderType.Solid; groupFooterSection.Items.Add(panel); groupFooterSection.Height = new Unit(25); //groupFooterSection.Style.BorderStyle.Default = BorderType.Solid; //groupFooterSection.Style.BorderColor.Default = Color.White; groupFooterSection.Style.BorderColor.Left = Color.Transparent; groupFooterSection.Style.Padding.Top = new Unit(2); groupFooterSection.Style.Padding.Bottom = new Unit(2); //if you need to filter the data, apply filtering //group1.Filters.Add(new Telerik.Reporting.Data.Filter("=Fields.ProductID", Telerik.Reporting.Data.FilterOperator.Equal, "=10")); currentReport.Groups.Add(group); } var aggregateData = currentReport.ReportParameters["aggregates"].Value.ToString(); _aggregateDict = ParseAggregateData(aggregateData); var nextLeft = _groups.Count > 0 ? (_groups.Count - 1) * 0.15 : 0; var availableWidth = currentReport.Width.Value - nextLeft; var ctrlSize = availableWidth / (fldList.Count() - _groups.Count); _indentOffset = 0; _reportItemCounter = new Dictionary<string, int>(); var counter = 0; double fitToPageFooterLocationX = 0; //posess fields foreach (var fld in fldList) { if (_reportItemCounter.ContainsKey(fld.Property.Name)) { continue; } var fieldValueMap = GetFieldValueMap(currentReport, fld.Property, processProperties[fld.Property]); if (_groups.Contains(processProperties[fld.Property] ?? string.Empty)) { //create group var fieldGroup = currentReport.Groups.FirstOrDefault(x => x.Name == processProperties[fld.Property]); if (fieldGroup != null) { _indentOffset = 0.15 * _groups.IndexOf(processProperties[fld.Property]); fieldGroup.Groupings.Add(new Grouping(fieldValueMap)); ((TextBox)fieldGroup.GroupHeader.Items[0]).Value = string.Format("=' ' + {0} + ' Total: ' + Exec('{1}', Count(IsNull({0},1)))", fieldValueMap.TrimStart('='), fieldGroup.Name); ((TextBox)fieldGroup.GroupHeader.Items[0]).Location = new PointU(new Unit(_indentOffset, UnitType.Inch), new Unit(0, UnitType.Inch)); ((TextBox)fieldGroup.GroupHeader.Items[0]).Size = new SizeU(new Unit(currentReport.Width.Value - _indentOffset, UnitType.Inch), new Unit(20, UnitType.Pixel)); //AddGroupLevelLines(fieldGroup.GroupHeader.Items); ((Panel)fieldGroup.GroupFooter.Items[0]).Location = new PointU(new Unit(_indentOffset, UnitType.Inch), new Unit(0, UnitType.Inch)); ((Panel)fieldGroup.GroupFooter.Items[0]).Size = new SizeU(new Unit(currentReport.Width.Value - _indentOffset, UnitType.Inch), new Unit(20, UnitType.Pixel)); //AddGroupLevelLines(fieldGroup.GroupFooter.Items); } continue; } var cPoint = new PointU(new Unit(nextLeft, UnitType.Inch), new Unit(0.4, UnitType.Inch)); var uSize = new SizeU(new Unit(ctrlSize, UnitType.Inch), new Unit(0.2, UnitType.Inch)); var attr = fld.Property.GetCustomAttributes(false); var displayAttr = attr.FirstOrDefault(x => x is DisplayAttribute) as DisplayAttribute; string colName = "<NoName>"; if (displayAttr == null) { colName = fld.Column.Header; //var infoInstance = Activator.CreateInstance(processType); //if (infoInstance != null) //{ // var field = processType.GetField(fld.Name + "Property"); // if (field != null) // { // var fieldValue = field.GetValue(infoInstance) as IPropertyInfo; // if (fieldValue != null) // { // colName = fieldValue.FriendlyName; // } // } //} } else { colName = displayAttr.GetName(); } var headerLabel = new TextBox { Value = colName, Location = cPoint, Size = uSize, StyleName = "Caption", Multiline = true, CanGrow = true }; headerLabel.Style.BackgroundColor = Color.Transparent; headerLabel.Style.Font.Size = new Unit(10, UnitType.Point); headerLabel.Style.VerticalAlign = VerticalAlign.Top; var dataTextBox = new TextBox(); var dataTextBoxName = string.Format("{0}TextBox", processProperties[fld.Property]); dataTextBox.Name = dataTextBoxName; var propertyName = processProperties[fld.Property]; var isExistsBackgroudColor = processProperties.Any(x => x.Key.Name == propertyName + Constants.FieldBackColorPostfix); dataTextBox.TextWrap = true; dataTextBox.Location = new PointU(new Unit(nextLeft, UnitType.Inch), new Unit(0, UnitType.Inch)); dataTextBox.Size = uSize; dataTextBox.CanGrow = true; if (isExistsBackgroudColor) { if (fieldValueMap.StartsWith("=")) { fieldValueMap = fieldValueMap.Remove(0, 1); fieldValueMap = string.Format("=GetValueWithBackgroundColor({0}, Fields.[{1}{2}])", fieldValueMap, processProperties[fld.Property], Constants.FieldBackColorPostfix); EventHandler itemDataBoundHandler = (sender, args) => { var textBox = sender as Telerik.Reporting.Processing.TextBox; if (textBox == null) { return; } var colorAsLong = ((KeyValuePair<object, long>)textBox.Value).Value; if (colorAsLong != 0) { var bytes = BitConverter.GetBytes(colorAsLong); if (bytes[3] == 0) bytes[3] = 255; var color = Color.FromArgb(bytes[3], bytes[2], bytes[1], bytes[0]); ((Telerik.Reporting.Processing.ProcessingElement)sender).Style.BackgroundColor = color; } textBox.Value = ((KeyValuePair<object, long>)textBox.Value).Key; }; dataTextBox.ItemDataBound += itemDataBoundHandler; EventHandler dataTextBoxDisposedHandler = null; dataTextBoxDisposedHandler = (sender, args) => { dataTextBox.ItemDataBound -= itemDataBoundHandler; dataTextBox.Disposed -= dataTextBoxDisposedHandler; }; dataTextBox.Disposed += dataTextBoxDisposedHandler; } } dataTextBox.Value = fieldValueMap; if (!reportDocument.FitToPage) { dataTextBox.ItemDataBound += OnItemDataBound; EventHandler dataTextBoxDisposedHandler = null; dataTextBoxDisposedHandler = (sender, args) => { dataTextBox.ItemDataBound -= OnItemDataBound; dataTextBox.Disposed -= dataTextBoxDisposedHandler; }; dataTextBox.Disposed += dataTextBoxDisposedHandler; } var pictureBox = new PictureBox { Value = fieldValueMap }; pictureBox.Name = string.Format("{0}TextBox", processProperties[fld.Property]); pictureBox.Sizing = ImageSizeMode.ScaleProportional; if (!reportDocument.FitToPage) { pictureBox.ItemDataBound += OnItemDataBound; EventHandler pictureBoxDisposedHandler = null; pictureBoxDisposedHandler = (sender, args) => { pictureBox.ItemDataBound -= OnItemDataBound; pictureBox.Disposed -= pictureBoxDisposedHandler; }; pictureBox.Disposed += pictureBoxDisposedHandler; } nextLeft = nextLeft + ctrlSize; if (reportDocument.FitToPage) { currentReport.Items["labelsGroupHeaderSection"].Items.Add(headerLabel); } else { currentReport.Items["pageHeader"].Items.Add(headerLabel); } if (_fieldAttrDict[fld.Property].FieldEditor == "Image") { currentReport.Items["detail"].Items["rowPanel"].Items.Add(pictureBox); } else { currentReport.Items["detail"].Items["rowPanel"].Items.Add(dataTextBox); } _reportItemCounter.Add(processProperties[fld.Property], 0); if (reportDocument.FitToPage) { _colDict.Add(currentReport.Items["labelsGroupHeaderSection"].Items.Count - 1, new[] { processProperties[fld.Property], headerLabel.Value }); } else { _colDict.Add(currentReport.Items["pageHeader"].Items.Count - 1, new[] { processProperties[fld.Property], headerLabel.Value }); } if (reportDocument.FitToPage) { fitToPageFooterLocationX = counter % FitToPageColumnCount == 0 ? 0 : fitToPageFooterLocationX; if (_aggregateDict.Keys.All(x => x != fld.Property.Name)) { var footerTextBox = new TextBox { Name = string.Format("{0}{1}FooterTextBox", fld.Property.Name, fldList.IndexOf(fld)), Location = new PointU(new Unit(fitToPageFooterLocationX, UnitType.Inch), new Unit(0, UnitType.Inch)), Size = new SizeU(new Unit(FitToPageColumnWidth, UnitType.Inch), new Unit(0.15, UnitType.Inch)) }; currentReport.Items["pageFooter"].Items.Add(footerTextBox); } //calculate server-side aggregates var aggregateDefinitions = _aggregateDict.ToList() .SelectMany(i => i.Value) .Where(d => !AggregateHelper.IsPageAggregateType(d.SummaryType)) .ToList(); var queryCriteria = new AggregateDataSourceQueryCriteria { ProcessName = _processName, FilterDefinition = GetFilterDefinition(currentReport) }; var serverAggregateResults = AggregateProcessor.CalculateAggregates(aggregateDefinitions, queryCriteria); foreach (var aggregateItem in _aggregateDict) { if (aggregateItem.Key != fld.Property.Name) { continue; } double fitToPageFooterLocationY = 0; for (var i = 0; i < aggregateItem.Value.Count; i++) { var footerTextBox = new TextBox { Name = string.Format("{0}{1}FooterTextBox", fld.Property.Name, aggregateItem.Value[i].SummaryType), // telerik recommends set unique names for all controls Size = new SizeU(new Unit(GetWidthFitToPage(fld.Property.Name, i), UnitType.Inch), new Unit(0.15, UnitType.Inch)), Location = new PointU(new Unit(fitToPageFooterLocationX, UnitType.Inch), new Unit(fitToPageFooterLocationY, UnitType.Inch)) }; if (AggregateHelper.IsPageAggregateType(aggregateItem.Value[i].SummaryType)) { footerTextBox.Value = string.Format(@"='{0}: ' + AfterCalculateAggregates(PageExec('{1}TextBox', {2}(BeforeCalculateAggregates(Fields.[{1}], ""{2}"", ""{3}"", ""{4}"", ""{5}"", ""{6}""))), ""{2}"", ""{3}"", ""{4}"", ""{5}"", ""{6}"")", AggregateProcessor.GetAggregateFunctionShortName(aggregateItem.Value[i].SummaryType), aggregateItem.Key, aggregateItem.Value[i].SummaryType, aggregateItem.Value[i].CustomConverter, aggregateItem.Value[i].TargetType, aggregateItem.Value[i].TypeName, aggregateItem.Value[i].ConverterParameter); } else { var result = serverAggregateResults.FirstOrDefault(r => r.ColumnName == aggregateItem.Key && r.SummaryType == aggregateItem.Value[i].SummaryType); footerTextBox.Value = string.Format("{0}: {1}", AggregateHelper.GetAttribute(aggregateItem.Value[i].SummaryType).ShortName, result != null ? result.Value : Constants.Empty); } if (aggregateItem.Value[i].SummaryType == SummaryTypes.Count) { footerTextBox.Bindings.Add(new Binding("Visible", string.Format(@"=IIf(PageExec(""{0}"", Count(Fields.{1})) = 0, False, True)", dataTextBoxName, fld.Property.Name))); } if (aggregateItem.Value[i].SummaryType == SummaryTypes.Min || aggregateItem.Value[i].SummaryType == SummaryTypes.Max) { if (fld.Property.PropertyType != typeof(bool) && fld.Property.PropertyType != typeof(bool?))//VRN-5079 { footerTextBox.Bindings.Add(new Binding("Visible", string.Format(@"=FooterTextBoxVisibilityWithValue(PageExec(""{0}"", Min(Fields.{1})))", dataTextBoxName, fld.Property.Name))); } } fitToPageFooterLocationY += 0.15; currentReport.Items["pageFooter"].Items.Add(footerTextBox); } } fitToPageFooterLocationX += FitToPageColumnWidth; counter++; } } if (reportDocument.FitToPage) { var max = _aggregateDict.Count == 0 ? 0 : _aggregateDict.Max(x => x.Value.Count); if (max != 0) { ((PageFooterSection) currentReport.Items["pageFooter"]).Height = new Unit(max*0.15 + 0.2, UnitType.Inch); } currentReport.Items["pageFooter"].Items["currentTimeTextBox"].Visible = false; currentReport.Items["pageFooter"].Items["pageInfoTextBox"].Visible = false; } _indentOffset = _groups.Count > 0 ? (_groups.Count - 1) * 0.15 : 0; //AddGroupLevelLines(currentReport.Items["detail"].Items["rowPanel"].Items); }