public override void Setup(ApplicationModulesManager moduleManager) { base.Setup(moduleManager); ReportsModuleV2 reportModule = moduleManager.Modules.FindModule <ReportsModuleV2>(); reportModule.ReportDataType = typeof(MRS.Module.BusinessObjects.ReportDataV2); }
// private void InvoicePrint_Execute(object sender, PopupWindowShowActionExecuteEventArgs e) private void simpleAction1_Execute(object sender, SimpleActionExecuteEventArgs e) { XtraReport report = new rptSalesInvoice(); ReportsModuleV2 reportsModule = ReportsModuleV2.FindReportsModule(Application.Modules); if (e.SelectedObjects.Count > 0) // Multi invoice selected { string[] multiparm = new string[e.SelectedObjects.Count]; int i = 0; foreach (CustomerInvoiceHistory selectedinv in e.SelectedObjects) { multiparm[i] = selectedinv.InvoiceNumber; i++; } report.Parameters["InvoiceNumber"].Value = multiparm; report.Parameters["InvoiceNumber"].Visible = false; } else { report.Parameters["InvoiceNumber"].Visible = true; } if (reportsModule != null && reportsModule.ReportsDataSourceHelper != null) { reportsModule.ReportsDataSourceHelper.SetupBeforePrint(report); } report.Name = "Invoice Print"; // report.PrintDialog(); report.ShowPreview(); }
public override void Setup(ApplicationModulesManager moduleManager) { base.Setup(moduleManager); ReportsModuleV2 reportModule = moduleManager.Modules.FindModule <ReportsModuleV2>(); reportModule.ReportDataType = typeof(DevExpress.Persistent.BaseImpl.EF.ReportDataV2); }
protected void Page_Load(object sender, EventArgs e) { string reportDataHandle = Request.QueryString["reportContainerHandle"]; ReportsModuleV2 module = ReportsModuleV2.FindReportsModule(ApplicationReportObjectSpaceProvider.ContextApplication.Modules); if (!String.IsNullOrEmpty(reportDataHandle) && module != null) { XtraReport report = null; try { report = ReportDataProvider.ReportsStorage.GetReportContainerByHandle(reportDataHandle).Report; module.ReportsDataSourceHelper.SetupBeforePrint(report, null, null, false, null, false); using (MemoryStream ms = new MemoryStream()) { report.CreateDocument(); PdfExportOptions options = new PdfExportOptions(); options.ShowPrintDialogOnOpen = true; report.ExportToPdf(ms, options); ms.Seek(0, SeekOrigin.Begin); byte[] reportContent = ms.ToArray(); Response.ContentType = "application/pdf"; Response.AddHeader("Content-Disposition", "attachment; filename=MyFileName.pdf"); Response.Clear(); Response.OutputStream.Write(reportContent, 0, reportContent.Length); Response.End(); } } finally { if (report != null) { report.Dispose(); } } } }
protected override void PrintReport(IReportDataV2 reportData) { XtraReport report = ReportDataProvider.ReportsStorage.LoadReport(reportData); ReportsModuleV2 reportsModule = ReportsModuleV2.FindReportsModule(Application.Modules); if (reportsModule != null && reportsModule.ReportsDataSourceHelper != null) { reportsModule.ReportsDataSourceHelper.SetupBeforePrint(report); report.PrintDialog(); } }
protected override void PrintReport(IReportDataV2 reportData) { XtraReport report = ReportDataProvider.ReportsStorage.LoadReport(reportData); ReportsModuleV2 reportsModule = ReportsModuleV2.FindReportsModule(Application.Modules); if (reportsModule != null && reportsModule.ReportsDataSourceHelper != null) { reportsModule.ReportsDataSourceHelper.SetupBeforePrint(report, null, ((ListView)View).CollectionSource.Criteria["filter"], true, null, false); report.Print(); } }
private void PlainReportListView_Execute(object sender, SimpleActionExecuteEventArgs e) { IObjectSpace objectSpace = Application.CreateObjectSpace(); IReportDataV2 reportData = objectSpace.FindObject <ReportDataV2>(CriteriaOperator.Parse("DisplayName = 'PilotsReport'")); var reportContainerHandle = ReportDataProvider.ReportsStorage.GetReportContainerHandle(reportData); ReportsModuleV2 module = ReportsModuleV2.FindReportsModule(Application.Modules); if (module != null) { Frame.GetController <ReportServiceController>().ShowPreview(reportContainerHandle); } }
void LoadReport(DashboardReportViewItem dashboardReportViewItem) { var reportsModuleV2 = ReportsModuleV2.FindReportsModule(Application.Modules); var reportDataType = reportsModuleV2.ReportDataType; var reportData = (IReportDataV2)View.ObjectSpace.FindObject(reportDataType, CriteriaOperator.Parse("DisplayName=?", dashboardReportViewItem.Model.ReportName)); if (reportData == null) { throw new NullReferenceException($"Report {dashboardReportViewItem.Model.ReportName} not found"); } var report = ReportDataProvider.ReportsStorage.LoadReport(reportData); reportsModuleV2.ReportsDataSourceHelper.SetupBeforePrint(report, null, CriteriaOperator.Parse(report.FilterString), true, new SortProperty[0], true); dashboardReportViewItem.Report = report; dashboardReportViewItem.ReportData = reportData; }
protected virtual Type GetReportDataSourceObjectType(XtraReport report) { Type result = null; ReportsModuleV2 reportsModule = ReportsModuleV2.FindReportsModule(Application.Modules); if (reportsModule != null && reportsModule.ReportsDataSourceHelper != null) { object dataSource = reportsModule.ReportsDataSourceHelper.GetMasterReportDataSource(report); DataSourceBase dataTypeContainer = dataSource as DataSourceBase; if (dataTypeContainer != null) { result = dataTypeContainer.DataType; } } return(result); }
protected override object CreateControlCore() { _reportsModuleV2 = ReportsModuleV2.FindReportsModule(_application.Modules); var reportDataType = _reportsModuleV2.ReportDataType; _reportData = (IReportDataV2)View.ObjectSpace.FindObject(reportDataType, CriteriaOperator.Parse("DisplayName=?", Model.ReportName)); string handle = ReportDataProvider.ReportsStorage.GetReportContainerHandle(_reportData); if (_reportData == null) { throw new NullReferenceException(string.Format("Report {0} not found", Model.ReportName)); } report = ReportDataProvider.ReportsStorage.LoadReport(_reportData); report.DataSourceDemanded += report_DataSourceDemanded; ASPxWebDocumentViewer viewer = CreateASPxWebDocumentViewer(); viewer.OpenReport(report); return(viewer); }
private void simpleReport_Execute(object sender, SimpleActionExecuteEventArgs e) { IReportDataV2 reportData = View.ObjectSpace.FindObject <ReportDataV2>(new BinaryOperator("DisplayName", "Pilot Report")); DevExpress.XtraReports.UI.XtraReport report = ReportDataProvider.ReportsStorage.LoadReport(reportData); IObjectSpace objectSpace = Application.CreateObjectSpace(typeof(rb_Pilot)); List <rb_Pilot> list = new List <rb_Pilot>(); list.Add(objectSpace.FindObject <rb_Pilot>(new BinaryOperator("Id", $"{(View.SelectedObjects[0] as rb_Pilot)?.Id ?? 0}"))); report.DataSource = list; ReportsModuleV2.FindReportsModule(Application.Modules).ReportsDataSourceHelper.SetupBeforePrint(report); using (ReportPrintTool printTool = new ReportPrintTool(report)) { // Invoke the Print Preview form modally, // and load the report document into it. printTool.ShowPreviewDialog(); // Invoke the Print Preview form // with the specified look and feel setting. //printTool.ShowPreviewDialog(UserLookAndFeel.Default); } }
void showNavigationItemController_CustomShowNavigationItem(object sender, CustomShowNavigationItemEventArgs e) { IObjectSpace objectSpace = ReportDataProvider.ReportObjectSpaceProvider.CreateObjectSpace(typeof(ReportDataV2)); ReportDataV2 reportData = null; switch (e.ActionArguments.SelectedChoiceActionItem.Id) { case "Report1": reportData = objectSpace.FindObject <ReportDataV2>(new BinaryOperator("DisplayName", "Report 1")); break; case "Report2": reportData = objectSpace.FindObject <ReportDataV2>(new BinaryOperator("DisplayName", "Report 2")); break; } if (reportData != null) { string handle = ReportDataProvider.ReportsStorage.GetReportContainerHandle(reportData); ReportsModuleV2 module = ReportsModuleV2.FindReportsModule(Application.Modules); if (module != null) { switch (e.ActionArguments.SelectedChoiceActionItem.Id) { case "Report1": case "Report2": module.ReportsDataSourceHelper.BeforeShowPreview += ReportsDataSourceHelper_BeforeShowPreview_new; Frame.GetController <ReportServiceController>().ShowPreview(handle); module.ReportsDataSourceHelper.BeforeShowPreview -= ReportsDataSourceHelper_BeforeShowPreview_new; break; default: Frame.GetController <ReportServiceController>().ShowPreview(handle); break; } } e.Handled = true; } }
private void InitializeComponent() { _module1 = new SystemModule(); _module2 = new SystemAspNetModule(); _module3 = new Module.Module(); _module4 = new WebModule(); _securityModule1 = new SecurityModule(); _securityStrategyComplex1 = new SecurityStrategyComplex(); _authenticationStandard1 = new AuthenticationStandard(); _auditTrailModule = new AuditTrailModule(); _objectsModule = new BusinessClassLibraryCustomizationModule(); _chartModule = new ChartModule(); _chartAspNetModule = new ChartAspNetModule(); _cloneObjectModule = new CloneObjectModule(); _conditionalAppearanceModule = new ConditionalAppearanceModule(); _fileAttachmentsAspNetModule = new FileAttachmentsAspNetModule(); _htmlPropertyEditorAspNetModule = new HtmlPropertyEditorAspNetModule(); _pivotChartModuleBase = new PivotChartModuleBase(); _pivotChartAspNetModule = new PivotChartAspNetModule(); _pivotGridModule = new PivotGridModule(); _pivotGridAspNetModule = new PivotGridAspNetModule(); _reportsModuleV2 = new ReportsModuleV2(); _reportsAspNetModuleV2 = new ReportsAspNetModuleV2(); _validationModule = new ValidationModule(); _validationAspNetModule = new ValidationAspNetModule(); _viewVariantsModule = new ViewVariantsModule(); ((ISupportInitialize)(this)).BeginInit(); // // securityStrategyComplex1 // _securityStrategyComplex1.Authentication = _authenticationStandard1; _securityStrategyComplex1.RoleType = typeof(SecuritySystemRole); _securityStrategyComplex1.UserType = typeof(SecuritySystemUser); // // securityModule1 // _securityModule1.UserType = typeof(SecuritySystemUser); // // authenticationStandard1 // _authenticationStandard1.LogonParametersType = typeof(AuthenticationStandardLogonParameters); // // auditTrailModule // _auditTrailModule.AuditDataItemPersistentType = typeof(AuditDataItemPersistent); // // pivotChartModuleBase // _pivotChartModuleBase.ShowAdditionalNavigation = true; // // reportsModuleV2 // _reportsModuleV2.EnableInplaceReports = true; _reportsModuleV2.ReportDataType = typeof(ReportDataV2); _reportsModuleV2.ShowAdditionalNavigation = true; // // reportsAspNetModuleV2 // _reportsAspNetModuleV2.ShowFormatSpecificExportActions = true; _reportsAspNetModuleV2.DefaultPreviewFormat = ReportOutputType.Pdf; _reportsAspNetModuleV2.ReportViewerType = ReportViewerTypes.HTML5; _reportsModuleV2.ReportStoreMode = ReportStoreModes.XML; // // viewVariantsModule // _viewVariantsModule.ShowAdditionalNavigation = true; // // FMAspNetApplication // ApplicationName = "CORE.PolizApp"; LinkNewObjectToParentImmediately = false; CheckCompatibilityType = CheckCompatibilityType.DatabaseSchema; Modules.Add(_module1); Modules.Add(_module2); Modules.Add(_module3); Modules.Add(_module4); Modules.Add(_securityModule1); Security = _securityStrategyComplex1; Modules.Add(_auditTrailModule); Modules.Add(_objectsModule); Modules.Add(_chartModule); Modules.Add(_chartAspNetModule); Modules.Add(_cloneObjectModule); Modules.Add(_conditionalAppearanceModule); Modules.Add(_fileAttachmentsAspNetModule); Modules.Add(_htmlPropertyEditorAspNetModule); Modules.Add(_pivotChartModuleBase); Modules.Add(_pivotChartAspNetModule); Modules.Add(_pivotGridModule); Modules.Add(_pivotGridAspNetModule); Modules.Add(_reportsModuleV2); Modules.Add(_reportsAspNetModuleV2); Modules.Add(_validationModule); Modules.Add(_validationAspNetModule); Modules.Add(_viewVariantsModule); DatabaseVersionMismatch += FMAspNetApplication_DatabaseVersionMismatch; ((ISupportInitialize)(this)).EndInit(); }
private void UnsubscribeToEvents() { ReportsModuleV2 reportsModule = ReportsModuleV2.FindReportsModule(Application.Modules); reportsModule.ReportsDataSourceHelper.CustomSetupReportDataSource -= ReportsDataSourceHelper_CustomSetupReportDataSource; }
private void ImprFto(string format, bool imprime, bool pdf, string nameF) { if (View != null && View.ObjectSpace != null) { XPObjectSpace objectSpace = (XPObjectSpace)View.ObjectSpace; NominaItem fac = View.CurrentObject as NominaItem; if (fac != null) { Session uow = fac.Session; //ReportData reportData = uow.FindObject<ReportData>(new BinaryOperator("Name", format)); // XPCollection dosyas = new XPCollection(fac.Session, typeof(NominaItem), false); //XafReport report = null; NominaItem doc = fac; IReportDataV2 reportData2 = objectSpace.FindObject <ReportDataV2>( new BinaryOperator("DisplayName", format)); if (doc != null) { doc.Empresa = uow.FindObject <Empresa>(/*CriteriaOperator.Parse("Clave = 'icpac'")*/ null); if (doc.Status == NominaItemStatus.Alta) { if (doc.Empleado != null) { doc.Empleado.Reload(); } } QRCode2(doc); /* * if (reportData != null) * { * report = reportData.LoadReport(objectSpace) as XafReport; * report.ObjectSpace = objectSpace; * dosyas.Add(doc); * report.DataSource = dosyas; * * if (pdf) * { * report.ExportToPdf(nameF); * } * if (imprime) * { * try * { * ReportPrintTool printTool = new ReportPrintTool(report); * * // Solo funciona para windows !! * printTool.ShowPreviewDialog(); * } * catch (Exception) * { * } * } * }*/ if (reportData2 != null) { string reportContainerHandler = ReportDataProvider.ReportsStorage.GetReportContainerHandle(reportData2); XtraReport report2 = ReportDataProvider.ReportsStorage.LoadReport(reportData2); List <NominaItem> list = new List <NominaItem>(); list.Add(doc); report2.DataSource = list; if (pdf) { string namF = NegocioNom.NamePdf(doc); DEFile fd = new DEFile(doc.Session); MemoryStream ms = new MemoryStream(); report2.ExportToPdf(ms); ms.Seek(0, SeekOrigin.Begin); fd.File = new FileData(doc.Session); fd.File.LoadFromStream(Path.GetFileName(namF), ms); fd.TpArchv = ETipoArchivo.Pdf; doc.DElctrnc.Archivos.Add(fd); } if (imprime) { try { ReportsModuleV2.FindReportsModule(Application.Modules).ReportsDataSourceHelper.SetupBeforePrint(report2); report2.ShowPreview(); } catch (Exception) { } } } // dosyas.Dispose(); } } } }
private void PrintReport(ReportParametersObjectBase GetReportParametersObject) { var fileName = String.Empty; ProcessedfileNameAddress = String.Empty; try { using (SaveFileDialog sfd = new SaveFileDialog()) { var agora = DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss"); fileName = $"{currentReport.DisplayName} {agora}"; sfd.FileName = fileName; sfd.Filter = "Formato Excel (*.xlsx)|*.xlsx"; if (sfd.ShowDialog() == DialogResult.OK) { CriteriaOperator filter = string.Empty; if (GetReportParametersObject != null) { filter = XpoObjectInCriteriaProcessingHelper.ParseCriteria(((XPObjectSpace)ObjectSpace).Session, GetReportParametersObject?.GetCriteria()?.LegacyToString()); } else { filter = string.Empty; } var sorting = GetReportParametersObject?.GetSorting(); XtraReport report = ReportDataProvider.ReportsStorage.LoadReport(currentReport); ReportsModuleV2 reportsModule = ReportsModuleV2.FindReportsModule(Application.Modules); if (reportsModule != null && reportsModule.ReportsDataSourceHelper != null) { if (GetReportParametersObject == null) { reportsModule.ReportsDataSourceHelper.SetupBeforePrint(report, null, null, true, null, true); } else { reportsModule.ReportsDataSourceHelper.SetupBeforePrint(report, null, filter, true, sorting, true); } XtraForm form = new XtraForm() { FormBorderStyle = FormBorderStyle.None, Size = new System.Drawing.Size(400, 20), ShowInTaskbar = false, StartPosition = FormStartPosition.CenterScreen, TopMost = true }; ProgressBarControl progressBar = new ProgressBarControl(); ReflectorBar reflectorBar = new ReflectorBar(progressBar); form.Controls.Add(progressBar); progressBar.Dock = DockStyle.Fill; XlsxExportOptions options = new XlsxExportOptions { ExportMode = XlsxExportMode.SingleFile, ShowGridLines = true, RawDataMode = false }; form.Show(); report.PrintingSystem.ProgressReflector = reflectorBar; report.ExportToXlsx(sfd.FileName, options); report.PrintingSystem.ResetProgressReflector(); form.Close(); form.Dispose(); ProcessedfileNameAddress = sfd.FileName; } } } } catch (Exception) { } if (!String.IsNullOrEmpty(ProcessedfileNameAddress)) { FileInfo fi = new FileInfo(ProcessedfileNameAddress); if (fi.Exists) { Form mainForm = (Form)Application.MainWindow.Template; AlertInfo info = new AlertInfo("Processo Finalizado!", $"{fileName} (Clique aqui para abrir"); alertControlCore.Show(mainForm, info); } } }