useDataExport()
Home > @gooddata/sdk-ui > useDataExport
useDataExport() function
This hook provides easy way to export data in your preferred format (csv/xlsx/raw) for the provided IPreparedExecution.
Signature:
export declare function useDataExport({ execution, exportConfig, onCancel, onError, onLoading, onPending, onSuccess, }: {
execution: IPreparedExecution | undefined | null;
exportConfig?: IExportConfig;
} & UseDataExportCallbacks, deps?: DependencyList): UseDataExportState;
Parameters
Parameter | Type | Description |
---|---|---|
{ execution, exportConfig, onCancel, onError, onLoading, onPending, onSuccess, } | { execution: IPreparedExecution | undefined | null; exportConfig?: IExportConfig; } & UseDataExportCallbacks | |
deps | DependencyList | (Optional) |
Returns:
Remarks
As a result, you will receive a string with uri, so you can easily create a download link. Be aware that execution is re-executed only on dependency list change, not on execution/exportConfig/callbacks change.