FreeReportv0.9.0한국어

Output log hook

Record every print and download with onOutput (who, what, when, how many pages), ask for a reason or block output for personal-data compliance.

onOutput is called before every print and export with the kind, report name, pages, rows and parameters. Write it to your output log (required for personal-data systems in Korea), ask for a reason, or return false to block it. Output control demo

createViewer(el, {
  definition, data, params: { user: '홍길동' },
  // e = { kind: 'print' | 'pdf' | 'xlsx' | 'xlsx-data' | 'csv', report, pages, rows, params, fileName }
  onOutput: async e => {
    const res = await fetch('/api/output-log', { method: 'POST', body: JSON.stringify(e) });
    return res.ok;   // false cancels the print or download
  },
});