public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
     global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
     global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
     nwindDataSet ds = new nwindDataSet();
     global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
     any1.Namespace = "http://www.w3.org/2001/XMLSchema";
     any1.MinOccurs = new decimal(0);
     any1.MaxOccurs = decimal.MaxValue;
     any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
     sequence.Items.Add(any1);
     global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
     any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
     any2.MinOccurs = new decimal(1);
     any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
     sequence.Items.Add(any2);
     global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
     attribute1.Name = "namespace";
     attribute1.FixedValue = ds.Namespace;
     type.Attributes.Add(attribute1);
     global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
     attribute2.Name = "tableTypeName";
     attribute2.FixedValue = "Order_DetailsDataTable";
     type.Attributes.Add(attribute2);
     type.Particle = sequence;
     global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
     if (xs.Contains(dsSchema.TargetNamespace)) {
         global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
         global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
         try {
             global::System.Xml.Schema.XmlSchema schema = null;
             dsSchema.Write(s1);
             for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
                 schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                 s2.SetLength(0);
                 schema.Write(s2);
                 if ((s1.Length == s2.Length)) {
                     s1.Position = 0;
                     s2.Position = 0;
                     for (; ((s1.Position != s1.Length) 
                                 && (s1.ReadByte() == s2.ReadByte())); ) {
                         ;
                     }
                     if ((s1.Position == s1.Length)) {
                         return type;
                     }
                 }
             }
         }
         finally {
             if ((s1 != null)) {
                 s1.Close();
             }
             if ((s2 != null)) {
                 s2.Close();
             }
         }
     }
     xs.Add(dsSchema);
     return type;
 }
        public Form1()
        {
            InitializeComponent();

            dataSet = new nwindDataSet();
            adapter = new nwindDataSetTableAdapters.InvoicesTableAdapter();
            adapter.Fill(dataSet.Invoices);
        }
Beispiel #3
0
        public override global::System.Data.DataSet Clone()
        {
            nwindDataSet cln = ((nwindDataSet)(base.Clone()));

            cln.InitVars();
            cln.SchemaSerializationMode = this.SchemaSerializationMode;
            return(cln);
        }
Beispiel #4
0
        protected override void FillDataSource(OleDbConnection connection, nwindDataSet dataSource) {
            var customerOrdersTableAdapter = new CustomerOrdersTableAdapter();
            customerOrdersTableAdapter.Connection = connection;
            customerOrdersTableAdapter.Fill(dataSource.CustomerOrders);

            var orderReportsTableAdapter = new OrderReportsTableAdapter();
            orderReportsTableAdapter.Connection = connection;
            orderReportsTableAdapter.Fill(dataSource.OrderReports);
        }
Beispiel #5
0
        public XtraReport CreateDataGroupingReport()
        {
            // Create a report, and bind it to a data source.
            XtraReport   report = new XtraReport();
            nwindDataSet ds     = new nwindDataSet();

            new nwindDataSetTableAdapters.OrdersTableAdapter().Fill(ds.Orders);
            report.DataSource = ds;
            report.DataMember = "Orders";

            // Create a detail band and add it to the report.
            DetailBand detailBand = new DetailBand();

            detailBand.Height = 20;
            report.Bands.Add(detailBand);

            // Create a group header band and add it to the report.
            GroupHeaderBand ghBand = new GroupHeaderBand();

            ghBand.Height = 20;
            report.Bands.Add(ghBand);

            // Create a calculated field, and add it to the report's collection
            CalculatedField calcField = new CalculatedField(report.DataSource, report.DataMember);

            report.CalculatedFields.Add(calcField);

            // Define its name, field type and expression.
            // Note that numerous built-in date-time functions are supported.
            calcField.Name       = "dayOfWeek";
            calcField.FieldType  = FieldType.None;
            calcField.Expression = "GetDayOfWeek([OrderDate])";

            // Define the calculated field as
            // a grouping criteria for the group header band.
            GroupField groupField = new GroupField();

            groupField.FieldName = "dayOfWeek";
            ghBand.GroupFields.Add(groupField);

            // Create two data-bound labels, and add them to
            // the corresponding bands.
            XRLabel ghLabel = new XRLabel();

            ghLabel.DataBindings.Add("Text", report.DataSource, "OrderDate", "{0:dddd}");
            ghLabel.BackColor = Color.Red;
            ghBand.Controls.Add(ghLabel);

            XRLabel detailLabel = new XRLabel();

            detailLabel.DataBindings.Add("Text", report.DataSource, "OrderDate", "{0:MM/dd/yyyy}");
            detailLabel.ProcessDuplicatesTarget = ProcessDuplicatesTarget.Value;
            detailLabel.ProcessDuplicatesMode   = ProcessDuplicatesMode.Suppress;
            detailBand.Controls.Add(detailLabel);

            return(report);
        }
Beispiel #6
0
 static NWindData()
 {
     ds = new nwindDataSet();
     nwindDataSetTableAdapters.CategoriesTableAdapter categoriesAdapter =
         new nwindDataSetTableAdapters.CategoriesTableAdapter();
     nwindDataSetTableAdapters.ProductsTableAdapter productsAdapter =
         new nwindDataSetTableAdapters.ProductsTableAdapter();
     categoriesAdapter.Fill(ds.Categories);
     productsAdapter.Fill(ds.Products);
 }
        public Form1()
        {
            InitializeComponent();

            dataSet = new nwindDataSet();
            adapter = new nwindDataSetTableAdapters.CategoriesTableAdapter();
            adapter.Fill(dataSet.Categories);

            nwindDataSetTableAdapters.ProductsTableAdapter productsTableAdapter = new nwindDataSetTableAdapters.ProductsTableAdapter();
            productsTableAdapter.Fill(dataSet.Products);
        }
Beispiel #8
0
        protected override void FillDataSource(OleDbConnection connection, nwindDataSet dataSource)
        {
            var customerOrdersTableAdapter = new CustomerOrdersTableAdapter();

            customerOrdersTableAdapter.Connection = connection;
            customerOrdersTableAdapter.Fill(dataSource.CustomerOrders);

            var orderReportsTableAdapter = new OrderReportsTableAdapter();

            orderReportsTableAdapter.Connection = connection;
            orderReportsTableAdapter.Fill(dataSource.OrderReports);
        }
Beispiel #9
0
        public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs)
        {
            nwindDataSet ds = new nwindDataSet();

            global::System.Xml.Schema.XmlSchemaComplexType type     = new global::System.Xml.Schema.XmlSchemaComplexType();
            global::System.Xml.Schema.XmlSchemaSequence    sequence = new global::System.Xml.Schema.XmlSchemaSequence();
            global::System.Xml.Schema.XmlSchemaAny         any      = new global::System.Xml.Schema.XmlSchemaAny();
            any.Namespace = ds.Namespace;
            sequence.Items.Add(any);
            type.Particle = sequence;
            global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
            if (xs.Contains(dsSchema.TargetNamespace))
            {
                global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
                global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
                try {
                    global::System.Xml.Schema.XmlSchema schema = null;
                    dsSchema.Write(s1);
                    for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();)
                    {
                        schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                        s2.SetLength(0);
                        schema.Write(s2);
                        if ((s1.Length == s2.Length))
                        {
                            s1.Position = 0;
                            s2.Position = 0;
                            for (; ((s1.Position != s1.Length) &&
                                    (s1.ReadByte() == s2.ReadByte()));)
                            {
                                ;
                            }
                            if ((s1.Position == s1.Length))
                            {
                                return(type);
                            }
                        }
                    }
                }
                finally {
                    if ((s1 != null))
                    {
                        s1.Close();
                    }
                    if ((s2 != null))
                    {
                        s2.Close();
                    }
                }
            }
            xs.Add(dsSchema);
            return(type);
        }
 public MainWindowViewModel()
 {
     if (IsInDesignMode)
     {
         return;
     }
     report = new XtraReport1()
     {
         RequestParameters = false
     };
     DataSet = new nwindDataSet();
     report.categoriesTableAdapter.Fill(DataSet.Categories);
 }
Beispiel #11
0
        public object GetDataSource() {
            string path = FilesHelper.FindingFileName(AppDomain.CurrentDomain.BaseDirectory, @"Data\nwind.mdb", false);
            var dataSource = new nwindDataSet();
            var connection = new OleDbConnection();
            connection.ConnectionString = string.Format(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0}", path);

            FillDataSource(connection, dataSource);

            var bindingSource = new BindingSource();
            bindingSource.DataSource = dataSource;
            bindingSource.DataMember = DataMember;
            return bindingSource;
        }
Beispiel #12
0
        void DesignMdiController_DesignPanelLoaded(object sender, DevExpress.XtraReports.UserDesigner.DesignerLoadedEventArgs e)
        {
            // Get access to an instanse of the IToolboxService interface
            IToolboxService ts = (IToolboxService)e.DesignerHost.GetService(typeof(IToolboxService));
            // Get access to the collection of the toolbox items
            ToolboxItemCollection collection = ts.GetToolboxItems();

            foreach (ToolboxItem item in collection)
            {
                if (item.DisplayName == "Label")
                {
                    // Change name of the report control
                    collection[0].DisplayName = "Report Label";
                }
            }

            IDesignerHost host = e.DesignerHost;

            nwindDataSet ds = new nwindDataSet();

            // Search DataSet component
            foreach (IComponent comp in host.Container.Components)
            {
                ds = comp as nwindDataSet;
                if (!Object.Equals(ds, null))
                {
                    // Delete data source from designer host
                    host.Container.Remove(ds);
                    break;
                }
            }
            // In this place you can define your own report data source
            host.Container.Add(ds, "ReportDataSource");

            CategoriesTableAdapter adapter = new CategoriesTableAdapter();

            // Search TableAdapter component
            foreach (IComponent comp in host.Container.Components)
            {
                adapter = comp as CategoriesTableAdapter;
                if (!Object.Equals(adapter, null))
                {
                    // Delete table adapter from designer host
                    host.Container.Remove(adapter);
                    break;
                }
            }
            // In this place you can define your own report table adapter
            host.Container.Add(adapter, "ReportTableAdapter");
        }
Beispiel #13
0
        public object GetDataSource()
        {
            string path       = FilesHelper.FindingFileName(AppDomain.CurrentDomain.BaseDirectory, @"Data\nwind.mdb", false);
            var    dataSource = new nwindDataSet();
            var    connection = new OleDbConnection();

            connection.ConnectionString = string.Format(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0}", path);

            FillDataSource(connection, dataSource);

            var bindingSource = new BindingSource();

            bindingSource.DataSource = dataSource;
            bindingSource.DataMember = DataMember;
            return(bindingSource);
        }
        private DataSet FillDatasetFromGrid()
        {
            nwindDataSet ds = new nwindDataSet();
            int          rowHandle;
            DataRow      gridRow;

            for (int i = 0; i < gridView1.RowCount; i++)
            {
                rowHandle = gridView1.GetVisibleRowHandle(i);
                if (!gridView1.IsGroupRow(rowHandle))
                {
                    gridRow = gridView1.GetDataRow(rowHandle);
                    ds.Tables[0].Rows.Add(gridRow.ItemArray);
                }
            }
            return(ds);
        }
Beispiel #15
0
        static object CreateDataSource()
        {
            var dataSource = new nwindDataSet();
            var connection = new OleDbConnection();

            connection.ConnectionString = Properties.Settings.Default.nwindConnectionString;

            CategoriesTableAdapter categories = new CategoriesTableAdapter();

            categories.Connection = connection;
            categories.Fill(dataSource.Categories);

            ProductsTableAdapter products = new ProductsTableAdapter();

            products.Connection = connection;
            products.Fill(dataSource.Products);

            return(dataSource);
        }
Beispiel #16
0
        private BindingSource GetDataSource()
        {
            nwindDataSet    dataSource = new nwindDataSet();
            OleDbConnection connection = new OleDbConnection();

            connection.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\nwind.mdb";

            ProductsTableAdapter products = new ProductsTableAdapter();

            products.Connection = connection;
            products.Fill(dataSource.Products);

            BindingSource bindingSource = new BindingSource();

            bindingSource.DataSource = dataSource;
            bindingSource.DataMember = "Products";

            return(bindingSource);
        }
        private static object CreateDataSource()
        {
            var dataSource = new nwindDataSet();
            var connection = new OleDbConnection();

            connection.ConnectionString = Properties.Settings.Default.nwindConnectionString;

            CustomersTableAdapter customers = new CustomersTableAdapter();

            customers.Connection = connection;
            customers.Fill(dataSource.Customers);

            OrdersTableAdapter orders = new OrdersTableAdapter();

            orders.Connection = connection;
            orders.Fill(dataSource.Orders);

            var bindingSource = new BindingSource();

            bindingSource.DataSource = dataSource;
            bindingSource.DataMember = "Customers";
            return(bindingSource);
        }
Beispiel #18
0
 public virtual int Update(nwindDataSet dataSet)
 {
     return(this.Adapter.Update(dataSet, "Products"));
 }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     this.multiEditorRowProperties1 = new DevExpress.XtraVerticalGrid.Rows.MultiEditorRowProperties();
     this.multiEditorRowProperties2 = new DevExpress.XtraVerticalGrid.Rows.MultiEditorRowProperties();
     this.vGridControl1             = new DevExpress.XtraVerticalGrid.VGridControl();
     this.customersBindingSource    = new System.Windows.Forms.BindingSource(this.components);
     this.nwindDataSet          = new WindowsApplication409.nwindDataSet();
     this.rowAddress            = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
     this.rowCity               = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
     this.rowCompanyName        = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
     this.rowContactTitle       = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
     this.rowContactName        = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
     this.rowCountry            = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
     this.rowFax                = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
     this.multiEditorRow1       = new DevExpress.XtraVerticalGrid.Rows.MultiEditorRow();
     this.rowCustomerID         = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
     this.rowPostalCode         = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
     this.rowRegion             = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
     this.simpleButton1         = new DevExpress.XtraEditors.SimpleButton();
     this.customersTableAdapter = new WindowsApplication409.nwindDataSetTableAdapters.CustomersTableAdapter();
     ((System.ComponentModel.ISupportInitialize)(this.vGridControl1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.customersBindingSource)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.nwindDataSet)).BeginInit();
     this.SuspendLayout();
     //
     // multiEditorRowProperties1
     //
     this.multiEditorRowProperties1.Caption   = "Company";
     this.multiEditorRowProperties1.FieldName = "CompanyName";
     //
     // multiEditorRowProperties2
     //
     this.multiEditorRowProperties2.Caption   = "Phone";
     this.multiEditorRowProperties2.FieldName = "Phone";
     //
     // vGridControl1
     //
     this.vGridControl1.DataSource     = this.customersBindingSource;
     this.vGridControl1.LayoutStyle    = DevExpress.XtraVerticalGrid.LayoutViewStyle.SingleRecordView;
     this.vGridControl1.Location       = new System.Drawing.Point(2, 12);
     this.vGridControl1.Name           = "vGridControl1";
     this.vGridControl1.RecordWidth    = 127;
     this.vGridControl1.RowHeaderWidth = 73;
     this.vGridControl1.Rows.AddRange(new DevExpress.XtraVerticalGrid.Rows.BaseRow[] {
         this.rowAddress,
         this.rowContactTitle,
         this.rowPostalCode
     });
     this.vGridControl1.ShowButtonMode = DevExpress.XtraVerticalGrid.ShowButtonModeEnum.ShowAlways;
     this.vGridControl1.Size           = new System.Drawing.Size(448, 400);
     this.vGridControl1.TabIndex       = 0;
     //
     // customersBindingSource
     //
     this.customersBindingSource.DataMember = "Customers";
     this.customersBindingSource.DataSource = this.nwindDataSet;
     //
     // nwindDataSet
     //
     this.nwindDataSet.DataSetName             = "nwindDataSet";
     this.nwindDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
     //
     // rowAddress
     //
     this.rowAddress.ChildRows.AddRange(new DevExpress.XtraVerticalGrid.Rows.BaseRow[] {
         this.rowCity
     });
     this.rowAddress.Height               = 16;
     this.rowAddress.Name                 = "rowAddress";
     this.rowAddress.Properties.Caption   = "Address";
     this.rowAddress.Properties.FieldName = "Address";
     //
     // rowCity
     //
     this.rowCity.ChildRows.AddRange(new DevExpress.XtraVerticalGrid.Rows.BaseRow[] {
         this.rowCompanyName
     });
     this.rowCity.Name = "rowCity";
     this.rowCity.Properties.Caption   = "City";
     this.rowCity.Properties.FieldName = "City";
     //
     // rowCompanyName
     //
     this.rowCompanyName.Name = "rowCompanyName";
     this.rowCompanyName.Properties.Caption   = "CompanyName";
     this.rowCompanyName.Properties.FieldName = "CompanyName";
     //
     // rowContactTitle
     //
     this.rowContactTitle.ChildRows.AddRange(new DevExpress.XtraVerticalGrid.Rows.BaseRow[] {
         this.rowContactName,
         this.rowCountry,
         this.rowCustomerID
     });
     this.rowContactTitle.Name = "rowContactTitle";
     this.rowContactTitle.Properties.Caption   = "ContactTitle";
     this.rowContactTitle.Properties.FieldName = "ContactTitle";
     //
     // rowContactName
     //
     this.rowContactName.Name = "rowContactName";
     this.rowContactName.Properties.Caption   = "ContactName";
     this.rowContactName.Properties.FieldName = "ContactName";
     //
     // rowCountry
     //
     this.rowCountry.ChildRows.AddRange(new DevExpress.XtraVerticalGrid.Rows.BaseRow[] {
         this.rowFax
     });
     this.rowCountry.Name = "rowCountry";
     this.rowCountry.Properties.Caption   = "Country";
     this.rowCountry.Properties.FieldName = "Country";
     //
     // rowFax
     //
     this.rowFax.ChildRows.AddRange(new DevExpress.XtraVerticalGrid.Rows.BaseRow[] {
         this.multiEditorRow1
     });
     this.rowFax.Name = "rowFax";
     this.rowFax.Properties.Caption   = "Fax";
     this.rowFax.Properties.FieldName = "Fax";
     //
     // multiEditorRow1
     //
     this.multiEditorRow1.Name = "multiEditorRow1";
     this.multiEditorRow1.PropertiesCollection.AddRange(new DevExpress.XtraVerticalGrid.Rows.MultiEditorRowProperties[] {
         this.multiEditorRowProperties1,
         this.multiEditorRowProperties2
     });
     //
     // rowCustomerID
     //
     this.rowCustomerID.Name = "rowCustomerID";
     this.rowCustomerID.Properties.Caption   = "CustomerID";
     this.rowCustomerID.Properties.FieldName = "CustomerID";
     //
     // rowPostalCode
     //
     this.rowPostalCode.ChildRows.AddRange(new DevExpress.XtraVerticalGrid.Rows.BaseRow[] {
         this.rowRegion
     });
     this.rowPostalCode.Name = "rowPostalCode";
     this.rowPostalCode.Properties.Caption   = "PostalCode";
     this.rowPostalCode.Properties.FieldName = "PostalCode";
     //
     // rowRegion
     //
     this.rowRegion.Name = "rowRegion";
     this.rowRegion.Properties.Caption   = "Region";
     this.rowRegion.Properties.FieldName = "Region";
     //
     // simpleButton1
     //
     this.simpleButton1.Location = new System.Drawing.Point(160, 424);
     this.simpleButton1.Name     = "simpleButton1";
     this.simpleButton1.Size     = new System.Drawing.Size(75, 23);
     this.simpleButton1.TabIndex = 1;
     this.simpleButton1.Text     = "FindRow";
     this.simpleButton1.Click   += new System.EventHandler(this.simpleButton1_Click);
     //
     // customersTableAdapter
     //
     this.customersTableAdapter.ClearBeforeFill = true;
     //
     // Form1
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(515, 462);
     this.Controls.Add(this.simpleButton1);
     this.Controls.Add(this.vGridControl1);
     this.Name  = "Form1";
     this.Text  = "How to obtain a row object by FieldName in the XtraVerticalGrid";
     this.Load += new System.EventHandler(this.Form1_Load);
     ((System.ComponentModel.ISupportInitialize)(this.vGridControl1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.customersBindingSource)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.nwindDataSet)).EndInit();
     this.ResumeLayout(false);
 }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components              = new System.ComponentModel.Container();
     this.gridControl1            = new DevExpress.XtraGrid.GridControl();
     this.categoriesBindingSource = new System.Windows.Forms.BindingSource(this.components);
     this.nwindDataSet            = new HotTrack.nwindDataSet();
     this.cardView1                  = new DevExpress.XtraGrid.Views.Card.CardView();
     this.colCategoryID              = new DevExpress.XtraGrid.Columns.GridColumn();
     this.colCategoryName            = new DevExpress.XtraGrid.Columns.GridColumn();
     this.colDescription             = new DevExpress.XtraGrid.Columns.GridColumn();
     this.colPicture                 = new DevExpress.XtraGrid.Columns.GridColumn();
     this.repositoryItemPictureEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemPictureEdit();
     this.categoriesTableAdapter     = new HotTrack.nwindDataSetTableAdapters.CategoriesTableAdapter();
     ((System.ComponentModel.ISupportInitialize)(this.gridControl1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.categoriesBindingSource)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.nwindDataSet)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.cardView1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.repositoryItemPictureEdit1)).BeginInit();
     this.SuspendLayout();
     //
     // gridControl1
     //
     this.gridControl1.DataSource             = this.categoriesBindingSource;
     this.gridControl1.Dock                   = System.Windows.Forms.DockStyle.Fill;
     this.gridControl1.EmbeddedNavigator.Name = "";
     this.gridControl1.Location               = new System.Drawing.Point(0, 0);
     this.gridControl1.MainView               = this.cardView1;
     this.gridControl1.Name                   = "gridControl1";
     this.gridControl1.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
         this.repositoryItemPictureEdit1
     });
     this.gridControl1.Size     = new System.Drawing.Size(627, 434);
     this.gridControl1.TabIndex = 0;
     this.gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
         this.cardView1
     });
     this.gridControl1.MouseLeave += new System.EventHandler(this.gridControl1_MouseLeave);
     //
     // categoriesBindingSource
     //
     this.categoriesBindingSource.DataMember = "Categories";
     this.categoriesBindingSource.DataSource = this.nwindDataSet;
     //
     // nwindDataSet
     //
     this.nwindDataSet.DataSetName             = "nwindDataSet";
     this.nwindDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
     //
     // cardView1
     //
     this.cardView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
         this.colCategoryID,
         this.colCategoryName,
         this.colDescription,
         this.colPicture
     });
     this.cardView1.FocusedCardTopFieldIndex = 0;
     this.cardView1.GridControl = this.gridControl1;
     this.cardView1.Name        = "cardView1";
     this.cardView1.OptionsBehavior.FieldAutoHeight = true;
     this.cardView1.VertScrollVisibility            = DevExpress.XtraGrid.Views.Base.ScrollVisibility.Auto;
     this.cardView1.CustomDrawCardFieldValue       += new DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventHandler(this.cardView1_CustomDrawCardFieldValue);
     this.cardView1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.gridView1_MouseMove);
     //
     // colCategoryID
     //
     this.colCategoryID.Caption      = "CategoryID";
     this.colCategoryID.FieldName    = "CategoryID";
     this.colCategoryID.Name         = "colCategoryID";
     this.colCategoryID.Visible      = true;
     this.colCategoryID.VisibleIndex = 0;
     //
     // colCategoryName
     //
     this.colCategoryName.Caption      = "CategoryName";
     this.colCategoryName.FieldName    = "CategoryName";
     this.colCategoryName.Name         = "colCategoryName";
     this.colCategoryName.Visible      = true;
     this.colCategoryName.VisibleIndex = 1;
     //
     // colDescription
     //
     this.colDescription.Caption      = "Description";
     this.colDescription.FieldName    = "Description";
     this.colDescription.Name         = "colDescription";
     this.colDescription.Visible      = true;
     this.colDescription.VisibleIndex = 2;
     //
     // colPicture
     //
     this.colPicture.Caption      = "Picture";
     this.colPicture.ColumnEdit   = this.repositoryItemPictureEdit1;
     this.colPicture.FieldName    = "Picture";
     this.colPicture.Name         = "colPicture";
     this.colPicture.Visible      = true;
     this.colPicture.VisibleIndex = 3;
     //
     // repositoryItemPictureEdit1
     //
     this.repositoryItemPictureEdit1.Name = "repositoryItemPictureEdit1";
     //
     // categoriesTableAdapter
     //
     this.categoriesTableAdapter.ClearBeforeFill = true;
     //
     // Form1
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(627, 434);
     this.Controls.Add(this.gridControl1);
     this.Name  = "Form1";
     this.Text  = "Form1";
     this.Load += new System.EventHandler(this.Form1_Load);
     ((System.ComponentModel.ISupportInitialize)(this.gridControl1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.categoriesBindingSource)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.nwindDataSet)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.cardView1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.repositoryItemPictureEdit1)).EndInit();
     this.ResumeLayout(false);
 }
Beispiel #21
0
 protected abstract void FillDataSource(OleDbConnection connection, nwindDataSet dataSource);
        private void button1_Click(object sender, EventArgs e)
        {
            // Create a report, and specify its data source.
            XtraReport   report = new XtraReport();
            nwindDataSet ds     = new nwindDataSet();

            new nwindDataSetTableAdapters.CategoryProductsTableAdapter().Fill(ds.CategoryProducts);
            report.DataSource = ds;
            report.DataMember = "CategoryProducts";

            // Add a detail band and define its contents.
            DetailBand detailBand = new DetailBand();

            detailBand.Height = 100;
            report.Bands.Add(detailBand);

            XRLabel detailLabel = new XRLabel();

            detailLabel.DataBindings.Add("Text", report.DataSource, "ProductName");
            detailLabel.Width = 200;
            detailBand.Controls.Add(detailLabel);

            // Add a group header band and define its contents.
            GroupHeaderBand ghBand = new GroupHeaderBand();

            ghBand.Height = 20;
            report.Bands.Add(ghBand);

            XRLabel ghLabel = new XRLabel();

            ghLabel.DataBindings.Add("Text", report.DataSource, "CategoryName");
            ghLabel.Width     = 200;
            ghLabel.BackColor = Color.LightBlue;
            ghBand.Controls.Add(ghLabel);

            // Define a grouping criteria for the group header band.
            GroupField groupField = new GroupField();

            groupField.FieldName = "CategoryName";
            ghBand.GroupFields.Add(groupField);

            // Create a group footer band.
            GroupFooterBand gfBand = new GroupFooterBand();

            gfBand.Height = 20;
            // You can force the group header to be repeated on each page.
            gfBand.RepeatEveryPage = true;
            // It's important to set its Band.PageBreak property to AfterBand,
            // because the page numbers are displayed for the last group on a page.
            // So, if there are two distinct groups appearing on the same page,
            // this will result in improper page numbering.
            gfBand.PageBreak = PageBreak.AfterBand;
            report.Bands.Add(gfBand);

            // Create an instance of the XRPageInfo control.
            XRPageInfo pageInfo = new XRPageInfo();

            // Set the group header band as the running band for this control.
            pageInfo.RunningBand = ghBand;
            // Adjust other properties of XRPageInfo.
            pageInfo.Width     = 200;
            pageInfo.BackColor = Color.LightBlue;
            pageInfo.PageInfo  = PageInfo.NumberOfTotal;
            pageInfo.Format    = "Pages in this Group: {0} of {1}";
            gfBand.Controls.Add(pageInfo);

            // Show the report's print preview.
            report.ShowPreview();
        }
Beispiel #23
0
 protected abstract void FillDataSource(OleDbConnection connection, nwindDataSet dataSource);
 private void InitializeComponent()
 {
     this.Detail               = new DevExpress.XtraReports.UI.DetailBand();
     this.xrLabel1             = new DevExpress.XtraReports.UI.XRLabel();
     this.xrLabel2             = new DevExpress.XtraReports.UI.XRLabel();
     this.topMarginBand1       = new DevExpress.XtraReports.UI.TopMarginBand();
     this.bottomMarginBand1    = new DevExpress.XtraReports.UI.BottomMarginBand();
     this.nwindDataSet1        = new MinimalisticReportPreviewDemo.nwindDataSet();
     this.productsTableAdapter = new MinimalisticReportPreviewDemo.nwindDataSetTableAdapters.ProductsTableAdapter();
     this.ReportHeader         = new DevExpress.XtraReports.UI.ReportHeaderBand();
     ((System.ComponentModel.ISupportInitialize)(this.nwindDataSet1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
     //
     // Detail
     //
     this.Detail.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
         this.xrLabel1
     });
     this.Detail.HeightF       = 33.00001F;
     this.Detail.Name          = "Detail";
     this.Detail.Padding       = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F);
     this.Detail.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft;
     //
     // xrLabel1
     //
     this.xrLabel1.BookmarkParent = this.xrLabel2;
     this.xrLabel1.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
         new DevExpress.XtraReports.UI.XRBinding("Text", null, "Products.ProductName"),
         new DevExpress.XtraReports.UI.XRBinding("Bookmark", null, "Products.ProductName")
     });
     this.xrLabel1.Font                           = new System.Drawing.Font("Arial", 9.75F);
     this.xrLabel1.LocationFloat                  = new DevExpress.Utils.PointFloat(10.00001F, 10.00001F);
     this.xrLabel1.Name                           = "xrLabel1";
     this.xrLabel1.Padding                        = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
     this.xrLabel1.SizeF                          = new System.Drawing.SizeF(408.3333F, 23F);
     this.xrLabel1.StylePriority.UseFont          = false;
     this.xrLabel1.StylePriority.UseTextAlignment = false;
     this.xrLabel1.Text                           = "xrLabel1";
     this.xrLabel1.TextAlignment                  = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
     //
     // xrLabel2
     //
     this.xrLabel2.Bookmark              = "Home";
     this.xrLabel2.Font                  = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Bold);
     this.xrLabel2.LocationFloat         = new DevExpress.Utils.PointFloat(10.00001F, 10.00001F);
     this.xrLabel2.Name                  = "xrLabel2";
     this.xrLabel2.Padding               = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
     this.xrLabel2.SizeF                 = new System.Drawing.SizeF(222.9167F, 23F);
     this.xrLabel2.StylePriority.UseFont = false;
     this.xrLabel2.Text                  = "A sample report";
     //
     // topMarginBand1
     //
     this.topMarginBand1.HeightF = 48F;
     this.topMarginBand1.Name    = "topMarginBand1";
     //
     // bottomMarginBand1
     //
     this.bottomMarginBand1.HeightF = 48F;
     this.bottomMarginBand1.Name    = "bottomMarginBand1";
     //
     // nwindDataSet1
     //
     this.nwindDataSet1.DataSetName             = "nwindDataSet";
     this.nwindDataSet1.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
     //
     // productsTableAdapter
     //
     this.productsTableAdapter.ClearBeforeFill = true;
     //
     // ReportHeader
     //
     this.ReportHeader.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
         this.xrLabel2
     });
     this.ReportHeader.HeightF = 47F;
     this.ReportHeader.Name    = "ReportHeader";
     //
     // Report
     //
     this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {
         this.Detail,
         this.topMarginBand1,
         this.bottomMarginBand1,
         this.ReportHeader
     });
     this.Bookmark     = "Table of Contents";
     this.DataAdapter  = this.productsTableAdapter;
     this.DataMember   = "Products";
     this.DataSource   = this.nwindDataSet1;
     this.FilterString = "[CategoryID] < 4";
     this.Margins      = new System.Drawing.Printing.Margins(49, 51, 48, 48);
     this.Version      = "12.2";
     ((System.ComponentModel.ISupportInitialize)(this.nwindDataSet1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this)).EndInit();
 }