Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Smart markers are used to let Aspose.Cells know what information to place in a Microsoft Excel designer spreadsheet. Smart markers allow you to create templates that contain only specific information and formatting.
Designer spreadsheets are standard Excel files that contain visual formatting, formulas and smart markers. They can contain smart markers that reference one or more data source, such as information from a project and information for related contacts. Smart markers are written into the cells where you want the information.
All smart markers start with &=. An example of a data marker is &=Party.FullName. If the data marker results in more than one item, for example, a complete row, then the following rows are moved down automatically to make room for the new information. Thus sub-totals and totals can be placed on the row immediately after the data marker to make calculations based on the inserted data. To make calculations on the inserted rows, use dynamic formulas.
Smart markers consist of the data source and field name parts for most information. Special information may also be passed with variables and variable arrays. Variables always fill only one cell whereas variable arrays may fill several. Only use one data marker per cell. Unused smart markers are removed.
Smart marker may also contain parameters. Parameters allow you to modify how the information is laid out. They are appended to the end of the smart marker in parenthesis as a comma separated list.
&=DataSource.FieldName &=[Data Source].[Field Name] &=$VariableName &=$VariableArray &==DynamicFormula &=&=RepeatDynamicFormula
The following parameters are allowed:
The parameters noadd and skip can be combined to insert data on alternating rows. Because the template is processed from bottom to top, you should add noadd on the first row to avoid extra rows from being inserted before the alternate row.
If you have multiple parameters, separate them with a commas, but no space: parameterA,parameterB,parameterC
The following screenshots show how to insert data on every other row.
| Template File | Output File |
|---|---|
![]() |
![]() |
Dynamic formulas allow you to insert Excel formulas into cells even when the formula references rows that will be inserted during the export process. Dynamic formulas can repeat for each inserted row or use only the cell where the data marker is placed.
Dynamic formulas allow the following additional options:
For example:
&=&=B{-1}/C{-1}~(skip:1)In the dynamic formula marker, “-1” denotes the offset to the current row in B and C columns respectively which will be set for division operation, the skip parameter is one row. Moreover, we should specify the following char:
"~"as a separator character to apply further parameters in dynamic formulas.
The following screenshots illustrate a repeating dynamic formula and the resulting Excel worksheet.
| Template File | OutPut File |
|---|---|
![]() |
![]() |
| Cell “C1” contains the formula = A1*B1, cell “C2” contains = A2*B2 and cell “C3” contains = A3*B3. |
It’s very easy to process the smart markers. What follows is a code snippet in Python via Java, that shows how it is done.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.