Deng Daocheng
Deng Daocheng

Reputation: 51

How to set excel sheet name in BIRT API?

When I use birt api to export excel, the excel's sheet name is default set to Sheet0. Is there a way to custom sheet name in birt API?

Upvotes: 4

Views: 1916

Answers (3)

Santosh Jadi
Santosh Jadi

Reputation: 1525

Can add Dynamic/Static Worksheet name.

Select Table, click in Script (onPrepare), use below line of code.

reportContext.getDesignHandle().setProperty("title", "Sheetname1");

Sheet name can also be passed through request parameter (workSheetName) using below line of code.

reportContext.getDesignHandle().setProperty("title", params["workSheetName"].value);

enter image description here

Upvotes: 1

razieh hafizi
razieh hafizi

Reputation: 31

I had a report with two table and page break after the first one so each table made their own sheet. after selecting each table go to the script and in the "on create" script, code this: this.name = "Sheet Name"; image

Upvotes: 3

Simulant
Simulant

Reputation: 20132

In the "Property Editor - Report" in the tab "General" you can enter a "Title".

This value will be taken to name the sheet when exporting to excel.

ExcelSheetName

Upvotes: 2

Related Questions