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


Transferring all rows of a datasource - AfalinaSoft XL Report.NET Developer's Guide

<< Previous

Table of contents

Next >>


Sample #2 - Transferring all rows of a datasource

See QuickStart.cs and QuickStart.xls

Rule #4 - Transferring all rows of a datasource
To transfer all rows of a datasource to the report, you should create an XL Report.NET datasource and set its Range property to the name of the list range (see rule #5) where your data will be put.

Rule #5 - Preparing a list range
Do you remember relational tables? J When creating a list range in Excel you should create the header row (every column must have the name of its own) and only one data row where you enter column formulas (see rule #3) for every column of the datasource that should be used in the report. Plus, whenever creating a range in a template, XL Report requires us to add one extra column and one extra row to the table. This extra column is called 'option column'. It should be inserted before the first column in the table. The extra row is called 'option row'. It should be inserted after the last row in the table. Then you select both the data row (including the option column) and the option row and give the name specified in the Range property of the datasource to the selection.

Components and their properties

See QuickStart.cs. To reproduce this sample form you add a Windows form to your project and paste onto it all the components from the first form. Then, from the Toolbox drag an OleDbCommand component and set its properties:

OleDbCommand2 properties:

Connection = oleDbConnection1;
CommandText = SELECT orders.* FROM orders

dataSet1 properties:

add a column to the Customers table and set its properties:
ColumnName=CustNo;
DataType=System.Double;
add another table and set its properties:
Name=ordersTable;
TableName=Orders;
add a column to the Orders table and set its properties:
ColumnName=CustNo;
DataType=System.Double;
add a relation
Name=Relation1
ParentTable=Customers
ChildTable=Orders
Key Columns = CustNo
Foreign Key Columns = CustNo

xlReport1 properties:

add another datasource and set its properties:
Name = xlrDatasource2
Alias = Orders
Command=OleDbCommand2;
DataSource = dataSet1;
DataMember =Customers.Relation1;
Range= OrdersRange;

Template

See QuickStart.xls. Pay attention to the following rules we used in developing both sample form and sample template. These rules help you to transfer all the rows of a given datasource to a report.

At the figure below you see the list range prepared and selected in Excel window.

XL Report.NET: Getting Start

Small notes. A list range in XL Report is a list in Excel.

XL Report expects to find options specifying additional parameters of report generation in the option row and option column. This approach allows modifying (and sometimes significantly modifying) the report without rebuilding your application. Some of the options are shown in this section. To know more about options available, please refer to below. XL Report allows using arbitrary ranges that don't comply with the definition of a relational table. To know more about arbitrary ranges, please refer to Developer's Guide.

Report

Select xlReport1 and click the Preview command. Excel starts with the new unsaved workbook with your report.

XL Report.NET: Getting Start

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