devexpress-reporting
Version:
DevExpress Reporting provides the capability to develop a reporting application to create and customize reports.
34 lines (33 loc) • 1.52 kB
JavaScript
/**
* DevExpress HTML/JS Reporting (designer\internal\ai\_aiDesignerPanelModel.js)
* Version: 25.2.3
* Build date: Dec 15, 2025
* Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
* License: https://www.devexpress.com/Support/EULAs/universal.xml
*/
import { Disposable } from '@devexpress/analytics-core/analytics-utils';
import { ReportAIService } from '../../services/_aiService';
import { getLocalization } from '@devexpress/analytics-core/analytics-internal-native';
import { AIServicesEnabled } from '../../settings';
export class AIDesignerPanelModel extends Disposable {
constructor(buildingModel, settings) {
super();
this.buildingModel = buildingModel;
this.settings = settings;
this.visible = settings?.testDataSourceSettings?.enableTestDataSourceGeneration && AIServicesEnabled();
}
showPreviewWithFakeData() {
const reportPreview = this.buildingModel.reportPreviewModel.reportPreview;
const report = this.buildingModel.model();
reportPreview._show(ReportAIService.initializePreviewWithFakeData(report));
}
get fakePreviewButtonVisible() {
return this.settings.testDataSourceSettings?.enableTestDataSourceGeneration;
}
get fakePreviewButtonText() {
return getLocalization('Smart Preview');
}
get fakePreviewButtonTitle() {
return getLocalization('Show Report Preview with AI-generated Test Data', 'ASPxReportsStringId.ReportDesigner_AI_ReportPreviewWithTestData');
}
}