I'm not able to assign a DevArt DataSet to a Devexpress XtraReport. My versions are:
- Devexpress 12.1
- dotConnect for MySQL 7.1.58 (as read under installed programs)
- VS prof 2010
- Windows 7 prof 64 bit
The problem looks like a duplicate of http://forums.devart.com/viewtopic.php?t=17790
Please advice if this is solvable. Thanks.
Devexpress XtraReport and dotConnect for MySQL) to XtraReport Issues
-
- Posts: 2
- Joined: Sat 01 Sep 2012 05:27
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: Devexpress XtraReport and dotConnect for MySQL) to XtraReport Issues
This is an example of how MySqlDataSet containing the Dept table can be assigned to a Devexpress XtraReport.
Scripts:
Do the following:
1. Create a typed MySqlDataSet via the DataSet Wizard. To invoke the wizard choose MySQL | DataSet Wizard from the Visual Studio Tools menu. The dataSet1 will be created;
2. In the project properties select Add new item > XtraReport Class;
3. Open the XtraReport Class in the designer and set its DataSource property value to Project Object->DataSet1;
4. The dataSet11 object will be created which will be the value of the DataSource property. The dept value will be automatically assigned to the DataMember property. The DataAdapter property does not require assigning a value;
5. At the bottom of the designer window the dataSet11 will be displayed. Select this object and in its properties find the Connection property. Create a new connection for your dataSet11.
6. In the dataSet11 object properties, find the dept property and expand it. The Active property will be displayed. Set its value to 'true';
7. From the toolbox of the DX.12.1: Report Controls tab drag three XRLabels to the designer window ;
8. Select the 1st XRLabel and click the black arrow on it to expand the property window. For the Data Binding property select the following value: dataSet11->dept->deptno;
9. Set the Data Binding properties for the 2nd and the 3d XRLabels to DNAME and LOC respectively;
10. Choose Preview for your XtraReport.
In case you use untyped MySqlDataSet, work with it is identical to work with a DataSet created via Data Source Configuration Wizard.
Scripts:
Code: Select all
CREATE TABLE IF NOT EXISTS dept(
deptno INT(10) NOT NULL,
DNAME VARCHAR(14) DEFAULT NULL,
LOC VARCHAR(13) DEFAULT NULL,
PRIMARY KEY (deptno)
);
INSERT INTO dept (deptno, dname, loc) VALUES (10,'Accounting1','New York');
INSERT INTO dept (deptno, dname, loc) VALUES (20,'Accounting2','New York');
INSERT INTO dept (deptno, dname, loc) VALUES (30,'Accounting3','New York');
INSERT INTO dept (deptno, dname, loc) VALUES (40,'Accounting4','New York');
1. Create a typed MySqlDataSet via the DataSet Wizard. To invoke the wizard choose MySQL | DataSet Wizard from the Visual Studio Tools menu. The dataSet1 will be created;
2. In the project properties select Add new item > XtraReport Class;
3. Open the XtraReport Class in the designer and set its DataSource property value to Project Object->DataSet1;
4. The dataSet11 object will be created which will be the value of the DataSource property. The dept value will be automatically assigned to the DataMember property. The DataAdapter property does not require assigning a value;
5. At the bottom of the designer window the dataSet11 will be displayed. Select this object and in its properties find the Connection property. Create a new connection for your dataSet11.
6. In the dataSet11 object properties, find the dept property and expand it. The Active property will be displayed. Set its value to 'true';
7. From the toolbox of the DX.12.1: Report Controls tab drag three XRLabels to the designer window ;
8. Select the 1st XRLabel and click the black arrow on it to expand the property window. For the Data Binding property select the following value: dataSet11->dept->deptno;
9. Set the Data Binding properties for the 2nd and the 3d XRLabels to DNAME and LOC respectively;
10. Choose Preview for your XtraReport.
In case you use untyped MySqlDataSet, work with it is identical to work with a DataSet created via Data Source Configuration Wizard.
-
- Posts: 2
- Joined: Sat 01 Sep 2012 05:27