B4J Tutorial [XLUtils] Hyperlinks and Outlining / Grouping

Erel

Administrator
Staff member
Licensed User
XLUtils v1.03 adds support for grouping rows and columns and for adding links.

1620140576016.png


Grouping is done with XLSheetWriter.GroupRows / Columns.
By default the expand button is positioned at the bottom.
You can move it to the top using a template. Choose Data - Outline settings and uncheck "summary rows below detail":

1620140751438.png


Adding links is done with XLSheetWriter.CreateHyperlink:
B4X:
Dim LinkStyle As XLStyle = workbook.CreateStyle.FontLink(11).HorizontalAlignment("CENTER")
Sheet.PutString(xl.AddressName("A1"), "Data source - https://ourworldindata.org")
Sheet.CreateHyperlink(Sheet.LastAccessed, "URL", "https://ourworldindata.org/coronavirus-source-data")
There are four types of links:
URL - web link
DOCUMENT - location in the workbook - Country!A13
EMAIL - mailto:poi@apache.org?subject=Hyperlinks
FILE - path to file

Example project is attached. The data file is excluded due to its size. Download it: https://covid.ourworldindata.org/data/owid-covid-data.csv and put it in the Files folder.
 

Attachments

Last edited:
Top