CSV without records does not display headers

Answered
leandro f asked on August 16, 2024

Hello, when using the setReport method and passing a .json file without records in dataSource.filename, the headers are rendered normally, but when using a blank .csv file, the headers are not displayed. How can I make .csv behave the same as .json?

 

Example with empty .json:
https://jsfiddle.net/7dnxs2Lm/

 

Example with empty .csv:
https://jsfiddle.net/7dnxs2Lm/1/

1 answer

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster August 20, 2024

Hello,

Thank you for reaching out to us.

To display headers, we recommend defining the field names directly in the CVS file. Please check the following example for reference: https://jsfiddle.net/flexmonster/0n5qhxf8/

We hope it helps. Feel free to contact us if other questions arise.

Kind regards,
Nadia

Please login or Register to Submit Answer