public void MakeDocument(ReportDocument reportDocument) { TextStyle.ResetStyles(); TextStyle.Normal.Size = 7.5f; TextStyle.Heading1.Size = 16; TextStyle.Heading1.Bold = false; TextStyle.TableHeader.BackgroundBrush = Brushes.Gray; TextStyle.TableHeader.Brush = Brushes.White; TextStyle.TableHeader.MarginNear = 0.1f; TextStyle.TableHeader.MarginFar = 0.1f; TextStyle.TableHeader.MarginTop = 0.05f; TextStyle.TableHeader.MarginBottom = 0.05f; TextStyle.TableRow.MarginNear = 0.1f; TextStyle.TableRow.MarginFar = 0.1f; TextStyle.TableRow.MarginTop = 0.05f; ReportBuilder builder = new ReportBuilder(reportDocument); builder.StartLinearLayout(Direction.Vertical); Pen innerPen = new Pen(Color.Green, 0.02f); //DataView dv = SampleReportMaker1.GetDataView(); DataView dv = _dt.DefaultView; builder.AddPageHeader("Người tạo: Đỗ Đình Vương", String.Empty, "Trang %p"); builder.AddPageHeaderLine(); builder.AddText(_reportName); builder.AddText("àd"); builder.PageHeader.MarginRight = 00; builder.PageHeader.UseFullWidth = true; builder.CurrentContainer.UseFullWidth = true; //builder.AddText("Table with lines using default lines\n"); // Following line sets up the pen used for lins for tables builder.DefaultTablePen = reportDocument.ThinPen; builder.AddTable(dv, true); builder.CurrentSection.HorizontalAlignment = HorizontalAlignment.Left; foreach (DataColumn column in _dt.Columns) { //builder.AddColumn(column.ColumnName, column.ColumnName, 1.8f, true, true); builder.AddColumn(column.ColumnName, column.ColumnName, 1f, true, true); } builder.CurrentDocument.Body.UseFullWidth = true; builder.FinishLinearLayout(); }
public void MakeDocument(ReportDocument reportDocument) { // Always reset the text styles if you have multiple methods that // set them int height = 0; int sor_magas = 6; TextStyle.ResetStyles(); SectionBox box; LinearSections contents; //TextStyle.Normal.BackgroundBrush = Brushes.Beige; Szamla iSzamla = new Szamla(_SzamlaId); // Create a ReportBuilder object that assists with building a report ReportBuilder builder = new ReportBuilder(reportDocument); builder.CurrentDocument.DocumentUnit = GraphicsUnit.Millimeter; // Before adding sections, a layout must be started. // We are using a linear layout - vertically, which means // each new section starts below the last one. builder.HorizLineMargins = 0.2f; builder.StartLinearLayout(Direction.Vertical); builder.AddPageHeader("ALL-IN Cafe", String.Empty, iSzamla.SZAMLA_DATUMA.ToShortDateString() + " " + iSzamla.SZAMLA_DATUMA.ToLongTimeString()); height += sor_magas; #region fejlec builder.StartLayeredLayout(false, false); // Add various text sections in different headings box = new SectionBox(); box.Width = 80; box.Height = 10; box.OffsetLeft = 0; box.OffsetTop = 0; //box.Border. //box.Background = Brushes.Ivory; contents = new LinearSections(); contents.AddSection(new SectionText((string)Syspar2.GetValue(ParamCodes.CEG_NEV), TextStyle.Heading1)); contents.AddSection(new SectionText((string)Syspar2.GetValue(ParamCodes.CEG_CIM), TextStyle.Normal)); box.AddSection(contents); builder.AddSection(box); height += 10; // Logo box = new SectionBox(); box.Width = 40; box.Height = 10; box.OffsetLeft = 80; box.OffsetTop = 0; box.HorizontalAlignment = HorizontalAlignment.Center; // box.VerticalAlignment = VerticalAlignment.Bottom; //box.Border = reportDocument.NormalPen; SectionImage image; try { image = new SectionImage(Image.FromFile((string)Syspar2.GetValue(ParamCodes.BLOKK_LOGO_PATH))); } catch (Exception ix) { DEFS.ExLog(ix.Message + "\n" + ix.StackTrace); image = new SectionImage(global::GUI.Properties.Resources.logo); } //image.Transparency = 50; //image.PreserveAspectRatio = false; box.AddSection(image); builder.AddSection(box); // Finish a layout that we started // builder.FinishLayeredLayout(); // builder.FinishLayeredLayout(); #endregion builder.AddText("Blokk sorszáma: "+ iSzamla.SZAMLA_SORSZAM.PadLeft(7,'0'), TextStyle.Normal); builder.AddText(" "); height += 2 * sor_magas; builder.StartLayeredLayout(false, false); if (DateTime.Now >= Convert.ToDateTime(new DateTime(2010, 1, 1))) { // Tesztüzem SectionBox box_teszt = new SectionBox(); box_teszt.WidthPercent = 30; //box.Height = 1; box_teszt.HorizontalAlignment = HorizontalAlignment.Center; box.VerticalAlignment = VerticalAlignment.Top; //box.Border = reportDocument.NormalPen; SectionImage image_teszt = new SectionImage(global::GUI.Properties.Resources.tesztuzem); image_teszt.Transparency = 80; //image.PreserveAspectRatio = false; box_teszt.AddSection(image_teszt); builder.AddSection(box_teszt); } #region sorok DataView dv = iSzamla.GetBlokkDataView(); builder.DefaultTablePen = null; // ide még kell egy faktor ami a sortöréseket határozza meg. height += sor_magas * dv.Count; builder.AddTable(dv, true, 100); builder.Table.InnerPenHeaderBottom = reportDocument.NormalPen; builder.Table.InnerPenRow = new Pen(Color.Gray, reportDocument.ThinPen.Width); builder.Table.OuterPenBottom = new Pen(Color.Gray, reportDocument.ThinPen.Width); builder.AddColumn(dv.Table.Columns[0], "Db.", 8, false, false, HorizontalAlignment.Left); builder.AddColumn(dv.Table.Columns[1], "Termék", 30, false, false, HorizontalAlignment.Left); builder.AddColumn(dv.Table.Columns[2], "Összeg", 40, false, false, HorizontalAlignment.Right); //dt.Columns.Add(, typeof(int)); //dt.Columns.Add("Cikk", typeof(string)); //dt.Columns.Add("Összeg", typeof(double)); // builder.AddAllColumns(30.0f, true, true); builder.CurrentSection.HorizontalAlignment = HorizontalAlignment.Left; #endregion builder.FinishLayeredLayout(); #region végösszesen DataView dv2 = iSzamla.GetBlokkOsszegDataView(); builder.DefaultTablePen = null; builder.AddTable(dv2, true, 100); height += sor_magas * dv2.Count; builder.AddColumn(dv2.Table.Columns[0], " ", 50, false, false, HorizontalAlignment.Right); builder.AddColumn(dv2.Table.Columns[1], " ", 30, false, false, HorizontalAlignment.Right); #endregion builder.AddText(" "); builder.AddText((string)Syspar2.GetValue(ParamCodes.BLOKK_LABLEC1), TextStyle.Normal); builder.AddText((string)Syspar2.GetValue(ParamCodes.BLOKK_LABLEC2), TextStyle.Normal); builder.AddText((string)Syspar2.GetValue(ParamCodes.BLOKK_LABLEC3), TextStyle.Normal); //builder.AddText((string)Syspar2.GetValue(ParamCodes.BLOKK_LABLEC4), TextStyle.Normal); height += sor_magas * ((Syspar2.GetValue(ParamCodes.BLOKK_LABLEC1).ToString().Length / 45) + 1); height += sor_magas * ((Syspar2.GetValue(ParamCodes.BLOKK_LABLEC2).ToString().Length / 45) + 1); height += sor_magas * ((Syspar2.GetValue(ParamCodes.BLOKK_LABLEC3).ToString().Length / 45) + 1); //height += sor_magas * (((string)Syspar2.GetValue(ParamCodes.BLOKK_LABLEC4).Length / 45) + 1); height += sor_magas; builder.CurrentDocument.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize("Custom", DEFS.MMtoInch(75), DEFS.MMtoInch(height)); builder.CurrentDocument.DefaultPageSettings.Margins = new System.Drawing.Printing.Margins(DEFS.MMtoInch(1), DEFS.MMtoInch(1), DEFS.MMtoInch(1), DEFS.MMtoInch(1)); builder.FinishLinearLayout(); }
public void MakeDocument(ReportDocument reportDocument) { // Always reset the text styles if you have multiple methods that // set them TextStyle.ResetStyles(); SectionBox box; LinearSections contents; int h_height = 0; int sor_magas = 6; //TextStyle.Normal.BackgroundBrush = Brushes.Beige; //Szamla iSzamla = new Szamla(_SzamlaId); // Create a ReportBuilder object that assists with building a report ReportBuilder builder = new ReportBuilder(reportDocument); builder.CurrentDocument.DocumentUnit = GraphicsUnit.Millimeter; // Before adding sections, a layout must be started. // We are using a linear layout - vertically, which means // each new section starts below the last one. //builder.CurrentDocument.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize("Custom", DEFS.MMtoInch(210), DEFS.MMtoInch(297)); //builder.CurrentDocument.DefaultPageSettings.Margins = new System.Drawing.Printing.Margins(DEFS.MMtoInch(8), DEFS.MMtoInch(8), DEFS.MMtoInch(8), DEFS.MMtoInch(8)); builder.HorizLineMargins = 0.2f; builder.StartLinearLayout(Direction.Vertical); builder.AddPageHeader("ALL-IN Cafe", String.Empty, DateTime.Now.ToLongDateString()); h_height += sor_magas; #region fejlec builder.StartLayeredLayout(false, false); // Add various text sections in different headings box = new SectionBox(); box.Width = 80; box.Height = 10; box.OffsetLeft = 0; box.OffsetTop = 0; //box.Border. //box.Background = Brushes.Ivory; contents = new LinearSections(); contents.AddSection(new SectionText((string)Syspar2.GetValue(ParamCodes.CEG_NEV), TextStyle.Heading1)); contents.AddSection(new SectionText((string)Syspar2.GetValue(ParamCodes.CEG_CIM), TextStyle.Normal)); box.AddSection(contents); builder.AddSection(box); h_height += 10; // Logo box = new SectionBox(); box.Width = 40; box.Height = 10; box.OffsetLeft = 80; box.OffsetTop = 0; box.HorizontalAlignment = HorizontalAlignment.Center; // box.VerticalAlignment = VerticalAlignment.Bottom; //box.Border = reportDocument.NormalPen; SectionImage image = new SectionImage(global::GUI.Properties.Resources.logo); //image.Transparency = 50; //image.PreserveAspectRatio = false; box.AddSection(image); builder.AddSection(box); // Finish a layout that we started // builder.FinishLayeredLayout(); // builder.FinishLayeredLayout(); #endregion builder.AddText(" "); builder.AddText(" "); builder.AddText(" "); builder.AddText("Napi összesített eladás statisztika"); h_height += 4 * sor_magas; #region Összes eladás DataView dv = ReportData.GetOsszesEladas(_EV, _HO, _NAP); builder.DefaultTablePen = null; builder.AddTable(dv, true, 100); builder.Table.InnerPenHeaderBottom = reportDocument.NormalPen; builder.Table.InnerPenRow = new Pen(Color.Gray, reportDocument.ThinPen.Width); builder.Table.OuterPenBottom = new Pen(Color.Gray, reportDocument.ThinPen.Width); builder.Table.HeaderTextStyle.Size = 8; builder.Table.DetailRowTextStyle.Size = 8; // 210 széles lehet. builder.AddColumn(dv.Table.Columns[0], "Típus", 30, false, false, HorizontalAlignment.Left); builder.AddColumn(dv.Table.Columns[1], "db.", 20, false, false, HorizontalAlignment.Right); builder.AddColumn(dv.Table.Columns[2], "Érték", 20, false, false, HorizontalAlignment.Right); //builder.AddColumn(dv.Table.Columns[3], "Hitel ért.", 40, false, false, HorizontalAlignment.Right); //builder.AddColumn(dv.Table.Columns[4], "Kifiz. hitel db", 20, false, false, HorizontalAlignment.Right); //builder.AddColumn(dv.Table.Columns[5], "Kifiz. hitelek ért.", 40, false, false, HorizontalAlignment.Right); h_height += sor_magas * dv.Count; builder.CurrentSection.HorizontalAlignment = HorizontalAlignment.Left; #endregion builder.AddText(" "); builder.AddText(" "); builder.AddText(" "); builder.AddText("Cikkcsoportonkénti összesített napi statisztika"); h_height += sor_magas * 4; #region Cikkcsoportonkénti összesítő dv = ReportData.GetCikkcsopOsszesEladas(_EV, _HO, _NAP); builder.DefaultTablePen = null; builder.AddTable(dv, true, 100); builder.Table.InnerPenHeaderBottom = reportDocument.NormalPen; builder.Table.InnerPenRow = new Pen(Color.Gray, reportDocument.ThinPen.Width); builder.Table.OuterPenBottom = new Pen(Color.Gray, reportDocument.ThinPen.Width); builder.Table.HeaderTextStyle.Size = 8; builder.Table.DetailRowTextStyle.Size = 8; // 210 széles lehet. builder.AddColumn(dv.Table.Columns[0], "Cikkcsoport", 30, false, false, HorizontalAlignment.Left); builder.AddColumn(dv.Table.Columns[1], "Tipus", 30, false, false, HorizontalAlignment.Left); builder.AddColumn(dv.Table.Columns[2], "db", 10, false, false, HorizontalAlignment.Right); builder.AddColumn(dv.Table.Columns[3], "érték", 20, false, false, HorizontalAlignment.Right); //builder.AddColumn(dv.Table.Columns[3], "Hitelre db", 20, false, false, HorizontalAlignment.Right); //builder.AddColumn(dv.Table.Columns[4], "Hitelre ért.", 30, false, false, HorizontalAlignment.Right); //builder.AddColumn(dv.Table.Columns[5], "Kifiz. hitel db", 20, false, false, HorizontalAlignment.Right); //builder.AddColumn(dv.Table.Columns[6], "Kifiz. hitel ért.", 30, false, false, HorizontalAlignment.Right); h_height += sor_magas * dv.Count; builder.CurrentSection.HorizontalAlignment = HorizontalAlignment.Left; #endregion builder.AddText(" "); builder.AddText(" "); builder.AddText(" "); builder.AddText("Speciális zárás statisztika"); h_height += sor_magas * 4; #region Speciális zárás összesítő dv = ReportData.GetSpecZarasEladas(_EV,_HO,_NAP); builder.DefaultTablePen = null; builder.AddTable(dv, true, 100); builder.Table.InnerPenHeaderBottom = reportDocument.NormalPen; builder.Table.InnerPenRow = new Pen(Color.Gray, reportDocument.ThinPen.Width); builder.Table.OuterPenBottom = new Pen(Color.Gray, reportDocument.ThinPen.Width); builder.Table.HeaderTextStyle.Size = 8; builder.Table.DetailRowTextStyle.Size = 8; // 210 széles lehet. builder.AddColumn(dv.Table.Columns[0], "Cikkcsoport", 30, false, false, HorizontalAlignment.Right); builder.AddColumn(dv.Table.Columns[1], "Összes eladás db", 20, false, false, HorizontalAlignment.Right); builder.AddColumn(dv.Table.Columns[2], "Összes eladás értéke", 30, false, false, HorizontalAlignment.Right); builder.AddColumn(dv.Table.Columns[3], "Hitelre írt db", 20, false, false, HorizontalAlignment.Right); builder.AddColumn(dv.Table.Columns[4], "Hitelre írás értéke", 30, false, false, HorizontalAlignment.Right); builder.AddColumn(dv.Table.Columns[5], "Kifizetett hitel db", 20, false, false, HorizontalAlignment.Right); builder.AddColumn(dv.Table.Columns[6], "Kifizetett hitelek értéke", 30, false, false, HorizontalAlignment.Right); h_height += sor_magas * dv.Count; builder.CurrentSection.HorizontalAlignment = HorizontalAlignment.Left; #endregion builder.AddText(" "); h_height += sor_magas * 2; builder.CurrentDocument.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize("Custom", DEFS.MMtoInch(75), DEFS.MMtoInch(h_height)); builder.CurrentDocument.DefaultPageSettings.Margins = new System.Drawing.Printing.Margins(DEFS.MMtoInch(1), DEFS.MMtoInch(1), DEFS.MMtoInch(1), DEFS.MMtoInch(1)); builder.FinishLinearLayout(); }
public void MakeDocument(ReportDocument reportDocument) { // Always reset the text styles if you have multiple methods that // set them TextStyle.ResetStyles(); SectionBox box; LinearSections contents; //TextStyle.Normal.BackgroundBrush = Brushes.Beige; //Szamla iSzamla = new Szamla(_SzamlaId); // Create a ReportBuilder object that assists with building a report ReportBuilder builder = new ReportBuilder(reportDocument); builder.CurrentDocument.DocumentUnit = GraphicsUnit.Millimeter; // Before adding sections, a layout must be started. // We are using a linear layout - vertically, which means // each new section starts below the last one. builder.CurrentDocument.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize("Custom", DEFS.MMtoInch(210), DEFS.MMtoInch(297)); builder.CurrentDocument.DefaultPageSettings.Margins = new System.Drawing.Printing.Margins(DEFS.MMtoInch(8), DEFS.MMtoInch(8), DEFS.MMtoInch(8), DEFS.MMtoInch(8)); builder.HorizLineMargins = 0.2f; builder.StartLinearLayout(Direction.Vertical); builder.AddPageHeader("ALL-IN Cafe", String.Empty, DateTime.Now.ToLongDateString()); #region fejlec builder.StartLayeredLayout(false, false); // Add various text sections in different headings box = new SectionBox(); box.Width = 80; box.Height = 10; box.OffsetLeft = 0; box.OffsetTop = 0; //box.Border. //box.Background = Brushes.Ivory; contents = new LinearSections(); contents.AddSection(new SectionText((string)Syspar2.GetValue(ParamCodes.CEG_NEV), TextStyle.Heading1)); contents.AddSection(new SectionText((string)Syspar2.GetValue(ParamCodes.CEG_CIM), TextStyle.Normal)); box.AddSection(contents); builder.AddSection(box); // Logo box = new SectionBox(); box.Width = 40; box.Height = 10; box.OffsetLeft = 80; box.OffsetTop = 0; box.HorizontalAlignment = HorizontalAlignment.Center; // box.VerticalAlignment = VerticalAlignment.Bottom; //box.Border = reportDocument.NormalPen; SectionImage image = new SectionImage(global::GUI.Properties.Resources.logo); //image.Transparency = 50; //image.PreserveAspectRatio = false; box.AddSection(image); builder.AddSection(box); // Finish a layout that we started // builder.FinishLayeredLayout(); // builder.FinishLayeredLayout(); #endregion builder.AddText(" "); builder.AddText(" "); builder.AddText(" "); builder.AddText("Leltározási ív"); #region Összes eladás DataView dv = ReportData.getLeltarIv(_fej); builder.DefaultTablePen = null; builder.AddTable(dv, true, 100); builder.Table.InnerPenHeaderBottom = reportDocument.NormalPen; builder.Table.InnerPenRow = new Pen(Color.Gray, reportDocument.ThinPen.Width); builder.Table.OuterPenBottom = new Pen(Color.Gray, reportDocument.ThinPen.Width); builder.Table.DetailRowTextStyle.SizeDelta = 8; builder.Table.ShowSummaryRow = true; // 210 széles lehet. builder.AddColumn(dv.Table.Columns[0], "Cikk", 90, false, false, HorizontalAlignment.Left); builder.AddColumn(dv.Table.Columns[1], "Készlet mennyisége", 40, false, false, HorizontalAlignment.Right); builder.AddColumn(dv.Table.Columns[2], "Számolt mennyiség", 50, false, false, HorizontalAlignment.Right); builder.CurrentSection.HorizontalAlignment = HorizontalAlignment.Left; #endregion builder.FinishLinearLayout(); }
public void MakeDocument(ReportDocument reportDocument, string strFontSize, string strStartDate, string strEndDate) { TextStyle.ResetStyles(); float fFontSize = 10; float.TryParse(strFontSize, out fFontSize); TextStyle.Normal.Size = 10; TextStyle.Heading1.Size = 16; TextStyle.Heading1.Bold = true; TextStyle.TableHeader.StringAlignment = StringAlignment.Center; TextStyle.TableHeader.Size = fFontSize; TextStyle.TableHeader.Bold = true; TextStyle.TableRow.Size = fFontSize; TextStyle.TableRow.Bold = false; var builder = new ReportBuilder(reportDocument); builder.StartLinearLayout(Direction.Vertical); var margins = new Margins(40, 30, 60, 0); builder.CurrentDocument.DefaultPageSettings.Margins = margins; var dv = GetDataView(strStartDate, strEndDate); //builder.AddPageHeader(String.Empty, "This is test 11 - Tables with lines", "page %p"); builder.AddPageHeader(String.Empty, "Scheduled Lens Replenishment Automail Summary Report", "Date: " + DateTime.Now.ToShortDateString()); //builder.AddPageFooter("Page %p of %tp" , HorizontalAlignment.Right); //builder.AddText("Patients to be notified for scheduled lens replenishments during the month of: " + DateTime.Now.AddMonths(1).ToString("MMMM") + " " + DateTime.Now.AddMonths(1).Year + "."); builder.AddText("Patients to be notified for scheduled lens replenishments beginning " + strStartDate + " and ending " + strEndDate + "."); builder.AddHorizontalLine(); builder.DefaultTablePen = reportDocument.ThinPen; builder.AddTable(dv, true, 100); builder.CurrentSection.UseFullWidth = true; var headerRow = new TextStyle(TextStyle.TableHeader) {StringAlignment = StringAlignment.Center}; builder.AddColumn("PatientName", "Patient", 1.1f, false, false); builder.CurrentColumn.HeaderTextStyle = headerRow; builder.AddColumn("RpS", "RpS", .7f, false, false); builder.CurrentColumn.HeaderTextStyle = headerRow; builder.AddColumn("NextSchdReplacement", "Next Schd Repl", 1.1f, false, false); builder.CurrentColumn.HeaderTextStyle = headerRow; builder.AddColumn("Eye", "Eye", .2f, false, false); builder.CurrentColumn.HeaderTextStyle = headerRow; builder.AddColumn("Manf", "Manufacturer", 1f, false, false); builder.CurrentColumn.HeaderTextStyle = headerRow; builder.AddColumn("Series", "Series", .7f, false, false); builder.CurrentColumn.HeaderTextStyle = headerRow; builder.AddColumn("BC", "BC", .6f, false, false); builder.CurrentColumn.HeaderTextStyle = headerRow; builder.AddColumn("DIA", "DIA", .5f, false, false); builder.CurrentColumn.HeaderTextStyle = headerRow; builder.AddColumn("Sphere", "Sphere", .6f, false, false); builder.CurrentColumn.HeaderTextStyle = headerRow; builder.AddColumn("CYL", "CYL", .7f, false, false); builder.CurrentColumn.HeaderTextStyle = headerRow; builder.AddColumn("Axis", "Axis", .5f, false, false); builder.CurrentColumn.HeaderTextStyle = headerRow; builder.AddColumn("Add", "Add", .6f, false, false); builder.CurrentColumn.HeaderTextStyle = headerRow; builder.AddColumn("Tint", "Tint", 1.2f, false, false); builder.CurrentColumn.HeaderTextStyle = headerRow; builder.AddColumn("Automail", "AM", .2f, false, false); builder.CurrentColumn.HeaderTextStyle = headerRow; builder.AddColumn("DoNotSend", "DS", .2f, false, false); builder.CurrentColumn.HeaderTextStyle = headerRow; builder.FinishLinearLayout(); }