Excel macro - 6.x

Excel macro - 6.x

This content is archived.



On this page

Features

  • Convert your Excel spreadsheets into tables

  • Access data from Excel files from attachments on any Confluence page, URLs or Confluence directories

  • Download Excel table data as a CSV file

  • Compatible with the Chart macro to create charts

  • Enabled for Macro Security for Confluence to allow control of URLs. See Macro Security managed macros.

  • Display and format one or more worksheets in your Excel files

  • Format any of the columns, including the hidden ones, with your own styles

  • Work with common table capabilities including sorting, column totals, and row numbering

  • Displays results of most Excel formulas. If a cell value cannot be calculated due to an unknown formula, the cell displays #N/A in the resulting table. Only cell values with known calculation results are displayed in the table.

Basic use

This macro can be deployed using one of the following methods:

Selected from the macro browser

Excel

Markup shortcut

{excel}

Screenshot

Parameters

Macro specific parameters

Macro Editor Label

Default

Description

Macro Parameter

Macro Editor Label

Default

Description

Macro Parameter

Output format

html

Specify how the output is displayed. The options are as follows:

  • html - data is rendered as an HTML table

  • wiki - data is rendered in a table with wiki markup

  • unrenderedWiki - data is rendered as text with wiki markup

output

Page for attachment

Current page

Enter the location where the Excel files are available. Since 6.6.0. The following locations are supported:

  • page - Data is read from an attachment to the page specified here; provided that page is in the same space as the page with the macro.

  • space:page - Data is read from an attachment to the specified page that is in the specified space.

page

Name of attachment

Most recent Excel file uploaded to the current page

Enter the name of the attachment. Since 6.6.0. 

  • If the Page for attachment is empty, the attachment specified here is considered to be on the current page.

  • If this field is left empty and if URL to Excel file is not specified, the macro renders data from the most recent Excel file that was uploaded to the current page. 



name

Name of attachment in the path



Specify the name of the attachment in the Confluence home/script directory. Since 6.6.0. 

filename

URL to Excel file



Enter the URL of the Excel file(s) to be displayed. If a valid path is entered here, the macro accesses the given location and processes the content accordingly. 

Use of this parameter may be restricted for security reasons. See your administrator for details.



url

URL user



Enter the user name for URL access through basic authentication.

user

URL user password



Enter the user password for URL access through basic authentication.

password

URL connection timeout



Enter time in milliseconds such that URL connections do not timeout before getting data. Use this to increase the access time needed for slow connections. Note that if a zero is given the connection may wait infinitely.

timeout

Sheets to import



Enter a comma separated list of sheet names to be shown in the order specified here. By default, each sheet in the workbook produces a table. The parameter value can be a comma separated list of sheet names (case sensitive) or sheet numbers (1-based counting).

sheets

File encoding



Enter a file encoding for an external file if different from the default encoding. If left empty, default Confluence file encoding is used. Refer to this article for more information. Since 4.1.0.

Example: UTF-8.

encoding

Language for number and date formats



Enter a language specification to use the respective number and date formats for data conversion. This specification is used before the default languages are automatically used. Valid values are 2 character ISO 639-1 alpha-2 codes.

language

Country for number and date formats



Enter a country specification to use the respective number and date formats for data conversion. Used in combination with the Language for number and date formats parameter. Valid values are 2 character ISO 3166 codes.

country

Columns to show



Enter a comma separated list of column numbers to be displayed in the order specified here. By default, all non-hidden columns are displayed in its existing order. Columns are enumerated starting at 1. If columns are specified, even hidden columns are shown. 

Rearrangement of columns, that is, column ordering is not supported. Refer to XL-63 for updates.



columns

Show hidden sheets, rows, and columns

false

Enable this option to show hidden elements of the worksheet.

showHidden

Show sheet name before the table

false

Enable this option to display the worksheet name above the table.

showSheetName

Use cell properties for formatting

false

Enable this option to process each cell for special properties. Currently, supported properties are:

  • html - Alignment, font, and background color.

  • wiki - None at this time for individual cells. For columns, the Use column information from Excel sheet parameter can be used. Another alternative is to use Column attributes from common table parameters.

formatCell

Use column information from excel sheet

true

Disable this option to ignore the column formatting information specified in the Excel sheet. By default, the format for a column specified in the Excel sheet is used to apply formatting for all cells in the column.

This parameter is ignored if Use cell properties for formatting is enabled or if Column attributes are specified. 



formatColumn

Show non-formatted version of generated wiki

false

Enable this option to show a non-formatted version of the wiki table following the formatted table. This is used to help resolve formatting issues. It can also be used to convert Excel to Confluence markup with cut and paste method.

showWiki

Escape special wiki characters

false

Enable this option to allow these special characters (like '|', '[', ']', '{', '}') to be escaped so that the table format remains unaffected. This option works when a wiki output is requested (Output format is wiki) as some special characters in data can cause incorrect table formatting. The default is false so that the data that has wiki markup can be handled correctly.

escape

Include cell hyperlinks

true

Disable this option to display any hyperlinks in the data as normal text. By default, any hyperlinks in the data are retained as is.

hyperlinks

Ignore trailing blank rows

true

Disable this option to show blank rows; a row is considered blank if all the columns specified in Columns to show parameter are blank.

ignoreTrailingBlankRows

Ignore trailing blank columns

true

Disable this option to show blank columns.

ignoreTrailingBlankColumns



When you provide all the parameters listed in the editor window for the Excel file, the input provided using URL to Excel file takes precedence.

Common table parameters

The parameters listed on this page are part of our common table capabilities that are available to many macros that produce or modify tables.

Click a column heading to toggle the sorting of that column.

Macro Editor Label

Default

Description

Macro Parameter

Number of heading rows

1

Enter the number of rows to be considered as heading rows. Heading rows do not participate in column sorting.

heading

Enable column sorting

true

Deselect this option to disable sorting of columns.

enableSorting

Enable row highlighting on mouse over

true

Disable this option to stop row highlighting as the mouse moves over a table row. By default, the row is highlighted as the mouse moves.

enableHighlighting

Enable heading attributes

true

Disable this option to apply the column attributes only to data rows. By default, any column attributes provided are applied to the all column rows including heading rows. 

enableHeadingAttributes

Auto number on each row

false

Enable this option to show an additional column that displays the row number for each data row.

autoNumber

Auto total row

false

Enable this option to append a row at the end of the table that contain the totals of all numeric columns.

autoTotal

Allow download and export

false

Enable this option to allow download of the current view of the table as a CSV file. Downloads to the local file system. Exports as an attachment to the current page and is only available to users that have permission to add attachments to the page. If enabled, the download and export icon () is displayed to the right of the table. 

If enabled, you can now specify the delimiter to be used for the downloaded or exported file in the text box displayed after the Allow download and export option. Though, by default, commas (,) are used, you can enter any single character to be used as the file delimiter. Available since 6.9.

allowExport

Display data filter

false

Enable this option to see a panel above the table used to filter data. Panel contains a text box to enter the required search criteria and buttons: Filter to proceed with the search, and Clear to clear the text box to start a new search. Can use regular expressions. To know more about regular expressions, refer to the this article. Available since 6.9.

displayDataFilter

Sort auto number column

false

Select this option to enable the auto number column to be sortable. This retains the original data row count even after row sorting.

autoNumberSort

Sort descending

false

Enable this option to sort in the descending order, to be done automatically, before display. This works only if Auto sort column is specified.

sortDescending

Show sort icon

false

Enable this option to include a sort icon in the first heading row for sortable columns. An icon is displayed for the last column sorted indicating the direction in which the column was sorted.

sortIcon

Auto sort column


Enter a valid column name or number to automatically sort the table before it is displayed. No automatic sorting is done if this value is not provided or is invalid. A column number is a 1-based count of columns (excluding auto number column).

sortColumn

Sort tip on mouse over


Enter the text to be displayed when the mouse is over a sortable column. 

Example: Click to sort or an equivalent translation.

sortTip

Column types


Column types determine how column data is sorted and displayed. By default, column data is treated as a text string sorted alphabetically. Some Bob Swift Atlassian macros, like the SQL and CSV macros, may automatically generate more precise types. When the default behavior is less than optimal for your situation, the Column types parameter can be set specifically. This table describes the behavior of the various types. In addition, numeric types are right aligned and can result in a total row entry.

Type

Description

Sorting

Total Formatting

Data Formatting

String (S)

Text string. This is a series of one or more alphanumeric characters, possibly including a letter, number, space, punctuation mark or other special characters.

Alphabetic



Integer (I)

Integer. This is a numeric field without a fractional component.

Numeric

(tick)


Numeric or float values (F)

Numeric or float value and may contain numeric separators including a decimal point and a comma for thousands separator.

Numeric

(tick)


Numeric with data formatting (FF)

Numeric or float value and may contain numeric separators including a decimal point and a comma for thousands separator. Forced formatting of data columns.

Numeric

(tick)

Float with comma as decimal point (FC)

Numeric or float value and may contain numeric separators including a comma for decimal separator and a period for thousands separator.

Numeric

(tick)


Currency (C)

Similar to F with more leniency on leading and trailing characters to allow currency and similar symbols to be present and ignored.

Numeric

(tick)


Currency with comma as decimal points (CC)

Similar to FC with more leniency on leading and trailing characters to allow currency and similar symbols to be present and ignored.

Numeric

(tick)


Date (M)

Date format in many popular formats. See Advanced Date Sorting for more information. This is the preferred date sorting type.

Date


(tick)

Date in the browser date format (D)

Date in the browser date format. See Advanced Date Sorting for more information. The D type is available for compatibility with older releases - the M type is recommended.

Date



Complex HTML elements like emotions or similar (E)

Emoticons or other HTML elements.

Alphabetic on the inner HTML value



Exclude this column from user selectable sorting (X)

Indicates to exclude this column from user selectable sorting.

Disabled



.

Separated numbers, like phone numbers or TCP addresses. Valid values are multiple integer numbers separated by '.'.

Numeric on each separated value



:

Separated numbers, like phone numbers or TCP addresses. Valid values are multiple integer numbers separated by ':'.

Numeric on each separated value



-

Separated numbers, like phone numbers or TCP addresses. Valid values are multiple integer numbers separated by '-'.

Numeric on each separated value



/

Separated numbers, like phone numbers or TCP addresses. Valid values are multiple integer numbers separated by '/'.

Numeric on each separated value



Hide the column (H)

Indicates to hide the column.




columnTypes

Column calculations


When an auto total parameter is selected, this parameter can be used to customize the calculation or text that is shown on the total row. By default, all numeric fields, as specified by column types, are totaled. By specifying a comma separated list of calculation requests, the behavior can be modified using special values for the corresponding column.

Type

Result

sum

Column entries are totaled. The column type must be numeric.

avg

Column entries are totaled and then divided by the number of data rows. The column type must be numeric.

avgIgnoreZero

Column entries are totaled and then divided by the number of data rows that are non-zero and non-blank. The column type must be numeric. Requires Table Library 3.5 and above.

max

The largest data value among the column entries is returned. The Column type must be numeric.

min

The smallest data value among the column entries is returned. The Column type must be numeric.

<other text>

Any other text including a blank field will be copied to the corresponding total row field. No calculations are done.

The Max and Min Total type is available only for Advanced Tables for Confluence: Server and Data Center.

columnCalculations

Table row styles


Enter a comma separated list of styles to be applied to the specified rows. Each style is made up of one or more properties. The first style is applied to all heading rows determined by the Number of heading rows parameter. The remaining styles are applied to the remaining rows in order with repetition as necessary. A style can be reused for subsequent rows by referring to it using a 1-based numeric reference. Row styles are applied to the table row and participate with other CSS properties to determine the look of an element. In particular, some properties may be overridden by table or element styles or classes.

Example: background:lightyellow, background:lightblue

rowStyles

Apply Row styles to row cells

false

Enable this option to make the styles specified in Table row styles override the default Confluence styles and apply the styles directly to each row cell. Available since 6.9.


Retain row style order after sorting

true

Enable this option to make the row styles correspond to the order in which the rows are displayed on the screen. If not selected, the original style given to a row is retained regardless of where the row lands after sorting.

retainRowStyleOrder

Column styles


Enter a comma separated list of styles to be applied to the columns in the specified sequence. Each style is made up of one or more CSS properties (semi-colon separated). If a column is skipped, supply a comma before adding the next columns style. A style can be reused for subsequent columns by referring to it using a 1-based numeric reference. Column styles are applied to the table column and participate with other CSS properties to determine the look of an element. In particular, some properties may be overridden by table, row, or element styles or classes.

Example: background:lightyellow, background:lightblue,1,2,1,2

columnStyles

Apply Column styles to column cells

false

Enable this option to make the styles specified in Column styles override the default Confluence styles and apply the styles directly to each cell in every column. Available since 6.9.


Column attributes


Enter a comma separated list of values used to modify cell attributes for all cells in a column. The position in the comma separated list corresponds to the column that the values apply to. Each value is a double semi-colon list of attributeName=value pairs to be applied to the column cells.

columnAttributes

Highlight color

lightgoldenrodyellow

Enter a color to highlight when the mouse is over a row element. See Web Colors for instructions on how to specify this.

highlightColor

Table id

Auto generated

Displays the table ID that can be referenced for use in other macros (like the Chart macro) or Javascript.

id

Table class

@default

Enter a class of styles to be applied on the table. Leave this field empty to use the default Confluence styles. Enter a blank (one or more spaces) to indicate that no class (neither default Confluence styles or user-defined styles) must be applied on the table.

class

Table style


Enter style attributes to be applied on the table.

Example: font-style:italic; background:lightblue;.

style

Table width


Enter width for the table border in pixels or as a percentage (%). It is recommended to use Table style instead.

width

Table border width


Enter width for the table border in pixels. Set Table class to blank if the width specified here is to be applied to the table. It is recommended to use Table style instead.

border

Need support? Create a request with our support team.

Copyright © 2005 - 2025 Appfire | All rights reserved.