Microsoft Excel reporting and 
 data analyzing with practically no coding. 
 .Net, ActiveX, and VCL versions. 
 www.AfalinaSoft.com  

Home    Products    Downloads    Registered users    Support    Prices    Order    Primary Subscription

 

MS Office COM Add-ins. Microsoft Excel reporting 
 and data analyzing


Referencing data - AfalinaSoft XL Report.NET Developer's Guide

<< Previous

Table of contents

Next >>


Sample #1 - Referencing data

See QuickStart.cs and QuickStart.xls

Rule #1 - General
Every report must have a corresponding template.

Rule #2 - Supplying report with data
A set of data for reporting constitutes an XL Report datasource.

Components and their properties

See 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;

Template

See 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
To transfer the column's value for a certain row (or rows) to a report, you enter the following formula in a template worksheet: =DatasourceAlias_ColumnName. The formulas of such a format are referenced as 'column formulas' in XL Report.NET documentation.

Now, you save the template. Set the Template property of the xlReport1 component to the path and file name of the template.

Let's test

Select 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.

<< Previous

Table of contents

Next >>



Components

XL Report.NET XL Report.NET

Data Access methods

  • ADO.NET

Excel version supported

MS Excel 97 (SR2)
MS Excel 2000
MS Excel 2002 (XP)
MS Excel 2003



[ Download it ]
[ Order now ]

Copyright © 1999-2006
All right reserved.
Privacy Policy

Write to WebMaster

Page Top
Add-in Express - COM Add-ins, Smart Tags and RTDS in C#, VB, C++, J#, and Delphi