Globals
RealReport 라이브러리 네임스페이스에서 전역적으로 사용할 수 있는 속성과 함수 모음입니다.
함수
| Name | Description |
|---|---|
| getVersion | 버전 정보 반환 |
| setLicenseKey | 라이센스 코드 설정 |
getVersion
현재 사용중인 라이브러리 버전 정보를 반환합니다.
정의
RealReport.getVersion(): string;사용 예시
const version = RealReport.getVersion();
// 리얼리포트 버전 정보 v1.x.x
console.log(version);setLicenseKey
라이센스 코드를 설정합니다.
정의
RealReport.setLicenseKey(licenseKey: string): void;사용 예시
RealReport.setLicenseKey('라이센스 키 값');객체
| Name | Description |
|---|---|
| FontStore | 폰트 전역 관리 |
FontStore
리포트에서 사용할 폰트를 전역적으로 관리합니다.
FontStore에 폰트를 등록한 이후에는 defaulFont 속성을 통해 기본 폰트를 지정할 수 있습니다. 지정된 기본 폰트는 미리보기, 내보내기, 출력등에 적용됩니다.
속성
| 이름 | 타입 | Read & Write |
|---|---|---|
| defaultFont | string | Read & Write |
defaultFont
- type:
string - Write
- 리포트 미리보기, 내보내기, 출력시 기본으로 사용할 폰트명
함수
| 이름 | 설명 |
|---|---|
| registerFonts | 리포트에서 사용할 폰트 리소스 등록 |
registerFonts
리포트에서 사용할 폰트 리소스를 등록합니다.
- fonts: UserFontSource[]
정의
RealReport.FontStore.registerFonts(fonts: UserFontSource[]): Promise<void>;사용 예시
await RealReport.FontStore.registerFonts([
{
name: 'NanumGothic',
source: '/fonts/NanumGothic-Light.otf',
weight: 'normal',
},
{
name: 'NanumGothic',
source: '/fonts/NanumGothic-Bold.otf',
weight: 'bold',
},
]);
// 미리보기, 출력, PDF 내보내기에서 사용할 기본 폰트 지정
RealReport.FontStore.defaultFont = 'NanumGothic';
const viewer = new RealReport.ReportViewer('report-container-id', reportForm, dataSet);
// 리포트 미리보기 (NanumGothic 폰트가 적용됨)
viewer.preview({ async: true });
// 리포트 출력 (NanumGothic 폰트가 적용됨)
viewer.print();
// PDF 내보내기 (NanumGothic 폰트로 적용됨)
viewer.exportPdf({ fileName: '리얼리포트 내보내기 샘플' });