Bug #3260
the addition of an "Export to Excel" feature to allow users to download the displayed data
Description
An "Export to Excel" button should be added to the Station Selling Price page
Added by Shreya Agarwal 8 days ago. Updated 7 days ago.
Description
An "Export to Excel" button should be added to the Station Selling Price page
The "Export to Excel" feature for the Station Selling Price module has been successfully implemented without altering any existing business logic or components. An exportStationsCoverage API method was integrated in
stationSalesCostApi.ts , to communicate with the unpaginated endpoint GET /api/v1/station/sales-cost/stations/export, dynamically passing active filter parameters (stationName, saleStatus, subStatus, state). On the UI side in StationSalesCostPage.tsx, an "Export Excel" button was added to the header using the project's primary branding theme (useBrandingStyles()), standard typography, FileDownloadIcon, and an integrated loading indicator (CircularProgress) to prevent duplicate requests.
The client-side spreadsheet generation utilizes SheetJS (xlsx) and strictly follows the project's standard export pattern by beginning directly on Row 1 with the exact table columns (Station Name, State, Selling Price, Receivables, Received, Outstanding, Sale Status, Sub Status) followed by clean data rows, omitting unnecessary banner titles or summary card blocks. All labels, headers, and status mappings are dynamically resolved using translation keys (t(...)) and existing option constants