{"id":21585215,"url":"https://github.com/angular-ru/angular-ru-excel-example-app","last_synced_at":"2026-01-04T06:17:32.208Z","repository":{"id":90970938,"uuid":"276609955","full_name":"Angular-RU/angular-ru-excel-example-app","owner":"Angular-RU","description":"Demo: https://angular-ru.github.io/angular-ru-excel-example-app/","archived":false,"fork":false,"pushed_at":"2021-07-07T14:02:55.000Z","size":3623,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-24T15:29:56.206Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Angular-RU.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-02T09:52:47.000Z","updated_at":"2021-07-07T14:02:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"2d111204-5ef1-42b8-b642-3fef6e07a536","html_url":"https://github.com/Angular-RU/angular-ru-excel-example-app","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Angular-RU%2Fangular-ru-excel-example-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Angular-RU%2Fangular-ru-excel-example-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Angular-RU%2Fangular-ru-excel-example-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Angular-RU%2Fangular-ru-excel-example-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Angular-RU","download_url":"https://codeload.github.com/Angular-RU/angular-ru-excel-example-app/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244189829,"owners_count":20412991,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-24T15:09:32.409Z","updated_at":"2026-01-04T06:17:32.178Z","avatar_url":"https://github.com/Angular-RU.png","language":"HTML","readme":"# Excel Builder\n\n\u003e Small library for generate xls files via web worker\n\n```ts\nimport { NgModule } from '@angular/core';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { ExcelBuilderModule } from '@angular-ru/ng-excel-builder';\n\n@NgModule({\n    imports: [TranslateModule.forRoot(), ExcelBuilderModule.forRoot()]\n})\nexport class AppModule {}\n```\n\n## About\n\n\u003cdiv\u003e\nThis builder we made for simple and fast generation xls files on client-side. It works with small \u0026 medium data size. Files wil open only in Microsoft Excel(!).\nGoogle Spreadsheets, LibreOffice and another programs are not supported.\n\u003c/div\u003e\n\n## Install\n\n```\n$ npm install @angular-ru/ng-excel-builder --save\n```\n\n## Example with NGX Translate\n\n```ts\nimport { HttpClient, HttpClientModule } from '@angular/common/http';\nimport { NgModule } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatListModule } from '@angular/material/list';\nimport { MatSidenavModule } from '@angular/material/sidenav';\nimport { MatToolbarModule } from '@angular/material/toolbar';\nimport { BrowserModule } from '@angular/platform-browser';\nimport { BrowserAnimationsModule } from '@angular/platform-browser/animations';\nimport { RouterModule } from '@angular/router';\nimport { EXCEL_BUILDER_NGX_TRANSLATE_FALLBACK_PROVIDER, ExcelBuilderModule } from '@angular-ru/ng-excel-builder';\nimport { TranslateLoader, TranslateModule } from '@ngx-translate/core';\nimport { TranslateHttpLoader } from '@ngx-translate/http-loader';\n\nimport { AppComponent } from './app.component';\n\n// ts-prune-ignore-next\nexport function createTranslateLoader(http: HttpClient): TranslateHttpLoader {\n    return new TranslateHttpLoader(http, './assets/i18n/', `.json`);\n}\n\n@NgModule({\n    bootstrap: [AppComponent],\n    declarations: [AppComponent],\n    imports: [\n        BrowserModule,\n        MatListModule,\n        HttpClientModule,\n        MatToolbarModule,\n        MatSidenavModule,\n        MatButtonModule,\n        BrowserAnimationsModule,\n        TranslateModule.forRoot({\n            loader: {\n                deps: [HttpClient],\n                provide: TranslateLoader,\n                useFactory: createTranslateLoader\n            }\n        }),\n        RouterModule.forRoot([]),\n        ExcelBuilderModule.forRoot()\n    ],\n    providers: [EXCEL_BUILDER_NGX_TRANSLATE_FALLBACK_PROVIDER]\n})\nexport class AppModule {}\n```\n\nwhen we have `ru.json`\n\n```json\n{\n    \"APP_KEYS\": {\n        \"TITLE\": \"Название файла\",\n        \"WORKSHEET_NAME\": \"Лист 1\",\n        \"MODELS\": {\n            \"id\": \"id\",\n            \"name\": \"Имя\",\n            \"description\": \"Описание\"\n        }\n    }\n}\n```\n\n```ts\n@Component({\n    selector: 'app-root',\n    templateUrl: './app.component.html',\n    styleUrls: ['./app.component.css'],\n    encapsulation: ViewEncapsulation.None\n})\nexport class AppComponent {\n    public data: Any[] = [\n        {\n            id: 'id',\n            name: 'Maria',\n            description: 'Fugiat tempor sunt nostrud ad fugiat. Laboris velit duis incididunt culpa'\n        }\n    ];\n\n    constructor(protected excel: ExcelService, private readonly translate: TranslateService) {\n        this.translate.setDefaultLang('ru');\n    }\n\n    public exportExcel(): void {\n        this.excel.exportExcel({\n            filename: 'My excel file',\n            worksheets: [\n                {\n                    table: this.data,\n                    prefixKeyForTranslate: 'PATH_TO_KEYS',\n                    worksheetName: 'worksheet name'\n                }\n            ],\n            translatedKeys: {\n                PATH_TO_KEYS: {\n                    id: 'ID',\n                    name: 'Name',\n                    description: 'Description'\n                }\n            }\n        });\n    }\n\n    public exportExcelWithI18n(): void {\n        this.excel.exportExcel({\n            filename: 'APP_KEYS.TITLE',\n            worksheets: [\n                {\n                    table: this.data,\n                    prefixKeyForTranslate: 'APP_KEYS.MODELS',\n                    worksheetName: 'APP_KEYS.WORKSHEET_NAME'\n                }\n            ]\n        });\n    }\n}\n```\n\n-   `filename` - the generated file will be named like this.\n-   `worksheets` - array of objects with your data.\n\n    -   `prefixKeyForTranslate` will be used in translate function.\n    -   `worksheetName` - name of the sheet.\n    -   `entries` is an array of objects, which contains data for a sheet.\n\n-   `translatedKeys` - it's a dictionary for you column headers, you can leave it empty and then the column keys will be\n    generated as is.\n\n### Custom translate service\n\n```ts\nimport { Injectable } from '@angular/core';\n\n@Injectable()\nclass MyCustomTranslateService implements ExcelBuilderTextColumnInterceptor {\n    // ...\n}\n\n@NgModule({\n    // ...\n    providers: [\n        {\n            provide: EXCEL_BUILDER_INTERCEPTOR_TOKEN,\n            useClass: MyCustomTranslateService\n        }\n    ]\n})\nexport class AppModule {}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangular-ru%2Fangular-ru-excel-example-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangular-ru%2Fangular-ru-excel-example-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangular-ru%2Fangular-ru-excel-example-app/lists"}