import { Component, Injector, ViewChild, ViewEncapsulation, Input, Output, EventEmitter, OnInit, AfterViewInit } from '@angular/core'; import { AppComponentBase } from '@shared/common/app-component-base'; import { TokenAuthServiceProxy } from '@shared/service-proxies/service-proxies'; import 'devexpress-reporting/dx-richedit'; import { AppSessionService } from '@shared/common/session/app-session.service'; import { AppConsts } from '@shared/AppConsts'; import { ActivatedRoute, Router } from '@angular/router'; import {Location} from '@angular/common'; import { appModuleAnimation } from '@shared/animations/routerTransition'; import { ReportServiceProxy } from '@shared/service-proxies/service-proxies'; import { NotifyService } from '@abp/notify/notify.service'; import DevExpress from '@devexpress/analytics-core'; import DevExpress2 from "devexpress-reporting/dx-reportdesigner"; import DXAnalytics from "@devexpress/analytics-core" import Report from "devexpress-reporting/dx-webdocumentviewer"; import { DxReportDesignerComponent} from 'devexpress-reporting-angular'; @Component({ selector: 'report-designer.component', encapsulation: ViewEncapsulation.None, templateUrl: './report-designer.component.html', animations: [appModuleAnimation()], styleUrls: [ "../../../../node_modules/jquery-ui/themes/base/all.css", "../../../../node_modules/devextreme/dist/css/dx.common.css", "../../../../node_modules/devextreme/dist/css/dx.light.css", "../../../../node_modules/@devexpress/analytics-core/dist/css/dx-analytics.common.css", "../../../../node_modules/@devexpress/analytics-core/dist/css/dx-analytics.light.css", "../../../../node_modules/@devexpress/analytics-core/dist/css/dx-querybuilder.css", "../../../../node_modules/devexpress-reporting/dist/css/dx-webdocumentviewer.css", "../../../../node_modules/devexpress-reporting/dist/css/dx-reportdesigner.css", "./report-designer.component.less" ] }) export class ReportDesignerComponent extends AppComponentBase { //@ViewChild(DxReportDesignerComponent, { static: false }) designer: DxReportDesignerComponent; getDesignerModelAction = "api/ReportDesignerClient/GetReportDesignerModel"; tenant = this._appSessionService.tenant; user = this._appSessionService.user; tenantId = this.tenant != undefined ? this.tenant.id : null; reportUrl: any; loadReport: boolean = false; name: any; hostUrl = AppConsts.remoteServiceBaseUrl + '/'; token = abp.auth.getToken(); //reportUrl: string = "XtraReport"; //invokeAction: string = 'CustomDocumentViewerController/Invoke'; //invokeAction: string = 'DXXRDV'; //hostUrl: string = "http://localhost:65302/"; constructor( injector: Injector, private _appSessionService: AppSessionService, private router: Router, private _location: Location, private route: ActivatedRoute, private _reportServiceProxy: ReportServiceProxy, private _notifyService: NotifyService ) { super(injector); } BeforeRender(event) { //... if(event) { this.spinnerService.hide(); } } ngOnInit() { this.spinnerService.show(); DevExpress.Analytics.Utils.ajaxSetup.ajaxSettings = { headers: { 'Authorization': 'Bearer ' + this.token } }; //Report.Reporting.Viewer.Settings.AsyncExportApproach = true; this.route.paramMap.subscribe(params => { this.name = params.get("name") }); if(this.name != null) { //this.reportUrl = this.name + "/" + this.tenantId + "/" +this.user.id; this.reportUrl = this.name } else { this.reportUrl = "StartReport"; } } goBack(){ this._location.back(); } // OnBeforeRender(event) { // DXAnalytics.Analytics.Localization.loadMessages({ // "CustomStringId.CustomFormatFunction": // "CustomFormatFunction(string format, object arg0)\\nConverts the value of arg0 to strings based on the formats specified" // }); // DevExpress2.Reporting.Designer.Widgets.reportFunctionDisplay.push({ // display: "Custom", // items: { // CustomFormatFunction: [{ // paramCount: 2, // text: "CustomFormatFunction(,)", // displayName: "CustomFormatFunction(,)", // descriptionStringId: "CustomStringId.CustomFormatFunction" // }] // } // }) // } }