Excel macro - Cloud

On this page

Features

  • Convert your Excel spreadsheets into tables
  • Access data from Excel files from attachments on any Confluence page, URLs or pre-configured profiles
  • Download Excel table data as a CSV file
  • 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 browserExcel
Markup Shortcut{excel}

Parameters

Parameters removed

Macro specific parameters

Macro Editor LabelDefaultDescriptionMacro Parameter
Output formathtml

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

Enter the location where the Excel files are available. 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 attachmentMost recent Excel file uploaded to the current page

Enter the name of the attachment.

  • 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 Profile or URL to Excel file are not specified, the macro renders data from the most recent Excel file that was uploaded to the current page. 
name
Profile

Enter a profile name. Contact your administrator to know which profiles are available for use in your instance.

Administrators set up profiles to connect to external sources to render Excel data across multiple pages so that sensitive information like passwords and access tokens can be secured and hidden from view. A profile usually contains the base URL and other credentials that are required to access a specific location.

Enter the relative path to the actual location of the Excel files in the field, URL to Excel file

To know more about how profiles are configured, refer to this page.

profile
URL to Excel file

Enter the URL of the Excel file(s) to be displayed. If you enter a valid path, the macro accesses the given location and renders the content from the specified Profile and URL.

  • Use a Profile configured with an absolute URL and valid User and Password to access the Excel data from private sources. The macro reads the content from the specified URL in the profile. 
  • Use a Profile configured with an absolute URL to access the Excel data from public sources, or provide the publicly hosted absolute URL in the URL to Excel file field. Authentication is not required to access the Excel data from public sources, and the macro reads the content from the specified URL. 
  • Use a Profile configured with a base URL and valid User and Password. Enter the relative path to the actual location of the Excel file(s) in the field URL to Excel file field. The macro appends the URL given here with the URL specified in the profile configuration to access the location and render the required Excel data.

It is recommended to use Profile and provide the relative path to the actual location of the Excel file(s) in the field, URL to Excel file.

url
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
Columns to show

Enter a comma separated list of column numbers 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. (XL-63)

columns
Show hidden sheets, rows, and columnsfalseEnable this option to show hidden elements of the worksheet.showHidden
Show sheet name before the tablefalseEnable this option to display the worksheet name before the table.showSheetName
Use cell properties for formattingfalseEnable 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
Show non-formatted version of generated wikifalseEnable 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 by cut and paste.showWiki
Escape special wiki charactersfalseEnable 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 hyperlinkstrue

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

When you provide all the parameters listed in the editor 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.

Macro Editor LabelDefaultDescriptionMacro Parameter
Number of heading rows1Enter the number of rows to be considered as heading rows. Heading rows do not participate in column sorting.heading
Enable column sortingtrueDeselect this option to disable sorting of columns.enableSorting
Enable row highlighting on mouse overtrueDisable 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 attributestrueDisable 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 rowfalseEnable this option to show an additional column that displays the row number for each data row.autoNumber
Auto total rowfalseEnable this option to append a row at the end of the table that contain the totals of all numeric columns.autoTotal
Allow download and exportfalseEnable this option to allow download or export of the current table view as a CSV file. When enabled, download and export icons () are displayed to the right of the table. File is downloaded to the user's local file system, or is exported as an attachment to the current page. Note that only those users that have the permission to add attachments to the page are allowed to export tables.allowExport
Sort auto number columnfalseSelect this option to enable the auto number column to be sortable. This retains the original data row count even after row sorting.autoNumberSort
Sort descendingfalseEnable 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 iconfalseEnable 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. When the default behavior is less than optimal for your situation, the Column types parameter can be set specifically. This page describes the behavior of the various types. In addition, numeric types are right aligned and can result in a total row entry. 

The following column types are not supported in the current release:

  • Numeric with data formatting (FF)
  • Float with comma as decimal point (FC)
  • Currency with comma as decimal points (CC)

These column types are expected to be featured in the upcoming release.

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.

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
Retain row style order after sortingtrueEnable 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
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 colorlightgoldenrodyellowEnter a color to highlight when the mouse is over a row element. See Web Colors for instructions on how to specify this.highlightColor
Table idAuto generatedDisplays the table ID that can be referenced for use in other macros (like the Chart macro) or Javascript.id
Table style

Specify style attributes for the table.

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

style
Table border width
Enter width for the table border in pixels. It is recommended to use Table style instead.border

Screenshot

Helpful resources

Log a request with our support team.

Confluence®, Jira®, Atlassian Bamboo®, Bitbucket®, Fisheye®, and Atlassian Crucible® are registered trademarks of Atlassian®
Copyright © 2005 - 2024 Appfire | All rights reserved. Appfire™, the 'Apps for makers™' slogan and Bob Swift Atlassian Apps™ are all trademarks of Appfire Technologies, LLC.