Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CSV Exporter] File Name Customization #353

Open
Juiced66 opened this issue Jul 5, 2024 · 0 comments
Open

[CSV Exporter] File Name Customization #353

Juiced66 opened this issue Jul 5, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request feature-request good first issue Good for newcomers

Comments

@Juiced66
Copy link
Contributor

Juiced66 commented Jul 5, 2024

Description:

Allow users to specify the filename of the exported CSV. Update the exportMeasures function to accept a fileName parameter and configure the response headers accordingly.

Tasks:

  • Update exportMeasures functions to accept fileName parameter.
  • Configure response headers to use the specified fileName.

Example Code:

const fileName = request.getString("fileName", `device-${new Date().toISOString()}.csv`);
request.response.configure({
  headers: {
    "Content-Disposition": `attachment; filename="${fileName}"`,
    "Content-Type": "text/csv",
  },
});

Pros:

  • Allows customization of the exported file name.
  • Improves user experience by providing meaningful filenames.

Cons:

  • Adds an additional parameter to manage.
  • Potential for filename conflicts if not handled properly when requesting.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature-request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant