
The demo illustrates how to create data reports with just a few lines of code based on Smart Marker technique.
A Smart Marker represents a single data point or value that gives a means to Aspose.Cells to place relevant data into different cells of the worksheet in a workbook. We make use of Designer spreadsheets in which we write smart markers into different cells. Normally a smart marker consists of DataSource and a Field Name and starts with "&=". The DataSource can be a DataSet, DataTable, DataView or an Object variable etc. You can also make use of dynamic formulas that allows you to insert MS Excel's formulas into cells even when the formula must reference rows that will be inserted during the export process. Moreover, you may calculate totals and sub totals of any data field too.
The demo utilizes of designer spreadsheet excel file named SmartMarkerDesigner.xls stored in your application folder. The file has three sheets named "Customers", "Order Details" and "Variables". The smart markers written in the first two sheets (prefixed with their DataSources) represent different fields of the tables named "Customers" and "Order Details" of Northwind Database. The third sheet introduces smart markers based on some Object variables and the variables with parameters too. Click on "Designer spreadsheet with Smart Markers" hyperlink to open the file into MS Excel or save it to your disk. Click on "Get the result" hyperlink to open the resultant file with all the records and data into your browser or save the file to your disk.
Designer spreadsheet with Smart Markers