Merge branch 'master' of http://47.103.154.90:83/r/HStation/XHS.V1.0
| | |
| | | using Aspose.Words.Layout; |
| | | using Aspose.Words.Tables; |
| | | using System.Drawing; |
| | | using System.IO; |
| | | |
| | | namespace HStation.ReportFile |
| | | { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace HStation.ReportFile.SDK |
| | | { |
| | | partial class XtraForm1 |
| | | { |
| | | /// <summary> |
| | | /// Required designer variable. |
| | | /// </summary> |
| | | private System.ComponentModel.IContainer components = null; |
| | | |
| | | /// <summary> |
| | | /// Clean up any resources being used. |
| | | /// </summary> |
| | | /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> |
| | | protected override void Dispose(bool disposing) |
| | | { |
| | | if (disposing && (components != null)) |
| | | { |
| | | components.Dispose(); |
| | | } |
| | | base.Dispose(disposing); |
| | | } |
| | | |
| | | #region Windows Form Designer generated code |
| | | |
| | | /// <summary> |
| | | /// Required method for Designer support - do not modify |
| | | /// the contents of this method with the code editor. |
| | | /// </summary> |
| | | private void InitializeComponent() |
| | | { |
| | | ribbonControl1 = new DevExpress.XtraBars.Ribbon.RibbonControl(); |
| | | ribbonPage1 = new DevExpress.XtraBars.Ribbon.RibbonPage(); |
| | | ribbonPageGroup1 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup(); |
| | | layoutControl1 = new DevExpress.XtraLayout.LayoutControl(); |
| | | Root = new DevExpress.XtraLayout.LayoutControlGroup(); |
| | | documentViewer1 = new DevExpress.XtraPrinting.Preview.DocumentViewer(); |
| | | layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); |
| | | ((System.ComponentModel.ISupportInitialize)ribbonControl1).BeginInit(); |
| | | ((System.ComponentModel.ISupportInitialize)layoutControl1).BeginInit(); |
| | | layoutControl1.SuspendLayout(); |
| | | ((System.ComponentModel.ISupportInitialize)Root).BeginInit(); |
| | | ((System.ComponentModel.ISupportInitialize)layoutControlItem1).BeginInit(); |
| | | SuspendLayout(); |
| | | // |
| | | // ribbonControl1 |
| | | // |
| | | ribbonControl1.ExpandCollapseItem.Id = 0; |
| | | ribbonControl1.Items.AddRange(new DevExpress.XtraBars.BarItem[] { ribbonControl1.ExpandCollapseItem }); |
| | | ribbonControl1.Location = new Point(0, 0); |
| | | ribbonControl1.MaxItemId = 1; |
| | | ribbonControl1.Name = "ribbonControl1"; |
| | | ribbonControl1.Pages.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPage[] { ribbonPage1 }); |
| | | ribbonControl1.Size = new Size(1070, 152); |
| | | // |
| | | // ribbonPage1 |
| | | // |
| | | ribbonPage1.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] { ribbonPageGroup1 }); |
| | | ribbonPage1.Name = "ribbonPage1"; |
| | | ribbonPage1.Text = "ribbonPage1"; |
| | | // |
| | | // ribbonPageGroup1 |
| | | // |
| | | ribbonPageGroup1.Name = "ribbonPageGroup1"; |
| | | ribbonPageGroup1.Text = "ribbonPageGroup1"; |
| | | // |
| | | // layoutControl1 |
| | | // |
| | | layoutControl1.Controls.Add(documentViewer1); |
| | | layoutControl1.Dock = DockStyle.Fill; |
| | | layoutControl1.Location = new Point(0, 152); |
| | | layoutControl1.Name = "layoutControl1"; |
| | | layoutControl1.Root = Root; |
| | | layoutControl1.Size = new Size(1070, 357); |
| | | layoutControl1.TabIndex = 2; |
| | | layoutControl1.Text = "layoutControl1"; |
| | | // |
| | | // Root |
| | | // |
| | | Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True; |
| | | Root.GroupBordersVisible = false; |
| | | Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutControlItem1 }); |
| | | Root.Name = "Root"; |
| | | Root.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); |
| | | Root.Size = new Size(1070, 357); |
| | | Root.TextVisible = false; |
| | | // |
| | | // documentViewer1 |
| | | // |
| | | documentViewer1.IsMetric = true; |
| | | documentViewer1.Location = new Point(2, 2); |
| | | documentViewer1.Name = "documentViewer1"; |
| | | documentViewer1.Size = new Size(1066, 353); |
| | | documentViewer1.TabIndex = 4; |
| | | // |
| | | // layoutControlItem1 |
| | | // |
| | | layoutControlItem1.Control = documentViewer1; |
| | | layoutControlItem1.Location = new Point(0, 0); |
| | | layoutControlItem1.Name = "layoutControlItem1"; |
| | | layoutControlItem1.Size = new Size(1070, 357); |
| | | layoutControlItem1.TextSize = new Size(0, 0); |
| | | layoutControlItem1.TextVisible = false; |
| | | // |
| | | // XtraForm1 |
| | | // |
| | | AutoScaleDimensions = new SizeF(7F, 14F); |
| | | AutoScaleMode = AutoScaleMode.Font; |
| | | ClientSize = new Size(1070, 509); |
| | | Controls.Add(layoutControl1); |
| | | Controls.Add(ribbonControl1); |
| | | Name = "XtraForm1"; |
| | | Text = "XtraForm1"; |
| | | ((System.ComponentModel.ISupportInitialize)ribbonControl1).EndInit(); |
| | | ((System.ComponentModel.ISupportInitialize)layoutControl1).EndInit(); |
| | | layoutControl1.ResumeLayout(false); |
| | | ((System.ComponentModel.ISupportInitialize)Root).EndInit(); |
| | | ((System.ComponentModel.ISupportInitialize)layoutControlItem1).EndInit(); |
| | | ResumeLayout(false); |
| | | PerformLayout(); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | private DevExpress.XtraBars.Ribbon.RibbonControl ribbonControl1; |
| | | private DevExpress.XtraBars.Ribbon.RibbonPage ribbonPage1; |
| | | private DevExpress.XtraBars.Ribbon.RibbonPageGroup ribbonPageGroup1; |
| | | private DevExpress.XtraLayout.LayoutControl layoutControl1; |
| | | private DevExpress.XtraPrinting.Preview.DocumentViewer documentViewer1; |
| | | private DevExpress.XtraLayout.LayoutControlGroup Root; |
| | | private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace HStation.ReportFile.SDK |
| | | { |
| | | public partial class XtraForm1 : DevExpress.XtraEditors.XtraForm |
| | | { |
| | | public XtraForm1() |
| | | { |
| | | InitializeComponent(); |
| | | this.Load += Form1_Load; |
| | | } |
| | | |
| | | private void Form1_Load(object sender, EventArgs e) |
| | | { |
| | | // å建 XtraReport1 å®ä¾ |
| | | XtraReport1 report = new XtraReport1(); |
| | | |
| | | // çææ¥è¡¨ææ¡£ |
| | | report.CreateDocument(); |
| | | |
| | | // å°æ¥è¡¨ææ¡£å è½½å° DocumentViewer ä¸ |
| | | documentViewer1.DocumentSource = report; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <root> |
| | | <!-- |
| | | Microsoft ResX Schema |
| | | |
| | | Version 2.0 |
| | | |
| | | The primary goals of this format is to allow a simple XML format |
| | | that is mostly human readable. The generation and parsing of the |
| | | various data types are done through the TypeConverter classes |
| | | associated with the data types. |
| | | |
| | | Example: |
| | | |
| | | ... ado.net/XML headers & schema ... |
| | | <resheader name="resmimetype">text/microsoft-resx</resheader> |
| | | <resheader name="version">2.0</resheader> |
| | | <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> |
| | | <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> |
| | | <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> |
| | | <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> |
| | | <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> |
| | | <value>[base64 mime encoded serialized .NET Framework object]</value> |
| | | </data> |
| | | <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
| | | <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> |
| | | <comment>This is a comment</comment> |
| | | </data> |
| | | |
| | | There are any number of "resheader" rows that contain simple |
| | | name/value pairs. |
| | | |
| | | Each data row contains a name, and value. The row also contains a |
| | | type or mimetype. Type corresponds to a .NET class that support |
| | | text/value conversion through the TypeConverter architecture. |
| | | Classes that don't support this are serialized and stored with the |
| | | mimetype set. |
| | | |
| | | The mimetype is used for serialized objects, and tells the |
| | | ResXResourceReader how to depersist the object. This is currently not |
| | | extensible. For a given mimetype the value must be set accordingly: |
| | | |
| | | Note - application/x-microsoft.net.object.binary.base64 is the format |
| | | that the ResXResourceWriter will generate, however the reader can |
| | | read any of the formats listed below. |
| | | |
| | | mimetype: application/x-microsoft.net.object.binary.base64 |
| | | value : The object must be serialized with |
| | | : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter |
| | | : and then encoded with base64 encoding. |
| | | |
| | | mimetype: application/x-microsoft.net.object.soap.base64 |
| | | value : The object must be serialized with |
| | | : System.Runtime.Serialization.Formatters.Soap.SoapFormatter |
| | | : and then encoded with base64 encoding. |
| | | |
| | | mimetype: application/x-microsoft.net.object.bytearray.base64 |
| | | value : The object must be serialized into a byte array |
| | | : using a System.ComponentModel.TypeConverter |
| | | : and then encoded with base64 encoding. |
| | | --> |
| | | <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> |
| | | <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> |
| | | <xsd:element name="root" msdata:IsDataSet="true"> |
| | | <xsd:complexType> |
| | | <xsd:choice maxOccurs="unbounded"> |
| | | <xsd:element name="metadata"> |
| | | <xsd:complexType> |
| | | <xsd:sequence> |
| | | <xsd:element name="value" type="xsd:string" minOccurs="0" /> |
| | | </xsd:sequence> |
| | | <xsd:attribute name="name" use="required" type="xsd:string" /> |
| | | <xsd:attribute name="type" type="xsd:string" /> |
| | | <xsd:attribute name="mimetype" type="xsd:string" /> |
| | | <xsd:attribute ref="xml:space" /> |
| | | </xsd:complexType> |
| | | </xsd:element> |
| | | <xsd:element name="assembly"> |
| | | <xsd:complexType> |
| | | <xsd:attribute name="alias" type="xsd:string" /> |
| | | <xsd:attribute name="name" type="xsd:string" /> |
| | | </xsd:complexType> |
| | | </xsd:element> |
| | | <xsd:element name="data"> |
| | | <xsd:complexType> |
| | | <xsd:sequence> |
| | | <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
| | | <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> |
| | | </xsd:sequence> |
| | | <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> |
| | | <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> |
| | | <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> |
| | | <xsd:attribute ref="xml:space" /> |
| | | </xsd:complexType> |
| | | </xsd:element> |
| | | <xsd:element name="resheader"> |
| | | <xsd:complexType> |
| | | <xsd:sequence> |
| | | <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
| | | </xsd:sequence> |
| | | <xsd:attribute name="name" type="xsd:string" use="required" /> |
| | | </xsd:complexType> |
| | | </xsd:element> |
| | | </xsd:choice> |
| | | </xsd:complexType> |
| | | </xsd:element> |
| | | </xsd:schema> |
| | | <resheader name="resmimetype"> |
| | | <value>text/microsoft-resx</value> |
| | | </resheader> |
| | | <resheader name="version"> |
| | | <value>2.0</value> |
| | | </resheader> |
| | | <resheader name="reader"> |
| | | <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
| | | </resheader> |
| | | <resheader name="writer"> |
| | | <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
| | | </resheader> |
| | | </root> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace HStation.ReportFile.SDK |
| | | { |
| | | partial class XtraReport1 |
| | | { |
| | | /// <summary> |
| | | /// Required designer variable. |
| | | /// </summary> |
| | | private System.ComponentModel.IContainer components = null; |
| | | |
| | | /// <summary> |
| | | /// Clean up any resources being used. |
| | | /// </summary> |
| | | /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> |
| | | protected override void Dispose(bool disposing) |
| | | { |
| | | if (disposing && (components != null)) |
| | | { |
| | | components.Dispose(); |
| | | } |
| | | base.Dispose(disposing); |
| | | } |
| | | |
| | | #region Designer generated code |
| | | |
| | | /// <summary> |
| | | /// Required method for Designer support - do not modify |
| | | /// the contents of this method with the code editor. |
| | | /// </summary> |
| | | private void InitializeComponent() |
| | | { |
| | | this.TopMargin = new DevExpress.XtraReports.UI.TopMarginBand(); |
| | | this.BottomMargin = new DevExpress.XtraReports.UI.BottomMarginBand(); |
| | | this.Detail = new DevExpress.XtraReports.UI.DetailBand(); |
| | | this.xrTable2 = new DevExpress.XtraReports.UI.XRTable(); |
| | | this.xrTableRow2 = new DevExpress.XtraReports.UI.XRTableRow(); |
| | | this.xrTableCell4 = new DevExpress.XtraReports.UI.XRTableCell(); |
| | | this.xrTableCell5 = new DevExpress.XtraReports.UI.XRTableCell(); |
| | | this.ReportHeader = new DevExpress.XtraReports.UI.ReportHeaderBand(); |
| | | this.xrTable1 = new DevExpress.XtraReports.UI.XRTable(); |
| | | this.xrTableRow1 = new DevExpress.XtraReports.UI.XRTableRow(); |
| | | this.xrTableCell1 = new DevExpress.XtraReports.UI.XRTableCell(); |
| | | this.xrTableCell2 = new DevExpress.XtraReports.UI.XRTableCell(); |
| | | ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).BeginInit(); |
| | | ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).BeginInit(); |
| | | ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); |
| | | // |
| | | // TopMargin |
| | | // |
| | | this.TopMargin.HeightF = 237.5F; |
| | | this.TopMargin.Name = "TopMargin"; |
| | | // |
| | | // BottomMargin |
| | | // |
| | | this.BottomMargin.HeightF = 352.0833F; |
| | | this.BottomMargin.Name = "BottomMargin"; |
| | | // |
| | | // Detail |
| | | // |
| | | this.Detail.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { |
| | | this.xrTable2}); |
| | | this.Detail.HeightF = 29.16667F; |
| | | this.Detail.Name = "Detail"; |
| | | // |
| | | // xrTable2 |
| | | // |
| | | this.xrTable2.LocationFloat = new DevExpress.Utils.PointFloat(23.95833F, 0F); |
| | | this.xrTable2.Name = "xrTable2"; |
| | | this.xrTable2.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 96F); |
| | | this.xrTable2.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { |
| | | this.xrTableRow2}); |
| | | this.xrTable2.SizeF = new System.Drawing.SizeF(329.8611F, 29.16667F); |
| | | // |
| | | // xrTableRow2 |
| | | // |
| | | this.xrTableRow2.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] { |
| | | this.xrTableCell4, |
| | | this.xrTableCell5}); |
| | | this.xrTableRow2.Name = "xrTableRow2"; |
| | | this.xrTableRow2.Weight = 1D; |
| | | // |
| | | // xrTableCell4 |
| | | // |
| | | this.xrTableCell4.Multiline = true; |
| | | this.xrTableCell4.Name = "xrTableCell4"; |
| | | this.xrTableCell4.Text = "[ProductName]"; |
| | | this.xrTableCell4.Weight = 1D; |
| | | // |
| | | // xrTableCell5 |
| | | // |
| | | this.xrTableCell5.Multiline = true; |
| | | this.xrTableCell5.Name = "xrTableCell5"; |
| | | this.xrTableCell5.Text = "[Price]"; |
| | | this.xrTableCell5.Weight = 1D; |
| | | // |
| | | // ReportHeader |
| | | // |
| | | this.ReportHeader.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { |
| | | this.xrTable1}); |
| | | this.ReportHeader.HeightF = 32.29167F; |
| | | this.ReportHeader.Name = "ReportHeader"; |
| | | // |
| | | // xrTable1 |
| | | // |
| | | this.xrTable1.LocationFloat = new DevExpress.Utils.PointFloat(23.95833F, 0F); |
| | | this.xrTable1.Name = "xrTable1"; |
| | | this.xrTable1.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 96F); |
| | | this.xrTable1.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { |
| | | this.xrTableRow1}); |
| | | this.xrTable1.SizeF = new System.Drawing.SizeF(329.8611F, 31.25F); |
| | | // |
| | | // xrTableRow1 |
| | | // |
| | | this.xrTableRow1.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] { |
| | | this.xrTableCell1, |
| | | this.xrTableCell2}); |
| | | this.xrTableRow1.Name = "xrTableRow1"; |
| | | this.xrTableRow1.StylePriority.UseBorderDashStyle = false; |
| | | this.xrTableRow1.StylePriority.UseBorderWidth = false; |
| | | this.xrTableRow1.Weight = 1D; |
| | | // |
| | | // xrTableCell1 |
| | | // |
| | | this.xrTableCell1.Multiline = true; |
| | | this.xrTableCell1.Name = "xrTableCell1"; |
| | | this.xrTableCell1.Text = "åç§°"; |
| | | this.xrTableCell1.Weight = 1D; |
| | | // |
| | | // xrTableCell2 |
| | | // |
| | | this.xrTableCell2.Multiline = true; |
| | | this.xrTableCell2.Name = "xrTableCell2"; |
| | | this.xrTableCell2.Text = "ä»·æ ¼"; |
| | | this.xrTableCell2.Weight = 1D; |
| | | // |
| | | // XtraReport1 |
| | | // |
| | | this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] { |
| | | this.TopMargin, |
| | | this.BottomMargin, |
| | | this.Detail, |
| | | this.ReportHeader}); |
| | | this.Font = new DevExpress.Drawing.DXFont("Arial", 9.75F); |
| | | this.Margins = new DevExpress.Drawing.DXMargins(100F, 100F, 237.5F, 352.0833F); |
| | | this.Version = "23.2"; |
| | | ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).EndInit(); |
| | | ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).EndInit(); |
| | | ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); |
| | | |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | private DevExpress.XtraReports.UI.TopMarginBand TopMargin; |
| | | private DevExpress.XtraReports.UI.BottomMarginBand BottomMargin; |
| | | private DevExpress.XtraReports.UI.DetailBand Detail; |
| | | private DevExpress.XtraReports.UI.ReportHeaderBand ReportHeader; |
| | | private DevExpress.XtraReports.UI.XRTable xrTable1; |
| | | private DevExpress.XtraReports.UI.XRTableRow xrTableRow1; |
| | | private DevExpress.XtraReports.UI.XRTableCell xrTableCell1; |
| | | private DevExpress.XtraReports.UI.XRTableCell xrTableCell2; |
| | | private DevExpress.XtraReports.UI.XRTable xrTable2; |
| | | private DevExpress.XtraReports.UI.XRTableRow xrTableRow2; |
| | | private DevExpress.XtraReports.UI.XRTableCell xrTableCell4; |
| | | private DevExpress.XtraReports.UI.XRTableCell xrTableCell5; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using DevExpress.CodeParser; |
| | | using DevExpress.XtraReports.UI; |
| | | using System; |
| | | using System.Collections; |
| | | using System.ComponentModel; |
| | | using System.Drawing; |
| | | |
| | | namespace HStation.ReportFile.SDK |
| | | { |
| | | public partial class XtraReport1 : DevExpress.XtraReports.UI.XtraReport |
| | | { |
| | | public XtraReport1() |
| | | { |
| | | InitializeComponent(); |
| | | ininal(); |
| | | } |
| | | |
| | | private void ininal() |
| | | { |
| | | // è·åæ°æ®æº |
| | | List<Product> dataSource = CreateSampleProductList(); |
| | | // this.xrTable1.DataBindings.Add("Text", dataSource, "Price"); |
| | | this.DataSource = dataSource; |
| | | // 设置æ¥è¡¨çæ°æ®æº |
| | | // this.DataSource = dataSource; |
| | | |
| | | /* // å建表头 |
| | | XRTableRow headerRow = new XRTableRow(); |
| | | headerRow.Cells.Add(new XRTableCell { Text = "ProductName" }); |
| | | headerRow.Cells.Add(new XRTableCell { Text = "Price" }); |
| | | xrTable1.Rows.Add(headerRow);*/ |
| | | |
| | | /* // èªå¨åå»ºæ°æ®è¡ååå
æ ¼å¹¶ç»å®æ°æ® |
| | | foreach (var item in dataSource) |
| | | { |
| | | XRTableRow dataRow = new XRTableRow(); |
| | | |
| | | XRTableCell productNameCell = new XRTableCell(); |
| | | productNameCell.DataBindings.Add("Text", dataSource, "ProductName"); |
| | | dataRow.Cells.Add(productNameCell); |
| | | |
| | | XRTableCell priceCell = new XRTableCell(); |
| | | priceCell.DataBindings.Add("Text", dataSource, "Price"); |
| | | dataRow.Cells.Add(priceCell); |
| | | |
| | | xrTable1.Rows.Add(dataRow); |
| | | }*/ |
| | | } |
| | | |
| | | public class Product |
| | | { |
| | | public string ProductName { get; set; } |
| | | public decimal Price { get; set; } |
| | | } |
| | | |
| | | public List<Product> CreateSampleProductList() |
| | | { |
| | | List<Product> products = new List<Product> |
| | | { |
| | | new Product { ProductName = "è¹æ", Price = 5.99m }, |
| | | new Product { ProductName = "é¦è", Price = 3.99m }, |
| | | new Product { ProductName = "æ©å", Price = 4.99m } |
| | | }; |
| | | |
| | | return products; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <root> |
| | | <!-- |
| | | Microsoft ResX Schema |
| | | |
| | | Version 2.0 |
| | | |
| | | The primary goals of this format is to allow a simple XML format |
| | | that is mostly human readable. The generation and parsing of the |
| | | various data types are done through the TypeConverter classes |
| | | associated with the data types. |
| | | |
| | | Example: |
| | | |
| | | ... ado.net/XML headers & schema ... |
| | | <resheader name="resmimetype">text/microsoft-resx</resheader> |
| | | <resheader name="version">2.0</resheader> |
| | | <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> |
| | | <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> |
| | | <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> |
| | | <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> |
| | | <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> |
| | | <value>[base64 mime encoded serialized .NET Framework object]</value> |
| | | </data> |
| | | <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
| | | <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> |
| | | <comment>This is a comment</comment> |
| | | </data> |
| | | |
| | | There are any number of "resheader" rows that contain simple |
| | | name/value pairs. |
| | | |
| | | Each data row contains a name, and value. The row also contains a |
| | | type or mimetype. Type corresponds to a .NET class that support |
| | | text/value conversion through the TypeConverter architecture. |
| | | Classes that don't support this are serialized and stored with the |
| | | mimetype set. |
| | | |
| | | The mimetype is used for serialized objects, and tells the |
| | | ResXResourceReader how to depersist the object. This is currently not |
| | | extensible. For a given mimetype the value must be set accordingly: |
| | | |
| | | Note - application/x-microsoft.net.object.binary.base64 is the format |
| | | that the ResXResourceWriter will generate, however the reader can |
| | | read any of the formats listed below. |
| | | |
| | | mimetype: application/x-microsoft.net.object.binary.base64 |
| | | value : The object must be serialized with |
| | | : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter |
| | | : and then encoded with base64 encoding. |
| | | |
| | | mimetype: application/x-microsoft.net.object.soap.base64 |
| | | value : The object must be serialized with |
| | | : System.Runtime.Serialization.Formatters.Soap.SoapFormatter |
| | | : and then encoded with base64 encoding. |
| | | |
| | | mimetype: application/x-microsoft.net.object.bytearray.base64 |
| | | value : The object must be serialized into a byte array |
| | | : using a System.ComponentModel.TypeConverter |
| | | : and then encoded with base64 encoding. |
| | | --> |
| | | <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> |
| | | <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> |
| | | <xsd:element name="root" msdata:IsDataSet="true"> |
| | | <xsd:complexType> |
| | | <xsd:choice maxOccurs="unbounded"> |
| | | <xsd:element name="metadata"> |
| | | <xsd:complexType> |
| | | <xsd:sequence> |
| | | <xsd:element name="value" type="xsd:string" minOccurs="0" /> |
| | | </xsd:sequence> |
| | | <xsd:attribute name="name" use="required" type="xsd:string" /> |
| | | <xsd:attribute name="type" type="xsd:string" /> |
| | | <xsd:attribute name="mimetype" type="xsd:string" /> |
| | | <xsd:attribute ref="xml:space" /> |
| | | </xsd:complexType> |
| | | </xsd:element> |
| | | <xsd:element name="assembly"> |
| | | <xsd:complexType> |
| | | <xsd:attribute name="alias" type="xsd:string" /> |
| | | <xsd:attribute name="name" type="xsd:string" /> |
| | | </xsd:complexType> |
| | | </xsd:element> |
| | | <xsd:element name="data"> |
| | | <xsd:complexType> |
| | | <xsd:sequence> |
| | | <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
| | | <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> |
| | | </xsd:sequence> |
| | | <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> |
| | | <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> |
| | | <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> |
| | | <xsd:attribute ref="xml:space" /> |
| | | </xsd:complexType> |
| | | </xsd:element> |
| | | <xsd:element name="resheader"> |
| | | <xsd:complexType> |
| | | <xsd:sequence> |
| | | <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
| | | </xsd:sequence> |
| | | <xsd:attribute name="name" type="xsd:string" use="required" /> |
| | | </xsd:complexType> |
| | | </xsd:element> |
| | | </xsd:choice> |
| | | </xsd:complexType> |
| | | </xsd:element> |
| | | </xsd:schema> |
| | | <resheader name="resmimetype"> |
| | | <value>text/microsoft-resx</value> |
| | | </resheader> |
| | | <resheader name="version"> |
| | | <value>2.0</value> |
| | | </resheader> |
| | | <resheader name="reader"> |
| | | <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
| | | </resheader> |
| | | <resheader name="writer"> |
| | | <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
| | | </resheader> |
| | | </root> |
| | |
| | | <Project Sdk="Microsoft.NET.Sdk"> |
| | | |
| | | <PropertyGroup> |
| | | <TargetFramework>net6.0</TargetFramework> |
| | | <TargetFramework>net6.0-windows</TargetFramework> |
| | | <ImplicitUsings>enable</ImplicitUsings> |
| | | <Nullable>enable</Nullable> |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="DevExpress.Win.Design" Version="23.2.4" /> |
| | | <PackageReference Include="Yw.SkiaSharp.Core" Version="3.0.0" /> |
| | | </ItemGroup> |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
| | | <PropertyGroup /> |
| | | <ItemGroup> |
| | | <Compile Update="03-test\XtraForm1.cs"> |
| | | <SubType>Form</SubType> |
| | | </Compile> |
| | | <Compile Update="03-test\XtraReport1.cs"> |
| | | <SubType>XtraReport</SubType> |
| | | </Compile> |
| | | </ItemGroup> |
| | | </Project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace HStation.WinFrmUI |
| | | { |
| | | partial class XtraForm1 |
| | | { |
| | | /// <summary> |
| | | /// Required designer variable. |
| | | /// </summary> |
| | | private System.ComponentModel.IContainer components = null; |
| | | |
| | | /// <summary> |
| | | /// Clean up any resources being used. |
| | | /// </summary> |
| | | /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> |
| | | protected override void Dispose(bool disposing) |
| | | { |
| | | if (disposing && (components != null)) |
| | | { |
| | | components.Dispose(); |
| | | } |
| | | base.Dispose(disposing); |
| | | } |
| | | |
| | | #region Windows Form Designer generated code |
| | | |
| | | /// <summary> |
| | | /// Required method for Designer support - do not modify |
| | | /// the contents of this method with the code editor. |
| | | /// </summary> |
| | | private void InitializeComponent() |
| | | { |
| | | ribbonControl1 = new DevExpress.XtraBars.Ribbon.RibbonControl(); |
| | | ribbonPage1 = new DevExpress.XtraBars.Ribbon.RibbonPage(); |
| | | ribbonPageGroup1 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup(); |
| | | layoutControl1 = new DevExpress.XtraLayout.LayoutControl(); |
| | | Root = new DevExpress.XtraLayout.LayoutControlGroup(); |
| | | documentViewer1 = new DevExpress.XtraPrinting.Preview.DocumentViewer(); |
| | | layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); |
| | | ((System.ComponentModel.ISupportInitialize)ribbonControl1).BeginInit(); |
| | | ((System.ComponentModel.ISupportInitialize)layoutControl1).BeginInit(); |
| | | layoutControl1.SuspendLayout(); |
| | | ((System.ComponentModel.ISupportInitialize)Root).BeginInit(); |
| | | ((System.ComponentModel.ISupportInitialize)layoutControlItem1).BeginInit(); |
| | | SuspendLayout(); |
| | | // |
| | | // ribbonControl1 |
| | | // |
| | | ribbonControl1.ExpandCollapseItem.Id = 0; |
| | | ribbonControl1.Items.AddRange(new DevExpress.XtraBars.BarItem[] { ribbonControl1.ExpandCollapseItem }); |
| | | ribbonControl1.Location = new Point(0, 0); |
| | | ribbonControl1.MaxItemId = 1; |
| | | ribbonControl1.Name = "ribbonControl1"; |
| | | ribbonControl1.Pages.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPage[] { ribbonPage1 }); |
| | | ribbonControl1.Size = new Size(1070, 152); |
| | | // |
| | | // ribbonPage1 |
| | | // |
| | | ribbonPage1.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] { ribbonPageGroup1 }); |
| | | ribbonPage1.Name = "ribbonPage1"; |
| | | ribbonPage1.Text = "ribbonPage1"; |
| | | // |
| | | // ribbonPageGroup1 |
| | | // |
| | | ribbonPageGroup1.Name = "ribbonPageGroup1"; |
| | | ribbonPageGroup1.Text = "ribbonPageGroup1"; |
| | | // |
| | | // layoutControl1 |
| | | // |
| | | layoutControl1.Controls.Add(documentViewer1); |
| | | layoutControl1.Dock = DockStyle.Fill; |
| | | layoutControl1.Location = new Point(0, 152); |
| | | layoutControl1.Name = "layoutControl1"; |
| | | layoutControl1.Root = Root; |
| | | layoutControl1.Size = new Size(1070, 357); |
| | | layoutControl1.TabIndex = 2; |
| | | layoutControl1.Text = "layoutControl1"; |
| | | // |
| | | // Root |
| | | // |
| | | Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True; |
| | | Root.GroupBordersVisible = false; |
| | | Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutControlItem1 }); |
| | | Root.Name = "Root"; |
| | | Root.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); |
| | | Root.Size = new Size(1070, 357); |
| | | Root.TextVisible = false; |
| | | // |
| | | // documentViewer1 |
| | | // |
| | | documentViewer1.IsMetric = true; |
| | | documentViewer1.Location = new Point(2, 2); |
| | | documentViewer1.Name = "documentViewer1"; |
| | | documentViewer1.Size = new Size(1066, 353); |
| | | documentViewer1.TabIndex = 4; |
| | | // |
| | | // layoutControlItem1 |
| | | // |
| | | layoutControlItem1.Control = documentViewer1; |
| | | layoutControlItem1.Location = new Point(0, 0); |
| | | layoutControlItem1.Name = "layoutControlItem1"; |
| | | layoutControlItem1.Size = new Size(1070, 357); |
| | | layoutControlItem1.TextSize = new Size(0, 0); |
| | | layoutControlItem1.TextVisible = false; |
| | | // |
| | | // XtraForm1 |
| | | // |
| | | AutoScaleDimensions = new SizeF(7F, 14F); |
| | | AutoScaleMode = AutoScaleMode.Font; |
| | | ClientSize = new Size(1070, 509); |
| | | Controls.Add(layoutControl1); |
| | | Controls.Add(ribbonControl1); |
| | | Name = "XtraForm1"; |
| | | Text = "XtraForm1"; |
| | | ((System.ComponentModel.ISupportInitialize)ribbonControl1).EndInit(); |
| | | ((System.ComponentModel.ISupportInitialize)layoutControl1).EndInit(); |
| | | layoutControl1.ResumeLayout(false); |
| | | ((System.ComponentModel.ISupportInitialize)Root).EndInit(); |
| | | ((System.ComponentModel.ISupportInitialize)layoutControlItem1).EndInit(); |
| | | ResumeLayout(false); |
| | | PerformLayout(); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | private DevExpress.XtraBars.Ribbon.RibbonControl ribbonControl1; |
| | | private DevExpress.XtraBars.Ribbon.RibbonPage ribbonPage1; |
| | | private DevExpress.XtraBars.Ribbon.RibbonPageGroup ribbonPageGroup1; |
| | | private DevExpress.XtraLayout.LayoutControl layoutControl1; |
| | | private DevExpress.XtraPrinting.Preview.DocumentViewer documentViewer1; |
| | | private DevExpress.XtraLayout.LayoutControlGroup Root; |
| | | private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace HStation.WinFrmUI |
| | | { |
| | | public partial class XtraForm1 : DevExpress.XtraEditors.XtraForm |
| | | { |
| | | public XtraForm1() |
| | | { |
| | | InitializeComponent(); |
| | | this.Load += Form1_Load; |
| | | } |
| | | |
| | | public void SetBindingData(SimulationPrintViewModel viewModel) |
| | | { |
| | | XtraReport1 report = new XtraReport1(); |
| | | report.SetBingdingData(viewModel); |
| | | // çææ¥è¡¨ææ¡£ |
| | | report.CreateDocument(); |
| | | |
| | | // å°æ¥è¡¨ææ¡£å è½½å° DocumentViewer ä¸ |
| | | documentViewer1.DocumentSource = report; |
| | | } |
| | | |
| | | private void Form1_Load(object sender, EventArgs e) |
| | | { |
| | | XtraReport1 report = new XtraReport1(); |
| | | // çææ¥è¡¨ææ¡£ |
| | | report.CreateDocument(); |
| | | |
| | | // å°æ¥è¡¨ææ¡£å è½½å° DocumentViewer ä¸ |
| | | documentViewer1.DocumentSource = report; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <root> |
| | | <!-- |
| | | Microsoft ResX Schema |
| | | |
| | | Version 2.0 |
| | | |
| | | The primary goals of this format is to allow a simple XML format |
| | | that is mostly human readable. The generation and parsing of the |
| | | various data types are done through the TypeConverter classes |
| | | associated with the data types. |
| | | |
| | | Example: |
| | | |
| | | ... ado.net/XML headers & schema ... |
| | | <resheader name="resmimetype">text/microsoft-resx</resheader> |
| | | <resheader name="version">2.0</resheader> |
| | | <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> |
| | | <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> |
| | | <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> |
| | | <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> |
| | | <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> |
| | | <value>[base64 mime encoded serialized .NET Framework object]</value> |
| | | </data> |
| | | <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
| | | <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> |
| | | <comment>This is a comment</comment> |
| | | </data> |
| | | |
| | | There are any number of "resheader" rows that contain simple |
| | | name/value pairs. |
| | | |
| | | Each data row contains a name, and value. The row also contains a |
| | | type or mimetype. Type corresponds to a .NET class that support |
| | | text/value conversion through the TypeConverter architecture. |
| | | Classes that don't support this are serialized and stored with the |
| | | mimetype set. |
| | | |
| | | The mimetype is used for serialized objects, and tells the |
| | | ResXResourceReader how to depersist the object. This is currently not |
| | | extensible. For a given mimetype the value must be set accordingly: |
| | | |
| | | Note - application/x-microsoft.net.object.binary.base64 is the format |
| | | that the ResXResourceWriter will generate, however the reader can |
| | | read any of the formats listed below. |
| | | |
| | | mimetype: application/x-microsoft.net.object.binary.base64 |
| | | value : The object must be serialized with |
| | | : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter |
| | | : and then encoded with base64 encoding. |
| | | |
| | | mimetype: application/x-microsoft.net.object.soap.base64 |
| | | value : The object must be serialized with |
| | | : System.Runtime.Serialization.Formatters.Soap.SoapFormatter |
| | | : and then encoded with base64 encoding. |
| | | |
| | | mimetype: application/x-microsoft.net.object.bytearray.base64 |
| | | value : The object must be serialized into a byte array |
| | | : using a System.ComponentModel.TypeConverter |
| | | : and then encoded with base64 encoding. |
| | | --> |
| | | <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> |
| | | <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> |
| | | <xsd:element name="root" msdata:IsDataSet="true"> |
| | | <xsd:complexType> |
| | | <xsd:choice maxOccurs="unbounded"> |
| | | <xsd:element name="metadata"> |
| | | <xsd:complexType> |
| | | <xsd:sequence> |
| | | <xsd:element name="value" type="xsd:string" minOccurs="0" /> |
| | | </xsd:sequence> |
| | | <xsd:attribute name="name" use="required" type="xsd:string" /> |
| | | <xsd:attribute name="type" type="xsd:string" /> |
| | | <xsd:attribute name="mimetype" type="xsd:string" /> |
| | | <xsd:attribute ref="xml:space" /> |
| | | </xsd:complexType> |
| | | </xsd:element> |
| | | <xsd:element name="assembly"> |
| | | <xsd:complexType> |
| | | <xsd:attribute name="alias" type="xsd:string" /> |
| | | <xsd:attribute name="name" type="xsd:string" /> |
| | | </xsd:complexType> |
| | | </xsd:element> |
| | | <xsd:element name="data"> |
| | | <xsd:complexType> |
| | | <xsd:sequence> |
| | | <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
| | | <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> |
| | | </xsd:sequence> |
| | | <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> |
| | | <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> |
| | | <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> |
| | | <xsd:attribute ref="xml:space" /> |
| | | </xsd:complexType> |
| | | </xsd:element> |
| | | <xsd:element name="resheader"> |
| | | <xsd:complexType> |
| | | <xsd:sequence> |
| | | <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
| | | </xsd:sequence> |
| | | <xsd:attribute name="name" type="xsd:string" use="required" /> |
| | | </xsd:complexType> |
| | | </xsd:element> |
| | | </xsd:choice> |
| | | </xsd:complexType> |
| | | </xsd:element> |
| | | </xsd:schema> |
| | | <resheader name="resmimetype"> |
| | | <value>text/microsoft-resx</value> |
| | | </resheader> |
| | | <resheader name="version"> |
| | | <value>2.0</value> |
| | | </resheader> |
| | | <resheader name="reader"> |
| | | <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
| | | </resheader> |
| | | <resheader name="writer"> |
| | | <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
| | | </resheader> |
| | | </root> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace HStation.WinFrmUI |
| | | { |
| | | partial class XtraReport1 |
| | | { |
| | | /// <summary> |
| | | /// Required designer variable. |
| | | /// </summary> |
| | | private System.ComponentModel.IContainer components = null; |
| | | |
| | | /// <summary> |
| | | /// Clean up any resources being used. |
| | | /// </summary> |
| | | /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> |
| | | protected override void Dispose(bool disposing) |
| | | { |
| | | if (disposing && (components != null)) |
| | | { |
| | | components.Dispose(); |
| | | } |
| | | base.Dispose(disposing); |
| | | } |
| | | |
| | | #region Designer generated code |
| | | |
| | | /// <summary> |
| | | /// Required method for Designer support - do not modify |
| | | /// the contents of this method with the code editor. |
| | | /// </summary> |
| | | private void InitializeComponent() |
| | | { |
| | | this.TopMargin = new DevExpress.XtraReports.UI.TopMarginBand(); |
| | | this.BottomMargin = new DevExpress.XtraReports.UI.BottomMarginBand(); |
| | | this.Detail = new DevExpress.XtraReports.UI.DetailBand(); |
| | | this.xrTable2 = new DevExpress.XtraReports.UI.XRTable(); |
| | | this.xrTableRow2 = new DevExpress.XtraReports.UI.XRTableRow(); |
| | | this.xrTableCell4 = new DevExpress.XtraReports.UI.XRTableCell(); |
| | | this.xrTableCell5 = new DevExpress.XtraReports.UI.XRTableCell(); |
| | | this.ReportHeader = new DevExpress.XtraReports.UI.ReportHeaderBand(); |
| | | this.xrTable1 = new DevExpress.XtraReports.UI.XRTable(); |
| | | this.xrTableRow1 = new DevExpress.XtraReports.UI.XRTableRow(); |
| | | this.xrTableCell1 = new DevExpress.XtraReports.UI.XRTableCell(); |
| | | this.xrTableCell2 = new DevExpress.XtraReports.UI.XRTableCell(); |
| | | this.xrLabel1 = new DevExpress.XtraReports.UI.XRLabel(); |
| | | ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).BeginInit(); |
| | | ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).BeginInit(); |
| | | ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); |
| | | // |
| | | // TopMargin |
| | | // |
| | | this.TopMargin.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { |
| | | this.xrLabel1}); |
| | | this.TopMargin.HeightF = 237.5F; |
| | | this.TopMargin.Name = "TopMargin"; |
| | | // |
| | | // BottomMargin |
| | | // |
| | | this.BottomMargin.HeightF = 352.0833F; |
| | | this.BottomMargin.Name = "BottomMargin"; |
| | | // |
| | | // Detail |
| | | // |
| | | this.Detail.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { |
| | | this.xrTable2}); |
| | | this.Detail.HeightF = 29.16667F; |
| | | this.Detail.Name = "Detail"; |
| | | // |
| | | // xrTable2 |
| | | // |
| | | this.xrTable2.LocationFloat = new DevExpress.Utils.PointFloat(75F, 0F); |
| | | this.xrTable2.Name = "xrTable2"; |
| | | this.xrTable2.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 96F); |
| | | this.xrTable2.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { |
| | | this.xrTableRow2}); |
| | | this.xrTable2.SizeF = new System.Drawing.SizeF(329.8611F, 29.16667F); |
| | | // |
| | | // xrTableRow2 |
| | | // |
| | | this.xrTableRow2.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] { |
| | | this.xrTableCell4, |
| | | this.xrTableCell5}); |
| | | this.xrTableRow2.Name = "xrTableRow2"; |
| | | this.xrTableRow2.Weight = 1D; |
| | | // |
| | | // xrTableCell4 |
| | | // |
| | | this.xrTableCell4.Multiline = true; |
| | | this.xrTableCell4.Name = "xrTableCell4"; |
| | | this.xrTableCell4.Text = "[ProductName]"; |
| | | this.xrTableCell4.Weight = 1D; |
| | | // |
| | | // xrTableCell5 |
| | | // |
| | | this.xrTableCell5.Multiline = true; |
| | | this.xrTableCell5.Name = "xrTableCell5"; |
| | | this.xrTableCell5.Text = "[Price]"; |
| | | this.xrTableCell5.Weight = 1D; |
| | | // |
| | | // ReportHeader |
| | | // |
| | | this.ReportHeader.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { |
| | | this.xrTable1}); |
| | | this.ReportHeader.HeightF = 32.29167F; |
| | | this.ReportHeader.Name = "ReportHeader"; |
| | | // |
| | | // xrTable1 |
| | | // |
| | | this.xrTable1.LocationFloat = new DevExpress.Utils.PointFloat(75F, 0F); |
| | | this.xrTable1.Name = "xrTable1"; |
| | | this.xrTable1.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 96F); |
| | | this.xrTable1.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { |
| | | this.xrTableRow1}); |
| | | this.xrTable1.SizeF = new System.Drawing.SizeF(329.8611F, 31.25F); |
| | | // |
| | | // xrTableRow1 |
| | | // |
| | | this.xrTableRow1.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] { |
| | | this.xrTableCell1, |
| | | this.xrTableCell2}); |
| | | this.xrTableRow1.Name = "xrTableRow1"; |
| | | this.xrTableRow1.Weight = 1D; |
| | | // |
| | | // xrTableCell1 |
| | | // |
| | | this.xrTableCell1.Multiline = true; |
| | | this.xrTableCell1.Name = "xrTableCell1"; |
| | | this.xrTableCell1.Text = "åç§°"; |
| | | this.xrTableCell1.Weight = 1D; |
| | | // |
| | | // xrTableCell2 |
| | | // |
| | | this.xrTableCell2.Multiline = true; |
| | | this.xrTableCell2.Name = "xrTableCell2"; |
| | | this.xrTableCell2.Text = "ä»·æ ¼"; |
| | | this.xrTableCell2.Weight = 1D; |
| | | // |
| | | // xrLabel1 |
| | | // |
| | | this.xrLabel1.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] { |
| | | new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "")}); |
| | | this.xrLabel1.LocationFloat = new DevExpress.Utils.PointFloat(164.9306F, 10.00001F); |
| | | this.xrLabel1.Multiline = true; |
| | | this.xrLabel1.Name = "xrLabel1"; |
| | | this.xrLabel1.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 96F); |
| | | this.xrLabel1.SizeF = new System.Drawing.SizeF(295.8333F, 44.875F); |
| | | this.xrLabel1.Text = "[name]"; |
| | | // |
| | | // XtraReport1 |
| | | // |
| | | this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] { |
| | | this.TopMargin, |
| | | this.BottomMargin, |
| | | this.Detail, |
| | | this.ReportHeader}); |
| | | this.Font = new DevExpress.Drawing.DXFont("Arial", 9.75F); |
| | | this.Margins = new DevExpress.Drawing.DXMargins(100F, 100F, 237.5F, 352.0833F); |
| | | this.Version = "23.2"; |
| | | ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).EndInit(); |
| | | ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).EndInit(); |
| | | ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); |
| | | |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | private DevExpress.XtraReports.UI.TopMarginBand TopMargin; |
| | | private DevExpress.XtraReports.UI.BottomMarginBand BottomMargin; |
| | | private DevExpress.XtraReports.UI.DetailBand Detail; |
| | | private DevExpress.XtraReports.UI.ReportHeaderBand ReportHeader; |
| | | private DevExpress.XtraReports.UI.XRTable xrTable1; |
| | | private DevExpress.XtraReports.UI.XRTableRow xrTableRow1; |
| | | private DevExpress.XtraReports.UI.XRTableCell xrTableCell1; |
| | | private DevExpress.XtraReports.UI.XRTableCell xrTableCell2; |
| | | private DevExpress.XtraReports.UI.XRTable xrTable2; |
| | | private DevExpress.XtraReports.UI.XRTableRow xrTableRow2; |
| | | private DevExpress.XtraReports.UI.XRTableCell xrTableCell4; |
| | | private DevExpress.XtraReports.UI.XRTableCell xrTableCell5; |
| | | private DevExpress.XtraReports.UI.XRLabel xrLabel1; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using DevExpress.CodeParser; |
| | | using DevExpress.XtraReports.UI; |
| | | using System; |
| | | using System.Collections; |
| | | using System.ComponentModel; |
| | | using System.Drawing; |
| | | |
| | | namespace HStation.WinFrmUI |
| | | { |
| | | public partial class XtraReport1 : DevExpress.XtraReports.UI.XtraReport |
| | | { |
| | | public XtraReport1() |
| | | { |
| | | InitializeComponent(); |
| | | ininal(); |
| | | } |
| | | |
| | | private SimulationPrintViewModel _printViewModel; |
| | | |
| | | public void SetBingdingData(SimulationPrintViewModel viewModel) |
| | | { |
| | | _printViewModel = viewModel; |
| | | } |
| | | |
| | | private void ininal() |
| | | { |
| | | // è·åæ°æ®æº |
| | | List<Product> dataSource = CreateSampleProductList(); |
| | | // this.xrTable1.DataBindings.Add("Text", dataSource, "Price"); |
| | | this.DataSource = dataSource; |
| | | xrTable2.DataBindings.Add("Text", dataSource, "Price"); |
| | | xrTable2.DataBindings.Add("Text", dataSource, "ProductName"); |
| | | } |
| | | |
| | | public class Product |
| | | { |
| | | public string ProductName { get; set; } |
| | | public decimal Price { get; set; } |
| | | } |
| | | |
| | | public List<Product> CreateSampleProductList() |
| | | { |
| | | List<Product> products = new List<Product> |
| | | { |
| | | new Product { ProductName = "è¹æ", Price = 5.99m }, |
| | | new Product { ProductName = "é¦è", Price = 3.99m }, |
| | | new Product { ProductName = "æ©å", Price = 4.99m } |
| | | }; |
| | | |
| | | return products; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <root> |
| | | <!-- |
| | | Microsoft ResX Schema |
| | | |
| | | Version 2.0 |
| | | |
| | | The primary goals of this format is to allow a simple XML format |
| | | that is mostly human readable. The generation and parsing of the |
| | | various data types are done through the TypeConverter classes |
| | | associated with the data types. |
| | | |
| | | Example: |
| | | |
| | | ... ado.net/XML headers & schema ... |
| | | <resheader name="resmimetype">text/microsoft-resx</resheader> |
| | | <resheader name="version">2.0</resheader> |
| | | <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> |
| | | <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> |
| | | <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> |
| | | <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> |
| | | <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> |
| | | <value>[base64 mime encoded serialized .NET Framework object]</value> |
| | | </data> |
| | | <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
| | | <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> |
| | | <comment>This is a comment</comment> |
| | | </data> |
| | | |
| | | There are any number of "resheader" rows that contain simple |
| | | name/value pairs. |
| | | |
| | | Each data row contains a name, and value. The row also contains a |
| | | type or mimetype. Type corresponds to a .NET class that support |
| | | text/value conversion through the TypeConverter architecture. |
| | | Classes that don't support this are serialized and stored with the |
| | | mimetype set. |
| | | |
| | | The mimetype is used for serialized objects, and tells the |
| | | ResXResourceReader how to depersist the object. This is currently not |
| | | extensible. For a given mimetype the value must be set accordingly: |
| | | |
| | | Note - application/x-microsoft.net.object.binary.base64 is the format |
| | | that the ResXResourceWriter will generate, however the reader can |
| | | read any of the formats listed below. |
| | | |
| | | mimetype: application/x-microsoft.net.object.binary.base64 |
| | | value : The object must be serialized with |
| | | : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter |
| | | : and then encoded with base64 encoding. |
| | | |
| | | mimetype: application/x-microsoft.net.object.soap.base64 |
| | | value : The object must be serialized with |
| | | : System.Runtime.Serialization.Formatters.Soap.SoapFormatter |
| | | : and then encoded with base64 encoding. |
| | | |
| | | mimetype: application/x-microsoft.net.object.bytearray.base64 |
| | | value : The object must be serialized into a byte array |
| | | : using a System.ComponentModel.TypeConverter |
| | | : and then encoded with base64 encoding. |
| | | --> |
| | | <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> |
| | | <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> |
| | | <xsd:element name="root" msdata:IsDataSet="true"> |
| | | <xsd:complexType> |
| | | <xsd:choice maxOccurs="unbounded"> |
| | | <xsd:element name="metadata"> |
| | | <xsd:complexType> |
| | | <xsd:sequence> |
| | | <xsd:element name="value" type="xsd:string" minOccurs="0" /> |
| | | </xsd:sequence> |
| | | <xsd:attribute name="name" use="required" type="xsd:string" /> |
| | | <xsd:attribute name="type" type="xsd:string" /> |
| | | <xsd:attribute name="mimetype" type="xsd:string" /> |
| | | <xsd:attribute ref="xml:space" /> |
| | | </xsd:complexType> |
| | | </xsd:element> |
| | | <xsd:element name="assembly"> |
| | | <xsd:complexType> |
| | | <xsd:attribute name="alias" type="xsd:string" /> |
| | | <xsd:attribute name="name" type="xsd:string" /> |
| | | </xsd:complexType> |
| | | </xsd:element> |
| | | <xsd:element name="data"> |
| | | <xsd:complexType> |
| | | <xsd:sequence> |
| | | <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
| | | <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> |
| | | </xsd:sequence> |
| | | <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> |
| | | <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> |
| | | <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> |
| | | <xsd:attribute ref="xml:space" /> |
| | | </xsd:complexType> |
| | | </xsd:element> |
| | | <xsd:element name="resheader"> |
| | | <xsd:complexType> |
| | | <xsd:sequence> |
| | | <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
| | | </xsd:sequence> |
| | | <xsd:attribute name="name" type="xsd:string" use="required" /> |
| | | </xsd:complexType> |
| | | </xsd:element> |
| | | </xsd:choice> |
| | | </xsd:complexType> |
| | | </xsd:element> |
| | | </xsd:schema> |
| | | <resheader name="resmimetype"> |
| | | <value>text/microsoft-resx</value> |
| | | </resheader> |
| | | <resheader name="version"> |
| | | <value>2.0</value> |
| | | </resheader> |
| | | <resheader name="reader"> |
| | | <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
| | | </resheader> |
| | | <resheader name="writer"> |
| | | <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
| | | </resheader> |
| | | </root> |