시트 이름·머리글 고정·숨긴 컬럼 정하기Sheet name, frozen header and hidden columns
xlsx 파일의 시트 이름과 머리글 고정, 화면에서 숨긴 컬럼 포함 여부를 정해서 내려받아요.Set the sheet name, frozen header and whether hidden columns are included in the downloaded xlsx.
코드Code
탭을 골라 코드를 복사하세요. 위 화면은 이 코드를 그대로 실행한 결과예요.Pick a tab and copy the code. The preview above runs exactly this code.
이 화면은 새 모양 옵션을 켠 모양이에요: density: 'spacious', iconStyle: 'soft', motion: true (코드에 없으면 기본 모양으로 보여요)This preview has the new-look options on: density: 'spacious', iconStyle: 'soft', motion: true (without them in your code you get the default look)
이 예제는 추가 패키지가 필요해요. 내 컴퓨터에서 돌리려면 npm i maxgrid @maxgrid/export로 설치하세요.
버튼을 누르면 이 예제의 코드가 StackBlitz나 CodeSandbox로 전송돼요. 누르기 전에는 아무것도 보내지 않아요.
<div id="app">
<div class="toolbar">
<input
type="text"
aria-label="시트 이름"
placeholder="시트 이름 (비우면 주문)"
id="name"
/>
<select aria-label="머리글 고정" id="freeze">
<option value="yes" selected>고정</option>
<option value="no">고정 안 함</option>
</select>
<select aria-label="숨긴 컬럼" id="hidden">
<option value="no" selected>빼기</option>
<option value="yes">넣기</option>
</select>
<button type="button" id="download">내려받기</button>
</div>
<div id="grid" style="height: 330px"></div>
</div>
<script type="module" src="./main.js"></script>import { createGrid } from 'maxgrid';
import { actions, options, setup } from './example';
const api = createGrid(document.getElementById('grid'), options);
setup(api, console.log);
document.getElementById('name').addEventListener('input', (event) => actions.name(api, event.target.value));
document.getElementById('freeze').addEventListener('change', (event) => actions.freeze(api, event.target.value));
document.getElementById('hidden').addEventListener('change', (event) => actions.hidden(api, event.target.value));
document.getElementById('download').addEventListener('click', () => actions.download(api));import { withExport } from '@maxgrid/export';
const customers = ['한빛푸드', '소나무철물', '파란마켓', '단풍상회', '바다유통', '새벽식자재'];
const regions = ['서울', '부산', '대전', '광주'];
const rows = Array.from({ length: 12 }, (_, i) => ({
id: i + 1,
orderNo: `SO-${3001 + i}`,
customer: customers[i % customers.length],
region: regions[i % regions.length],
qty: 3 + ((i * 7) % 28),
price: 4200 + ((i * 1900) % 21000),
orderedAt: new Date(2026, 9, 1 + i * 2),
}));
// 시트 이름, 머리글 고정, 숨긴 컬럼, 컬럼 폭을 정해요. 컬럼 폭은 컬럼의 width를 따라가요(없으면 내용 길이에 맞춰요).
export const options = {
columns: [
{ id: 'orderNo', title: '주문번호', width: 100 },
{ id: 'customer', title: '거래처', width: 110 },
{ id: 'region', title: '지역', width: 70 },
{ id: 'qty', title: '수량', kind: 'number', width: 70, align: 'end' },
{
id: 'price',
title: '단가(원)',
kind: 'number',
width: 100,
align: 'end',
formatValue: (v) => Number(v).toLocaleString('ko-KR'),
},
{ id: 'orderedAt', title: '주문일', kind: 'date', width: 110 },
{ id: 'memo', title: '메모', width: 220, hidden: true },
],
rows: rows.map((r) => ({ ...r, memo: r.qty > 20 ? '대량 주문: 납품일 조율 필요' : '' })),
rowKey: 'id',
};
let sheetName = '주문';
let freezeHeader = true;
let includeHidden = false;
export const actions = {
name: (_api, v) => void (sheetName = (v ?? '').trim() || '주문'),
freeze: (_api, v) => void (freezeHeader = v !== 'no'),
hidden: (_api, v) => void (includeHidden = v === 'yes'),
download: async (api) => {
const ex = withExport(api);
const options = { sheetName, freezeHeader, includeHidden, applyFormatValue: false };
// 엑셀은 시트 이름을 31글자까지만, / \ ? * [ ] : 없이 받아요. 라이브러리가 고친 실제 이름을 파일에서 읽어 알려 줘요.
const book = new TextDecoder('utf-8').decode(ex.exportXlsx(options));
const actual = /<sheet name="([^"]*)"/.exec(book)?.[1] ?? sheetName;
await ex.downloadXlsx('주문-시트설정.xlsx', options);
const note = actual === sheetName ? '' : ` (입력한 이름 "${sheetName}" → 엑셀 규칙에 맞게 고쳤어요)`;
say({
ko: `내려받았어요. 시트 이름 "${actual}"${note} · 머리글 ${freezeHeader ? '고정' : '고정 안 함'} · 숨긴 컬럼 ${includeHidden ? '포함' : '제외'}`,
en: `Downloaded. Sheet name "${actual}"${note} · header ${freezeHeader ? 'frozen' : 'not frozen'} · hidden columns ${includeHidden ? 'included' : 'excluded'}`,
});
},
};
let say = () => { };
export function setup(api, log) {
say = log;
withExport(api);
log({
ko: '시트 이름 "주문" · 머리글 고정 · 숨긴 컬럼 제외로 내려받아요.',
en: 'Downloads with sheet name "주문" · header frozen · hidden columns excluded.',
});
} 이 HTML은 추가 번들(위 script 태그)도 함께 불러오고 전역 변수로 써요. 별도 설치는 필요 없어요.
<!doctype html>
<html lang="ko">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>시트 이름·머리글 고정·숨긴 컬럼 정하기</title>
</head>
<body>
<div class="toolbar">
<input
type="text"
aria-label="시트 이름"
placeholder="시트 이름 (비우면 주문)"
id="name"
/>
<select aria-label="머리글 고정" id="freeze">
<option value="yes" selected>고정</option>
<option value="no">고정 안 함</option>
</select>
<select aria-label="숨긴 컬럼" id="hidden">
<option value="no" selected>빼기</option>
<option value="yes">넣기</option>
</select>
<button type="button" id="download">내려받기</button>
</div>
<div id="grid" style="height: 330px"></div>
<ul id="log" aria-live="polite"></ul>
<script src="https://cdn.maxmine.com/maxgrid/latest/maxgrid.min.js"></script>
<script src="https://cdn.maxmine.com/maxgrid/latest/maxgrid.export.min.js"></script>
<script>
const { withExport } = MaxGridExport;
const customers = ['한빛푸드', '소나무철물', '파란마켓', '단풍상회', '바다유통', '새벽식자재'];
const regions = ['서울', '부산', '대전', '광주'];
const rows = Array.from({ length: 12 }, (_, i) => ({
id: i + 1,
orderNo: `SO-${3001 + i}`,
customer: customers[i % customers.length],
region: regions[i % regions.length],
qty: 3 + ((i * 7) % 28),
price: 4200 + ((i * 1900) % 21000),
orderedAt: new Date(2026, 9, 1 + i * 2),
}));
// 시트 이름, 머리글 고정, 숨긴 컬럼, 컬럼 폭을 정해요. 컬럼 폭은 컬럼의 width를 따라가요(없으면 내용 길이에 맞춰요).
const options = {
columns: [
{ id: 'orderNo', title: '주문번호', width: 100 },
{ id: 'customer', title: '거래처', width: 110 },
{ id: 'region', title: '지역', width: 70 },
{ id: 'qty', title: '수량', kind: 'number', width: 70, align: 'end' },
{
id: 'price',
title: '단가(원)',
kind: 'number',
width: 100,
align: 'end',
formatValue: (v) => Number(v).toLocaleString('ko-KR'),
},
{ id: 'orderedAt', title: '주문일', kind: 'date', width: 110 },
{ id: 'memo', title: '메모', width: 220, hidden: true },
],
rows: rows.map((r) => ({ ...r, memo: r.qty > 20 ? '대량 주문: 납품일 조율 필요' : '' })),
rowKey: 'id',
};
let sheetName = '주문';
let freezeHeader = true;
let includeHidden = false;
const actions = {
name: (_api, v) => void (sheetName = (v ?? '').trim() || '주문'),
freeze: (_api, v) => void (freezeHeader = v !== 'no'),
hidden: (_api, v) => void (includeHidden = v === 'yes'),
download: async (api) => {
const ex = withExport(api);
const options = { sheetName, freezeHeader, includeHidden, applyFormatValue: false };
// 엑셀은 시트 이름을 31글자까지만, / \ ? * [ ] : 없이 받아요. 라이브러리가 고친 실제 이름을 파일에서 읽어 알려 줘요.
const book = new TextDecoder('utf-8').decode(ex.exportXlsx(options));
const actual = /<sheet name="([^"]*)"/.exec(book)?.[1] ?? sheetName;
await ex.downloadXlsx('주문-시트설정.xlsx', options);
const note = actual === sheetName ? '' : ` (입력한 이름 "${sheetName}" → 엑셀 규칙에 맞게 고쳤어요)`;
say({
ko: `내려받았어요. 시트 이름 "${actual}"${note} · 머리글 ${freezeHeader ? '고정' : '고정 안 함'} · 숨긴 컬럼 ${includeHidden ? '포함' : '제외'}`,
en: `Downloaded. Sheet name "${actual}"${note} · header ${freezeHeader ? 'frozen' : 'not frozen'} · hidden columns ${includeHidden ? 'included' : 'excluded'}`,
});
},
};
let say = () => { };
function setup(api, log) {
say = log;
withExport(api);
log({
ko: '시트 이름 "주문" · 머리글 고정 · 숨긴 컬럼 제외로 내려받아요.',
en: 'Downloads with sheet name "주문" · header frozen · hidden columns excluded.',
});
}
options.ariaLabel = "시트 이름·머리글 고정·숨긴 컬럼 정하기";
const api = MaxGrid.createGrid(document.getElementById('grid'), options);
setup(api, (message) => {
const item = document.createElement('li');
item.textContent =
typeof message === 'string' ? message : navigator.language.startsWith('ko') ? message.ko : message.en;
document.getElementById('log').prepend(item);
});
document.getElementById('name').addEventListener('input', (event) => actions.name(api, event.target.value));
document.getElementById('freeze').addEventListener('change', (event) => actions.freeze(api, event.target.value));
document.getElementById('hidden').addEventListener('change', (event) => actions.hidden(api, event.target.value));
document.getElementById('download').addEventListener('click', () => actions.download(api));
</script>
</body>
</html> 이 예제는 추가 패키지가 필요해요. 내 컴퓨터에서 돌리려면 npm i @maxgrid/react @maxgrid/export로 설치하세요.
버튼을 누르면 이 예제의 코드가 StackBlitz나 CodeSandbox로 전송돼요. 누르기 전에는 아무것도 보내지 않아요.
import { useEffect } from 'react';
import { Grid, useGridApi } from '@maxgrid/react';
import { actions, options, setup, type Row } from './example';
export function ExampleGrid() {
const [api, gridRef] = useGridApi<Row>();
useEffect(() => (api ? setup(api, console.log) : undefined), [api]);
return (
<>
<div className="toolbar">
<input
type="text"
aria-label="시트 이름"
placeholder="시트 이름 (비우면 주문)"
disabled={!api}
onChange={(event) => api && actions.name(api, event.target.value)}
/>
<select
aria-label="머리글 고정"
disabled={!api}
onChange={(event) => api && actions.freeze(api, event.target.value)}
>
<option value="yes">고정</option>
<option value="no">고정 안 함</option>
</select>
<select defaultValue="yes"
aria-label="숨긴 컬럼"
disabled={!api}
onChange={(event) => api && actions.hidden(api, event.target.value)}
>
<option value="no">빼기</option>
<option value="yes">넣기</option>
</select>
<button
type="button"
disabled={!api}
onClick={() => api && actions.download(api)}
>내려받기</button>
</div>
<Grid style={{ height: 330 }} ref={gridRef} options={options} />
</>
);
}import { withExport } from '@maxgrid/export';
import type { GridApi, GridOptions } from '@maxgrid/react';
export type LogText = string | { ko: string; en: string };
export interface Row {
id: number;
orderNo: string;
customer: string;
region: string;
qty: number;
price: number;
orderedAt: Date;
}
const customers = ['한빛푸드', '소나무철물', '파란마켓', '단풍상회', '바다유통', '새벽식자재'];
const regions = ['서울', '부산', '대전', '광주'];
const rows: Row[] = Array.from({ length: 12 }, (_, i) => ({
id: i + 1,
orderNo: `SO-${3001 + i}`,
customer: customers[i % customers.length] as string,
region: regions[i % regions.length] as string,
qty: 3 + ((i * 7) % 28),
price: 4200 + ((i * 1900) % 21000),
orderedAt: new Date(2026, 9, 1 + i * 2),
}));
// 시트 이름, 머리글 고정, 숨긴 컬럼, 컬럼 폭을 정해요. 컬럼 폭은 컬럼의 width를 따라가요(없으면 내용 길이에 맞춰요).
export const options: GridOptions<Row & { memo: string }> = {
columns: [
{ id: 'orderNo', title: '주문번호', width: 100 },
{ id: 'customer', title: '거래처', width: 110 },
{ id: 'region', title: '지역', width: 70 },
{ id: 'qty', title: '수량', kind: 'number', width: 70, align: 'end' },
{
id: 'price',
title: '단가(원)',
kind: 'number',
width: 100,
align: 'end',
formatValue: (v) => Number(v).toLocaleString('ko-KR'),
},
{ id: 'orderedAt', title: '주문일', kind: 'date', width: 110 },
{ id: 'memo', title: '메모', width: 220, hidden: true },
],
rows: rows.map((r) => ({ ...r, memo: r.qty > 20 ? '대량 주문: 납품일 조율 필요' : '' })),
rowKey: 'id',
};
let sheetName = '주문';
let freezeHeader = true;
let includeHidden = false;
export const actions = {
name: (_api: GridApi<Row>, v?: string) => void (sheetName = (v ?? '').trim() || '주문'),
freeze: (_api: GridApi<Row>, v?: string) => void (freezeHeader = v !== 'no'),
hidden: (_api: GridApi<Row>, v?: string) => void (includeHidden = v === 'yes'),
download: async (api: GridApi<Row>) => {
const ex = withExport(api);
const options = { sheetName, freezeHeader, includeHidden, applyFormatValue: false };
// 엑셀은 시트 이름을 31글자까지만, / \ ? * [ ] : 없이 받아요. 라이브러리가 고친 실제 이름을 파일에서 읽어 알려 줘요.
const book = new TextDecoder('utf-8').decode(ex.exportXlsx(options));
const actual = /<sheet name="([^"]*)"/.exec(book)?.[1] ?? sheetName;
await ex.downloadXlsx('주문-시트설정.xlsx', options);
const note =
actual === sheetName ? '' : ` (입력한 이름 "${sheetName}" → 엑셀 규칙에 맞게 고쳤어요)`;
say({
ko: `내려받았어요. 시트 이름 "${actual}"${note} · 머리글 ${freezeHeader ? '고정' : '고정 안 함'} · 숨긴 컬럼 ${includeHidden ? '포함' : '제외'}`,
en: `Downloaded. Sheet name "${actual}"${note} · header ${freezeHeader ? 'frozen' : 'not frozen'} · hidden columns ${includeHidden ? 'included' : 'excluded'}`,
});
},
};
let say: (message: LogText) => void = () => {};
export function setup(api: GridApi<Row>, log: (message: LogText) => void) {
say = log;
withExport(api);
log({
ko: '시트 이름 "주문" · 머리글 고정 · 숨긴 컬럼 제외로 내려받아요.',
en: 'Downloads with sheet name "주문" · header frozen · hidden columns excluded.',
});
} 이 예제는 추가 패키지가 필요해요. 내 컴퓨터에서 돌리려면 npm i @maxgrid/vue @maxgrid/export로 설치하세요.
버튼을 누르면 이 예제의 코드가 StackBlitz나 CodeSandbox로 전송돼요. 누르기 전에는 아무것도 보내지 않아요.
<script setup lang="ts">
import { onBeforeUnmount, shallowRef } from 'vue';
import { Grid, type GridApi } from '@maxgrid/vue';
import { actions, options, setup, type Row } from './example';
const api = shallowRef<GridApi<Row> | null>(null);
let stop: (() => void) | undefined;
function onReady(event: { api: GridApi<Row> }) {
api.value = event.api;
stop = setup(event.api, console.log);
}
onBeforeUnmount(() => stop?.());
</script>
<template>
<div class="toolbar">
<input
type="text"
aria-label="시트 이름"
placeholder="시트 이름 (비우면 주문)"
:disabled="!api"
@input="api && actions.name(api, ($event.target as HTMLInputElement).value)"
/>
<select
aria-label="머리글 고정"
:disabled="!api"
@change="api && actions.freeze(api, ($event.target as HTMLSelectElement).value)"
>
<option value="yes" selected>고정</option>
<option value="no">고정 안 함</option>
</select>
<select
aria-label="숨긴 컬럼"
:disabled="!api"
@change="api && actions.hidden(api, ($event.target as HTMLSelectElement).value)"
>
<option value="no" selected>빼기</option>
<option value="yes">넣기</option>
</select>
<button
type="button"
:disabled="!api"
@click="api && actions.download(api)"
>내려받기</button>
</div>
<Grid style="height: 330px" :options="options" @ready="onReady" />
</template>import { withExport } from '@maxgrid/export';
import type { GridApi, GridOptions } from '@maxgrid/vue';
export type LogText = string | { ko: string; en: string };
export interface Row {
id: number;
orderNo: string;
customer: string;
region: string;
qty: number;
price: number;
orderedAt: Date;
}
const customers = ['한빛푸드', '소나무철물', '파란마켓', '단풍상회', '바다유통', '새벽식자재'];
const regions = ['서울', '부산', '대전', '광주'];
const rows: Row[] = Array.from({ length: 12 }, (_, i) => ({
id: i + 1,
orderNo: `SO-${3001 + i}`,
customer: customers[i % customers.length] as string,
region: regions[i % regions.length] as string,
qty: 3 + ((i * 7) % 28),
price: 4200 + ((i * 1900) % 21000),
orderedAt: new Date(2026, 9, 1 + i * 2),
}));
// 시트 이름, 머리글 고정, 숨긴 컬럼, 컬럼 폭을 정해요. 컬럼 폭은 컬럼의 width를 따라가요(없으면 내용 길이에 맞춰요).
export const options: GridOptions<Row & { memo: string }> = {
columns: [
{ id: 'orderNo', title: '주문번호', width: 100 },
{ id: 'customer', title: '거래처', width: 110 },
{ id: 'region', title: '지역', width: 70 },
{ id: 'qty', title: '수량', kind: 'number', width: 70, align: 'end' },
{
id: 'price',
title: '단가(원)',
kind: 'number',
width: 100,
align: 'end',
formatValue: (v) => Number(v).toLocaleString('ko-KR'),
},
{ id: 'orderedAt', title: '주문일', kind: 'date', width: 110 },
{ id: 'memo', title: '메모', width: 220, hidden: true },
],
rows: rows.map((r) => ({ ...r, memo: r.qty > 20 ? '대량 주문: 납품일 조율 필요' : '' })),
rowKey: 'id',
};
let sheetName = '주문';
let freezeHeader = true;
let includeHidden = false;
export const actions = {
name: (_api: GridApi<Row>, v?: string) => void (sheetName = (v ?? '').trim() || '주문'),
freeze: (_api: GridApi<Row>, v?: string) => void (freezeHeader = v !== 'no'),
hidden: (_api: GridApi<Row>, v?: string) => void (includeHidden = v === 'yes'),
download: async (api: GridApi<Row>) => {
const ex = withExport(api);
const options = { sheetName, freezeHeader, includeHidden, applyFormatValue: false };
// 엑셀은 시트 이름을 31글자까지만, / \ ? * [ ] : 없이 받아요. 라이브러리가 고친 실제 이름을 파일에서 읽어 알려 줘요.
const book = new TextDecoder('utf-8').decode(ex.exportXlsx(options));
const actual = /<sheet name="([^"]*)"/.exec(book)?.[1] ?? sheetName;
await ex.downloadXlsx('주문-시트설정.xlsx', options);
const note =
actual === sheetName ? '' : ` (입력한 이름 "${sheetName}" → 엑셀 규칙에 맞게 고쳤어요)`;
say({
ko: `내려받았어요. 시트 이름 "${actual}"${note} · 머리글 ${freezeHeader ? '고정' : '고정 안 함'} · 숨긴 컬럼 ${includeHidden ? '포함' : '제외'}`,
en: `Downloaded. Sheet name "${actual}"${note} · header ${freezeHeader ? 'frozen' : 'not frozen'} · hidden columns ${includeHidden ? 'included' : 'excluded'}`,
});
},
};
let say: (message: LogText) => void = () => {};
export function setup(api: GridApi<Row>, log: (message: LogText) => void) {
say = log;
withExport(api);
log({
ko: '시트 이름 "주문" · 머리글 고정 · 숨긴 컬럼 제외로 내려받아요.',
en: 'Downloads with sheet name "주문" · header frozen · hidden columns excluded.',
});
} 이 예제는 추가 패키지가 필요해요. 내 컴퓨터에서 돌리려면 npm i @maxgrid/angular @maxgrid/export로 설치하세요.
버튼을 누르면 이 예제의 코드가 StackBlitz나 CodeSandbox로 전송돼요. 누르기 전에는 아무것도 보내지 않아요.
import { Component, OnDestroy } from '@angular/core';
import { GridComponent, isGridEvent, type GridApi, type GridEventMessage } from '@maxgrid/angular';
import { actions, options, setup, type Row } from './example';
@Component({
selector: 'app-example-grid',
standalone: true,
imports: [GridComponent],
template: `
<div class="toolbar">
<input
type="text"
aria-label="시트 이름"
placeholder="시트 이름 (비우면 주문)"
[disabled]="!api"
(input)="api && actions.name(api, $any($event.target).value)"
/>
<select
aria-label="머리글 고정"
[disabled]="!api"
(change)="api && actions.freeze(api, $any($event.target).value)"
>
<option value="yes" selected>고정</option>
<option value="no">고정 안 함</option>
</select>
<select
aria-label="숨긴 컬럼"
[disabled]="!api"
(change)="api && actions.hidden(api, $any($event.target).value)"
>
<option value="no" selected>빼기</option>
<option value="yes">넣기</option>
</select>
<button
type="button"
[disabled]="!api"
(click)="api && actions.download(api)"
>내려받기</button>
</div>
<mx-grid style="height: 330px" [options]="options" [events]="relayed" (gridEvent)="onEvent($event)" />
`,
})
export class ExampleGridComponent implements OnDestroy {
readonly options = options;
readonly actions = actions;
readonly relayed = ['ready'] as const;
api: GridApi<Row> | null = null;
private stop: (() => void) | null = null;
onEvent(event: GridEventMessage<Row>): void {
if (isGridEvent(event, 'ready')) {
this.api = event.payload.api;
this.stop = setup(this.api, console.log);
}
}
ngOnDestroy(): void {
this.stop?.();
}
}import { withExport } from '@maxgrid/export';
import type { GridApi, GridOptions } from '@maxgrid/angular';
export type LogText = string | { ko: string; en: string };
export interface Row {
id: number;
orderNo: string;
customer: string;
region: string;
qty: number;
price: number;
orderedAt: Date;
}
const customers = ['한빛푸드', '소나무철물', '파란마켓', '단풍상회', '바다유통', '새벽식자재'];
const regions = ['서울', '부산', '대전', '광주'];
const rows: Row[] = Array.from({ length: 12 }, (_, i) => ({
id: i + 1,
orderNo: `SO-${3001 + i}`,
customer: customers[i % customers.length] as string,
region: regions[i % regions.length] as string,
qty: 3 + ((i * 7) % 28),
price: 4200 + ((i * 1900) % 21000),
orderedAt: new Date(2026, 9, 1 + i * 2),
}));
// 시트 이름, 머리글 고정, 숨긴 컬럼, 컬럼 폭을 정해요. 컬럼 폭은 컬럼의 width를 따라가요(없으면 내용 길이에 맞춰요).
export const options: GridOptions<Row & { memo: string }> = {
columns: [
{ id: 'orderNo', title: '주문번호', width: 100 },
{ id: 'customer', title: '거래처', width: 110 },
{ id: 'region', title: '지역', width: 70 },
{ id: 'qty', title: '수량', kind: 'number', width: 70, align: 'end' },
{
id: 'price',
title: '단가(원)',
kind: 'number',
width: 100,
align: 'end',
formatValue: (v) => Number(v).toLocaleString('ko-KR'),
},
{ id: 'orderedAt', title: '주문일', kind: 'date', width: 110 },
{ id: 'memo', title: '메모', width: 220, hidden: true },
],
rows: rows.map((r) => ({ ...r, memo: r.qty > 20 ? '대량 주문: 납품일 조율 필요' : '' })),
rowKey: 'id',
};
let sheetName = '주문';
let freezeHeader = true;
let includeHidden = false;
export const actions = {
name: (_api: GridApi<Row>, v?: string) => void (sheetName = (v ?? '').trim() || '주문'),
freeze: (_api: GridApi<Row>, v?: string) => void (freezeHeader = v !== 'no'),
hidden: (_api: GridApi<Row>, v?: string) => void (includeHidden = v === 'yes'),
download: async (api: GridApi<Row>) => {
const ex = withExport(api);
const options = { sheetName, freezeHeader, includeHidden, applyFormatValue: false };
// 엑셀은 시트 이름을 31글자까지만, / \ ? * [ ] : 없이 받아요. 라이브러리가 고친 실제 이름을 파일에서 읽어 알려 줘요.
const book = new TextDecoder('utf-8').decode(ex.exportXlsx(options));
const actual = /<sheet name="([^"]*)"/.exec(book)?.[1] ?? sheetName;
await ex.downloadXlsx('주문-시트설정.xlsx', options);
const note =
actual === sheetName ? '' : ` (입력한 이름 "${sheetName}" → 엑셀 규칙에 맞게 고쳤어요)`;
say({
ko: `내려받았어요. 시트 이름 "${actual}"${note} · 머리글 ${freezeHeader ? '고정' : '고정 안 함'} · 숨긴 컬럼 ${includeHidden ? '포함' : '제외'}`,
en: `Downloaded. Sheet name "${actual}"${note} · header ${freezeHeader ? 'frozen' : 'not frozen'} · hidden columns ${includeHidden ? 'included' : 'excluded'}`,
});
},
};
let say: (message: LogText) => void = () => {};
export function setup(api: GridApi<Row>, log: (message: LogText) => void) {
say = log;
withExport(api);
log({
ko: '시트 이름 "주문" · 머리글 고정 · 숨긴 컬럼 제외로 내려받아요.',
en: 'Downloads with sheet name "주문" · header frozen · hidden columns excluded.',
});
} This example needs an extra package. To run it locally, install with npm i maxgrid @maxgrid/export.
When you click, the example code is sent to StackBlitz or CodeSandbox. Nothing is sent before you click.
<div id="app">
<div class="toolbar">
<input
type="text"
aria-label="Sheet name"
placeholder="Sheet name (blank = Orders)"
id="name"
/>
<select aria-label="Freeze header" id="freeze">
<option value="yes" selected>Frozen</option>
<option value="no">Not frozen</option>
</select>
<select aria-label="Hidden columns" id="hidden">
<option value="no" selected>Exclude</option>
<option value="yes">Include</option>
</select>
<button type="button" id="download">Download</button>
</div>
<div id="grid" style="height: 330px"></div>
</div>
<script type="module" src="./main.js"></script>import { createGrid } from 'maxgrid';
import { actions, options, setup } from './example';
const api = createGrid(document.getElementById('grid'), options);
setup(api, console.log);
document.getElementById('name').addEventListener('input', (event) => actions.name(api, event.target.value));
document.getElementById('freeze').addEventListener('change', (event) => actions.freeze(api, event.target.value));
document.getElementById('hidden').addEventListener('change', (event) => actions.hidden(api, event.target.value));
document.getElementById('download').addEventListener('click', () => actions.download(api));import { withExport } from '@maxgrid/export';
const customers = [
'Harbor Foods',
'Pine Hardware',
'Blue Market',
'Maple Trading',
'Ocean Supply',
'Dawn Grocers',
];
const regions = ['Seoul', 'Busan', 'Daejeon', 'Gwangju'];
const rows = Array.from({ length: 12 }, (_, i) => ({
id: i + 1,
orderNo: `SO-${3001 + i}`,
customer: customers[i % customers.length],
region: regions[i % regions.length],
qty: 3 + ((i * 7) % 28),
price: 4200 + ((i * 1900) % 21000),
orderedAt: new Date(2026, 9, 1 + i * 2),
}));
// Set the sheet name, frozen header, hidden columns and column widths. Column widths follow each column's width (or fit the content if none).
export const options = {
columns: [
{ id: 'orderNo', title: 'Order no.', width: 100 },
{ id: 'customer', title: 'Customer', width: 110 },
{ id: 'region', title: 'Region', width: 80 },
{ id: 'qty', title: 'Qty', kind: 'number', width: 70, align: 'end' },
{
id: 'price',
title: 'Price ($)',
kind: 'number',
width: 100,
align: 'end',
formatValue: (v) => Number(v).toLocaleString('en-US'),
},
{ id: 'orderedAt', title: 'Ordered', kind: 'date', width: 110 },
{ id: 'memo', title: 'Memo', width: 220, hidden: true },
],
rows: rows.map((r) => ({
...r,
memo: r.qty > 20 ? 'Bulk order: delivery date needs to be arranged' : '',
})),
rowKey: 'id',
};
let sheetName = 'Orders';
let freezeHeader = true;
let includeHidden = false;
export const actions = {
name: (_api, v) => void (sheetName = (v ?? '').trim() || 'Orders'),
freeze: (_api, v) => void (freezeHeader = v !== 'no'),
hidden: (_api, v) => void (includeHidden = v === 'yes'),
download: async (api) => {
const ex = withExport(api);
const options = { sheetName, freezeHeader, includeHidden, applyFormatValue: false };
// Excel accepts sheet names up to 31 characters without / \ ? * [ ] :. Read the actual name the library fixed from the file.
const book = new TextDecoder('utf-8').decode(ex.exportXlsx(options));
const actual = /<sheet name="([^"]*)"/.exec(book)?.[1] ?? sheetName;
await ex.downloadXlsx('orders-sheet-options.xlsx', options);
const note = actual === sheetName
? ''
: ` (the name you entered, "${sheetName}", was fixed to follow Excel rules)`;
say(`Downloaded. Sheet name "${actual}"${note} · header ${freezeHeader ? 'frozen' : 'not frozen'} · hidden columns ${includeHidden ? 'included' : 'excluded'}`);
},
};
let say = () => { };
export function setup(api, log) {
say = log;
withExport(api);
log('Downloads with sheet name "Orders" · header frozen · hidden columns excluded.');
}This HTML also loads an extra bundle (the extra script tag above) and uses it as a global. No install is needed.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Sheet name, frozen header and hidden columns</title>
</head>
<body>
<div class="toolbar">
<input
type="text"
aria-label="Sheet name"
placeholder="Sheet name (blank = Orders)"
id="name"
/>
<select aria-label="Freeze header" id="freeze">
<option value="yes" selected>Frozen</option>
<option value="no">Not frozen</option>
</select>
<select aria-label="Hidden columns" id="hidden">
<option value="no" selected>Exclude</option>
<option value="yes">Include</option>
</select>
<button type="button" id="download">Download</button>
</div>
<div id="grid" style="height: 330px"></div>
<ul id="log" aria-live="polite"></ul>
<script src="https://cdn.maxmine.com/maxgrid/latest/maxgrid.min.js"></script>
<script src="https://cdn.maxmine.com/maxgrid/latest/maxgrid.export.min.js"></script>
<script>
const { withExport } = MaxGridExport;
const customers = [
'Harbor Foods',
'Pine Hardware',
'Blue Market',
'Maple Trading',
'Ocean Supply',
'Dawn Grocers',
];
const regions = ['Seoul', 'Busan', 'Daejeon', 'Gwangju'];
const rows = Array.from({ length: 12 }, (_, i) => ({
id: i + 1,
orderNo: `SO-${3001 + i}`,
customer: customers[i % customers.length],
region: regions[i % regions.length],
qty: 3 + ((i * 7) % 28),
price: 4200 + ((i * 1900) % 21000),
orderedAt: new Date(2026, 9, 1 + i * 2),
}));
// Set the sheet name, frozen header, hidden columns and column widths. Column widths follow each column's width (or fit the content if none).
const options = {
columns: [
{ id: 'orderNo', title: 'Order no.', width: 100 },
{ id: 'customer', title: 'Customer', width: 110 },
{ id: 'region', title: 'Region', width: 80 },
{ id: 'qty', title: 'Qty', kind: 'number', width: 70, align: 'end' },
{
id: 'price',
title: 'Price ($)',
kind: 'number',
width: 100,
align: 'end',
formatValue: (v) => Number(v).toLocaleString('en-US'),
},
{ id: 'orderedAt', title: 'Ordered', kind: 'date', width: 110 },
{ id: 'memo', title: 'Memo', width: 220, hidden: true },
],
rows: rows.map((r) => ({
...r,
memo: r.qty > 20 ? 'Bulk order: delivery date needs to be arranged' : '',
})),
rowKey: 'id',
};
let sheetName = 'Orders';
let freezeHeader = true;
let includeHidden = false;
const actions = {
name: (_api, v) => void (sheetName = (v ?? '').trim() || 'Orders'),
freeze: (_api, v) => void (freezeHeader = v !== 'no'),
hidden: (_api, v) => void (includeHidden = v === 'yes'),
download: async (api) => {
const ex = withExport(api);
const options = { sheetName, freezeHeader, includeHidden, applyFormatValue: false };
// Excel accepts sheet names up to 31 characters without / \ ? * [ ] :. Read the actual name the library fixed from the file.
const book = new TextDecoder('utf-8').decode(ex.exportXlsx(options));
const actual = /<sheet name="([^"]*)"/.exec(book)?.[1] ?? sheetName;
await ex.downloadXlsx('orders-sheet-options.xlsx', options);
const note = actual === sheetName
? ''
: ` (the name you entered, "${sheetName}", was fixed to follow Excel rules)`;
say(`Downloaded. Sheet name "${actual}"${note} · header ${freezeHeader ? 'frozen' : 'not frozen'} · hidden columns ${includeHidden ? 'included' : 'excluded'}`);
},
};
let say = () => { };
function setup(api, log) {
say = log;
withExport(api);
log('Downloads with sheet name "Orders" · header frozen · hidden columns excluded.');
}
options.ariaLabel = "Sheet name, frozen header and hidden columns";
const api = MaxGrid.createGrid(document.getElementById('grid'), options);
setup(api, (message) => {
const item = document.createElement('li');
item.textContent =
typeof message === 'string' ? message : navigator.language.startsWith('ko') ? message.ko : message.en;
document.getElementById('log').prepend(item);
});
document.getElementById('name').addEventListener('input', (event) => actions.name(api, event.target.value));
document.getElementById('freeze').addEventListener('change', (event) => actions.freeze(api, event.target.value));
document.getElementById('hidden').addEventListener('change', (event) => actions.hidden(api, event.target.value));
document.getElementById('download').addEventListener('click', () => actions.download(api));
</script>
</body>
</html> This example needs an extra package. To run it locally, install with npm i @maxgrid/react @maxgrid/export.
When you click, the example code is sent to StackBlitz or CodeSandbox. Nothing is sent before you click.
import { useEffect } from 'react';
import { Grid, useGridApi } from '@maxgrid/react';
import { actions, options, setup, type Row } from './example';
export function ExampleGrid() {
const [api, gridRef] = useGridApi<Row>();
useEffect(() => (api ? setup(api, console.log) : undefined), [api]);
return (
<>
<div className="toolbar">
<input
type="text"
aria-label="Sheet name"
placeholder="Sheet name (blank = Orders)"
disabled={!api}
onChange={(event) => api && actions.name(api, event.target.value)}
/>
<select
aria-label="Freeze header"
disabled={!api}
onChange={(event) => api && actions.freeze(api, event.target.value)}
>
<option value="yes">Frozen</option>
<option value="no">Not frozen</option>
</select>
<select defaultValue="yes"
aria-label="Hidden columns"
disabled={!api}
onChange={(event) => api && actions.hidden(api, event.target.value)}
>
<option value="no">Exclude</option>
<option value="yes">Include</option>
</select>
<button
type="button"
disabled={!api}
onClick={() => api && actions.download(api)}
>Download</button>
</div>
<Grid style={{ height: 330 }} ref={gridRef} options={options} />
</>
);
}import { withExport } from '@maxgrid/export';
import type { GridApi, GridOptions } from '@maxgrid/react';
export type LogText = string;
export interface Row {
id: number;
orderNo: string;
customer: string;
region: string;
qty: number;
price: number;
orderedAt: Date;
}
const customers = [
'Harbor Foods',
'Pine Hardware',
'Blue Market',
'Maple Trading',
'Ocean Supply',
'Dawn Grocers',
];
const regions = ['Seoul', 'Busan', 'Daejeon', 'Gwangju'];
const rows: Row[] = Array.from({ length: 12 }, (_, i) => ({
id: i + 1,
orderNo: `SO-${3001 + i}`,
customer: customers[i % customers.length] as string,
region: regions[i % regions.length] as string,
qty: 3 + ((i * 7) % 28),
price: 4200 + ((i * 1900) % 21000),
orderedAt: new Date(2026, 9, 1 + i * 2),
}));
// Set the sheet name, frozen header, hidden columns and column widths. Column widths follow each column's width (or fit the content if none).
export const options: GridOptions<Row & { memo: string }> = {
columns: [
{ id: 'orderNo', title: 'Order no.', width: 100 },
{ id: 'customer', title: 'Customer', width: 110 },
{ id: 'region', title: 'Region', width: 80 },
{ id: 'qty', title: 'Qty', kind: 'number', width: 70, align: 'end' },
{
id: 'price',
title: 'Price ($)',
kind: 'number',
width: 100,
align: 'end',
formatValue: (v) => Number(v).toLocaleString('en-US'),
},
{ id: 'orderedAt', title: 'Ordered', kind: 'date', width: 110 },
{ id: 'memo', title: 'Memo', width: 220, hidden: true },
],
rows: rows.map((r) => ({
...r,
memo: r.qty > 20 ? 'Bulk order: delivery date needs to be arranged' : '',
})),
rowKey: 'id',
};
let sheetName = 'Orders';
let freezeHeader = true;
let includeHidden = false;
export const actions = {
name: (_api: GridApi<Row>, v?: string) => void (sheetName = (v ?? '').trim() || 'Orders'),
freeze: (_api: GridApi<Row>, v?: string) => void (freezeHeader = v !== 'no'),
hidden: (_api: GridApi<Row>, v?: string) => void (includeHidden = v === 'yes'),
download: async (api: GridApi<Row>) => {
const ex = withExport(api);
const options = { sheetName, freezeHeader, includeHidden, applyFormatValue: false };
// Excel accepts sheet names up to 31 characters without / \ ? * [ ] :. Read the actual name the library fixed from the file.
const book = new TextDecoder('utf-8').decode(ex.exportXlsx(options));
const actual = /<sheet name="([^"]*)"/.exec(book)?.[1] ?? sheetName;
await ex.downloadXlsx('orders-sheet-options.xlsx', options);
const note =
actual === sheetName
? ''
: ` (the name you entered, "${sheetName}", was fixed to follow Excel rules)`;
say(
`Downloaded. Sheet name "${actual}"${note} · header ${freezeHeader ? 'frozen' : 'not frozen'} · hidden columns ${includeHidden ? 'included' : 'excluded'}`,
);
},
};
let say: (message: LogText) => void = () => {};
export function setup(api: GridApi<Row>, log: (message: LogText) => void) {
say = log;
withExport(api);
log('Downloads with sheet name "Orders" · header frozen · hidden columns excluded.');
} This example needs an extra package. To run it locally, install with npm i @maxgrid/vue @maxgrid/export.
When you click, the example code is sent to StackBlitz or CodeSandbox. Nothing is sent before you click.
<script setup lang="ts">
import { onBeforeUnmount, shallowRef } from 'vue';
import { Grid, type GridApi } from '@maxgrid/vue';
import { actions, options, setup, type Row } from './example';
const api = shallowRef<GridApi<Row> | null>(null);
let stop: (() => void) | undefined;
function onReady(event: { api: GridApi<Row> }) {
api.value = event.api;
stop = setup(event.api, console.log);
}
onBeforeUnmount(() => stop?.());
</script>
<template>
<div class="toolbar">
<input
type="text"
aria-label="Sheet name"
placeholder="Sheet name (blank = Orders)"
:disabled="!api"
@input="api && actions.name(api, ($event.target as HTMLInputElement).value)"
/>
<select
aria-label="Freeze header"
:disabled="!api"
@change="api && actions.freeze(api, ($event.target as HTMLSelectElement).value)"
>
<option value="yes" selected>Frozen</option>
<option value="no">Not frozen</option>
</select>
<select
aria-label="Hidden columns"
:disabled="!api"
@change="api && actions.hidden(api, ($event.target as HTMLSelectElement).value)"
>
<option value="no" selected>Exclude</option>
<option value="yes">Include</option>
</select>
<button
type="button"
:disabled="!api"
@click="api && actions.download(api)"
>Download</button>
</div>
<Grid style="height: 330px" :options="options" @ready="onReady" />
</template>import { withExport } from '@maxgrid/export';
import type { GridApi, GridOptions } from '@maxgrid/vue';
export type LogText = string;
export interface Row {
id: number;
orderNo: string;
customer: string;
region: string;
qty: number;
price: number;
orderedAt: Date;
}
const customers = [
'Harbor Foods',
'Pine Hardware',
'Blue Market',
'Maple Trading',
'Ocean Supply',
'Dawn Grocers',
];
const regions = ['Seoul', 'Busan', 'Daejeon', 'Gwangju'];
const rows: Row[] = Array.from({ length: 12 }, (_, i) => ({
id: i + 1,
orderNo: `SO-${3001 + i}`,
customer: customers[i % customers.length] as string,
region: regions[i % regions.length] as string,
qty: 3 + ((i * 7) % 28),
price: 4200 + ((i * 1900) % 21000),
orderedAt: new Date(2026, 9, 1 + i * 2),
}));
// Set the sheet name, frozen header, hidden columns and column widths. Column widths follow each column's width (or fit the content if none).
export const options: GridOptions<Row & { memo: string }> = {
columns: [
{ id: 'orderNo', title: 'Order no.', width: 100 },
{ id: 'customer', title: 'Customer', width: 110 },
{ id: 'region', title: 'Region', width: 80 },
{ id: 'qty', title: 'Qty', kind: 'number', width: 70, align: 'end' },
{
id: 'price',
title: 'Price ($)',
kind: 'number',
width: 100,
align: 'end',
formatValue: (v) => Number(v).toLocaleString('en-US'),
},
{ id: 'orderedAt', title: 'Ordered', kind: 'date', width: 110 },
{ id: 'memo', title: 'Memo', width: 220, hidden: true },
],
rows: rows.map((r) => ({
...r,
memo: r.qty > 20 ? 'Bulk order: delivery date needs to be arranged' : '',
})),
rowKey: 'id',
};
let sheetName = 'Orders';
let freezeHeader = true;
let includeHidden = false;
export const actions = {
name: (_api: GridApi<Row>, v?: string) => void (sheetName = (v ?? '').trim() || 'Orders'),
freeze: (_api: GridApi<Row>, v?: string) => void (freezeHeader = v !== 'no'),
hidden: (_api: GridApi<Row>, v?: string) => void (includeHidden = v === 'yes'),
download: async (api: GridApi<Row>) => {
const ex = withExport(api);
const options = { sheetName, freezeHeader, includeHidden, applyFormatValue: false };
// Excel accepts sheet names up to 31 characters without / \ ? * [ ] :. Read the actual name the library fixed from the file.
const book = new TextDecoder('utf-8').decode(ex.exportXlsx(options));
const actual = /<sheet name="([^"]*)"/.exec(book)?.[1] ?? sheetName;
await ex.downloadXlsx('orders-sheet-options.xlsx', options);
const note =
actual === sheetName
? ''
: ` (the name you entered, "${sheetName}", was fixed to follow Excel rules)`;
say(
`Downloaded. Sheet name "${actual}"${note} · header ${freezeHeader ? 'frozen' : 'not frozen'} · hidden columns ${includeHidden ? 'included' : 'excluded'}`,
);
},
};
let say: (message: LogText) => void = () => {};
export function setup(api: GridApi<Row>, log: (message: LogText) => void) {
say = log;
withExport(api);
log('Downloads with sheet name "Orders" · header frozen · hidden columns excluded.');
} This example needs an extra package. To run it locally, install with npm i @maxgrid/angular @maxgrid/export.
When you click, the example code is sent to StackBlitz or CodeSandbox. Nothing is sent before you click.
import { Component, OnDestroy } from '@angular/core';
import { GridComponent, isGridEvent, type GridApi, type GridEventMessage } from '@maxgrid/angular';
import { actions, options, setup, type Row } from './example';
@Component({
selector: 'app-example-grid',
standalone: true,
imports: [GridComponent],
template: `
<div class="toolbar">
<input
type="text"
aria-label="Sheet name"
placeholder="Sheet name (blank = Orders)"
[disabled]="!api"
(input)="api && actions.name(api, $any($event.target).value)"
/>
<select
aria-label="Freeze header"
[disabled]="!api"
(change)="api && actions.freeze(api, $any($event.target).value)"
>
<option value="yes" selected>Frozen</option>
<option value="no">Not frozen</option>
</select>
<select
aria-label="Hidden columns"
[disabled]="!api"
(change)="api && actions.hidden(api, $any($event.target).value)"
>
<option value="no" selected>Exclude</option>
<option value="yes">Include</option>
</select>
<button
type="button"
[disabled]="!api"
(click)="api && actions.download(api)"
>Download</button>
</div>
<mx-grid style="height: 330px" [options]="options" [events]="relayed" (gridEvent)="onEvent($event)" />
`,
})
export class ExampleGridComponent implements OnDestroy {
readonly options = options;
readonly actions = actions;
readonly relayed = ['ready'] as const;
api: GridApi<Row> | null = null;
private stop: (() => void) | null = null;
onEvent(event: GridEventMessage<Row>): void {
if (isGridEvent(event, 'ready')) {
this.api = event.payload.api;
this.stop = setup(this.api, console.log);
}
}
ngOnDestroy(): void {
this.stop?.();
}
}import { withExport } from '@maxgrid/export';
import type { GridApi, GridOptions } from '@maxgrid/angular';
export type LogText = string;
export interface Row {
id: number;
orderNo: string;
customer: string;
region: string;
qty: number;
price: number;
orderedAt: Date;
}
const customers = [
'Harbor Foods',
'Pine Hardware',
'Blue Market',
'Maple Trading',
'Ocean Supply',
'Dawn Grocers',
];
const regions = ['Seoul', 'Busan', 'Daejeon', 'Gwangju'];
const rows: Row[] = Array.from({ length: 12 }, (_, i) => ({
id: i + 1,
orderNo: `SO-${3001 + i}`,
customer: customers[i % customers.length] as string,
region: regions[i % regions.length] as string,
qty: 3 + ((i * 7) % 28),
price: 4200 + ((i * 1900) % 21000),
orderedAt: new Date(2026, 9, 1 + i * 2),
}));
// Set the sheet name, frozen header, hidden columns and column widths. Column widths follow each column's width (or fit the content if none).
export const options: GridOptions<Row & { memo: string }> = {
columns: [
{ id: 'orderNo', title: 'Order no.', width: 100 },
{ id: 'customer', title: 'Customer', width: 110 },
{ id: 'region', title: 'Region', width: 80 },
{ id: 'qty', title: 'Qty', kind: 'number', width: 70, align: 'end' },
{
id: 'price',
title: 'Price ($)',
kind: 'number',
width: 100,
align: 'end',
formatValue: (v) => Number(v).toLocaleString('en-US'),
},
{ id: 'orderedAt', title: 'Ordered', kind: 'date', width: 110 },
{ id: 'memo', title: 'Memo', width: 220, hidden: true },
],
rows: rows.map((r) => ({
...r,
memo: r.qty > 20 ? 'Bulk order: delivery date needs to be arranged' : '',
})),
rowKey: 'id',
};
let sheetName = 'Orders';
let freezeHeader = true;
let includeHidden = false;
export const actions = {
name: (_api: GridApi<Row>, v?: string) => void (sheetName = (v ?? '').trim() || 'Orders'),
freeze: (_api: GridApi<Row>, v?: string) => void (freezeHeader = v !== 'no'),
hidden: (_api: GridApi<Row>, v?: string) => void (includeHidden = v === 'yes'),
download: async (api: GridApi<Row>) => {
const ex = withExport(api);
const options = { sheetName, freezeHeader, includeHidden, applyFormatValue: false };
// Excel accepts sheet names up to 31 characters without / \ ? * [ ] :. Read the actual name the library fixed from the file.
const book = new TextDecoder('utf-8').decode(ex.exportXlsx(options));
const actual = /<sheet name="([^"]*)"/.exec(book)?.[1] ?? sheetName;
await ex.downloadXlsx('orders-sheet-options.xlsx', options);
const note =
actual === sheetName
? ''
: ` (the name you entered, "${sheetName}", was fixed to follow Excel rules)`;
say(
`Downloaded. Sheet name "${actual}"${note} · header ${freezeHeader ? 'frozen' : 'not frozen'} · hidden columns ${includeHidden ? 'included' : 'excluded'}`,
);
},
};
let say: (message: LogText) => void = () => {};
export function setup(api: GridApi<Row>, log: (message: LogText) => void) {
say = log;
withExport(api);
log('Downloads with sheet name "Orders" · header frozen · hidden columns excluded.');
}