|
|
|||
Home Products Downloads Registered users Support Prices Order Primary Subscription |
|
||
Sample #1 - Referencing dataSee QuickStart.cs and QuickStart.xls Rule #1 - General Rule #2 - Supplying report with data Components and their propertiesSee QuickStart.cs. To reproduce this sample form you create a new Windows application. From the Toolbox drag an OleDbConnection, OleDbCommand, DataSet, and XL Report components. Set the components' properties as follows. oleDbConnection1 properties: ConnectionString - Microsoft.JET.OLEDB.4.0 provider and the database supplied with XL Report.NET Demo, usually C:\Program Files\AfalinaSoft\XL Report .Net\Demo\DB\xlrDemo.mdb oleDbCommand1 properties:
Connection = oleDbConnection1; CommandText = SELECT customer.* FROM customer. dataSet1 properties:
add a table and set its properties:
Name=customersTable;
TableName=Customers; xlReport1 properties:
add a datasource and set its properties:
Name = xlrDatasource1
Alias = Customers Command=OleDbCommand1; DataSource = dataSet1 DataMember = Customers; TemplateSee QuickStart.xls. To reproduce this sample template you select the xlReport1 component and click the Edit template command. A new Excel workbook is open. In the C3 cell on Sheet1 enter the following formula: =Customers_Company. The Customers part of the formula corresponds to the value of the Alias property of the datasource. The 'Company' part is the name of the column in the Customers table. Rule #3 - Referencing data in template Now, you save the template. Set the Template property of the xlReport1 component to the path and file name of the template. Let's testSelect xlReport1 and check the AutoFill property if it is unchecked. If it is set to False (default), XL Report expects that it will be you who fill its datasources with data. In such a case, click the Fill data command and then the Preview command. If it is set to True, you click the Preview command and XL Report fills its datasources with data and generate the report. In your case, Excel starts with the new unsaved workbook, where the C3 cell on Sheet1 contains 'Kauai Dive Shoppe' - it's the value of the Company column for the first row of the Customers table. |
Components
Data Access methods
Excel version supportedMS Excel 97 (SR2)
[ Download it ] |