UNPKG

@progress/kendo-angular-excel-export

Version:

Kendo UI for Angular Excel Export component

129 lines (128 loc) 6.31 kB
/**----------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ import { QueryList, NgZone } from '@angular/core'; import { WorkbookOptions } from '@progress/kendo-ooxml'; import { CellOptions } from './ooxml/cell-options.interface'; import { ExcelExportData } from './excel-export-data'; import { ColumnBase } from './columns/column-base'; import { LocalizationService } from '@progress/kendo-angular-l10n'; import * as i0 from "@angular/core"; /** * Represents the [Kendo UI Excel Export component for Angular]({% slug overview_excelexport %}). * Use this component to export data to Excel format. * * @example * ```html * <kendo-excelexport [data]="gridData" fileName="MyExport.xlsx"> * <kendo-excelexport-column field="ProductID" title="Product ID"></kendo-excelexport-column> * <kendo-excelexport-column field="ProductName" title="Product Name"></kendo-excelexport-column> * </kendo-excelexport> * ``` * * @remarks * Supported children components are: {@link ColumnComponent}, {@link ColumnGroupComponent}. */ export declare class ExcelExportComponent { private localization; private zone; /** * Specifies the name of the exported Excel file. * * @default "Export.xlsx" */ fileName: string; /** * Determines whether to enable column filtering in the exported Excel file * ([see example]({% slug filtering_excelexport %})). */ filterable: boolean; /** * Determines whether groups in the Excel file are collapsible. */ collapsible: boolean; /** * Specifies the author of the workbook. */ creator?: string; /** * Specifies the creation date of the workbook. * The default value is `new Date()`. * * @default `new Date()` */ date?: Date; /** * Determines whether to force the use of a proxy server for file downloads. * When set to `true`, the component sends content to `proxyURL` even if the browser supports local file saving. */ forceProxy: boolean; /** * Specifies the URL of the server-side proxy that streams the file to the user. * When the browser cannot save files locally (for example, Internet Explorer 9 and earlier, and Safari), the component uses a proxy. * You must implement the server-side proxy. * * The proxy receives a `POST` request with these parameters in the request body: * - `contentType`&mdash;The `MIME` type of the file. * - `base64`&mdash;The `base-64` encoded file content. * - `fileName`&mdash;The requested file name. * The proxy must return the decoded file with the `Content-Disposition` header set to `attachment; filename="<fileName.xslx>"`. */ proxyURL: string; /** * Specifies the data to export. * When the data is grouped, structure it as described by the * [`GroupResult`]({% slug api_kendo-data-query_groupresult %}) option of the Kendo UI Data Query component. */ data: any[]; /** * Specifies the exported data groups. * The groups must match the * [`GroupDescriptor`]({% slug api_kendo-data-query_groupdescriptor %}) option of the Kendo UI Data Query component. */ group: any[]; /** * Specifies the options for cells inserted before data, group, and footer cells * to show group hierarchy when the data is grouped * ([see example]({% slug cells_excelexport %}#toc-padding-cells)). */ paddingCellOptions: CellOptions; /** * Specifies the options for cells inserted before header cells * to align headers and column values when the data is grouped * ([see example]({% slug cells_excelexport %}#toc-header-padding-cells)). */ headerPaddingCellOptions: CellOptions; /** * @hidden */ columns: QueryList<ColumnBase>; constructor(localization: LocalizationService, zone: NgZone); /** * Exports the data to Excel. * * @param exportData - Optional. The data to export or [`WorkbookOptions`]({% slug api_excel-export_workbookoptions %}). */ save(exportData?: any[] | ExcelExportData | WorkbookOptions): void; /** * Returns [`WorkbookOptions`]({% slug api_excel-export_workbookoptions %}) based on the specified columns and data. * Use this method to customize the workbook options. * * @param exportData - Optional. The data to export. * @returns {WorkbookOptions} The workbook options. */ workbookOptions(exportData?: any[] | ExcelExportData): WorkbookOptions; /** * Returns a promise that resolves with the file data URI. * Use this method to get the Excel file as a data URI. * * @param exportData - Optional. The data or [`WorkbookOptions`]({% slug api_excel-export_workbookoptions %}) to use for generating the data URI. * @returns {Promise<string>} A promise that resolves with the file data URI. */ toDataURL(exportData?: any[] | ExcelExportData | WorkbookOptions): Promise<string>; protected getExportData(exportData?: ExcelExportData | any[]): ExcelExportData; protected saveFile(dataURL: string): void; static ɵfac: i0.ɵɵFactoryDeclaration<ExcelExportComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<ExcelExportComponent, "kendo-excelexport", ["kendoExcelExport"], { "fileName": { "alias": "fileName"; "required": false; }; "filterable": { "alias": "filterable"; "required": false; }; "collapsible": { "alias": "collapsible"; "required": false; }; "creator": { "alias": "creator"; "required": false; }; "date": { "alias": "date"; "required": false; }; "forceProxy": { "alias": "forceProxy"; "required": false; }; "proxyURL": { "alias": "proxyURL"; "required": false; }; "data": { "alias": "data"; "required": false; }; "group": { "alias": "group"; "required": false; }; "paddingCellOptions": { "alias": "paddingCellOptions"; "required": false; }; "headerPaddingCellOptions": { "alias": "headerPaddingCellOptions"; "required": false; }; }, {}, ["columns"], never, true, never>; }