Download report file as XLS

I have two questions regarding a custom report in Business Central SaaS.

Question 1:
I am creating a custom report using the Aged Accounts Receivable report as a base. However, I want this new custom report to export directly to Excel—without any preview or PDF option. The only available output should be Excel.
Is this possible? If so, how can I achieve this?

Question 2:
Currently, when I use ExcelBuf.CreateNewBook(), the exported file is in Excel 2007+ format (.xlsx). However, I need the file to be generated in Excel 2003 format (.xls) instead.
Is there a way to force Business Central to generate an .xls file?

I would really appreciate it if someone could share example code or guidance on achieving this.
Sign In or Register to comment.