private ReportDataV2 CreateReport(string reportName, string layout, string displayName = null, Type parameters = null) { if (displayName == null) { displayName = reportName; } ReportDataV2 reportData = ObjectSpace.FindObject <ReportDataV2>(new BinaryOperator("DisplayName", displayName)); if (reportData == null) { reportData = ObjectSpace.CreateObject <ReportDataV2>(); XtraReport rep = new XtraReport(); byte[] byteArray = Encoding.UTF8.GetBytes(ConvertVersion(layout)); MemoryStream stream = new MemoryStream(byteArray); rep.LoadLayout(stream); rep.DisplayName = displayName; if (parameters != null) { reportData.ParametersObjectType = parameters; } ReportDataProvider.ReportsStorage.SaveReport(reportData, rep); reportData.IsInplaceReport = true; } ObjectSpace.CommitChanges(); return(reportData); }
private void ConsultarReportes() { List <TipoDocumento> listaTipoDoc = session.Query <TipoDocumento>().ToList(); foreach (TipoDocumento tipoDoc in listaTipoDoc) { if (tipoDoc.NombreReporte.Length > 0) { //Ir a traer el reporte y convertirlo en XtraReport para guardarlo ReportDataV2 reportData = ObjectsPaceConnection.Session.FindObject <ReportDataV2>( new BinaryOperator("DisplayName", tipoDoc.NombreReporte)); if (reportData == null) { XtraMessageBox.Show("No se encontro el reporte: " + tipoDoc.NombreReporte + " \n\r Del Tipo de Documento: " + tipoDoc.NombreReporte); return; } if (reportData == null) { XtraMessageBox.Show("No se encontro el reporte: " + tipoDoc.NombreReporte + " \n\r Del Tipo de Documento: " + tipoDoc.NombreReporte); return; } listaReportesDoc.Add(new TipoDocReporte() { TipoDoc = tipoDoc, Reporte = reportData }); } } }
public override void UpdateDatabaseAfterUpdateSchema() { base.UpdateDatabaseAfterUpdateSchema(); var oldReports = ObjectSpace.GetObjects<ReportData>(); XPObjectSpace os = (XPObjectSpace)ObjectSpace; List<ReportData> reportsToDelete = new List<ReportData>(); foreach (var oldReport in oldReports) { string dataTypeName = oldReport.DataTypeName; var typeInfo = os.TypesInfo.FindTypeInfo(dataTypeName); if (typeInfo != null) { var report = new ReportDataV2(os.Session, typeInfo.Type) { DisplayName = oldReport.ReportName, Content = AddCollectionDataSource(oldReport.Content, dataTypeName) }; } reportsToDelete.Add(oldReport); } foreach (var r in reportsToDelete) ObjectSpace.Delete(r); ObjectSpace.CommitChanges(); }
private void BuscarReporteEmpleado() { ReporteCxcEmpleado reporteEmpleado = session.Query <ReporteCxcEmpleado>().Where(x => x.Imprimir == true).FirstOrDefault(); if (reporteEmpleado != null) { List <CobroPendiente> cobrosReporte = session.Query <CobroPendiente>().Where(x => x.ReporteEmpleado != null).ToList(); List <CobroPendiente> cobrosQuitar = reporteEmpleado.CobroPendientes.ToList(); foreach (CobroPendiente item in cobrosReporte) { reporteEmpleado.CobroPendientes.Add(item); } reporteEmpleado.Imprimir = false; reporteEmpleado.Save(); List <ReporteCxcEmpleado> listaReporte = new List <ReporteCxcEmpleado>(); ReportDataV2 reportData = ObjectsPaceConnection.Session.Query <ReportDataV2>().Where(x => x.DisplayName == "CobrosEmpleados").FirstOrDefault(); var varRepor = ReportDataProvider.ReportsStorage.LoadReport(reportData); XtraReport report = varRepor; listaReporte.Add(reporteEmpleado); report.DataSource = listaReporte; using (ReportPrintTool pt = new ReportPrintTool(report)) { pt.ShowPreviewDialog(); // pt.ShowPreviewDialog(UserLookAndFeel.Default); } foreach (CobroPendiente item in cobrosQuitar) { reporteEmpleado.CobroPendientes.Remove(item); } reporteEmpleado.Save(); } }
static void Main(string[] args) { using (XPObjectSpaceProvider objectSpaceProvider = CreateObjectSpaceProvider()) { IObjectSpace objectSpace = objectSpaceProvider.CreateObjectSpace(); ReportDataV2 reportData = objectSpace.FindObject <ReportDataV2>(new BinaryOperator("DisplayName", "Employees Report")); ExportReport(reportData, objectSpaceProvider); } }
private static byte[] ExportReport(ReportDataV2 reportData, IObjectSpaceProvider objectSpaceProvider, string CriteriaString, IObjectSpace objectSpace) { MyReportDataSourceHelper reportDataSourceHelper = new MyReportDataSourceHelper(objectSpaceProvider); ReportDataProvider.ReportObjectSpaceProvider = new MyReportObjectSpaceProvider(objectSpaceProvider); CriteriaOperator ReportCriteria = CriteriaOperator.Parse(CriteriaString); //XtraReport report = ReportDataProvider.ReportsStorage.LoadReport(reportData); XtraReport report = new XtraReport(); byte[] content = reportData.Content; if (content != null && content.Length != 0) { int num = content.Length; while (content[num - 1] == 0) { num--; } MemoryStream memoryStream = new MemoryStream(content, 0, num); report.LoadLayoutFromXml(memoryStream); // report.LoadLayout(memoryStream); memoryStream.Close(); } DataSourceBase dataSourceBase = report.DataSource as DataSourceBase; if (dataSourceBase != null && reportData is IReportDataV2Writable) { ((IReportDataV2Writable)reportData).SetDataType(dataSourceBase.DataType); } report.DisplayName = reportData.DisplayName; //XtraReport report = reportData.LoadReport(objectSpace); report.Extensions["DataSerializationExtension"] = "XtraReport"; report.Extensions["DataEditorExtension"] = "XtraReport"; report.Extensions["ParameterEditorExtension"] = "XtraReport"; reportDataSourceHelper.SetupBeforePrint(report, null, ReportCriteria, true, null, false); MemoryStream ReportStream = new MemoryStream(); report.ExportToPdf(ReportStream); return(ReportStream.ToArray()); }
private void ShowReportPilot_Action_Execute(object sender, SimpleActionExecuteEventArgs e) { IObjectSpace objectSpace = ReportDataProvider.ReportObjectSpaceProvider.CreateObjectSpace(typeof(ReportDataV2)); ReportDataV2 reportData = objectSpace.FindObject <ReportDataV2>(CriteriaOperator.Parse("[DisplayName] = 'Pilot Report'")); string handle = ReportDataProvider.ReportsStorage.GetReportContainerHandle(reportData); ReportServiceController controller = Frame.GetController <ReportServiceController>(); if (controller != null) { controller.ShowPreview(handle); } }
public byte[] PrintReports(string ReportName, string CompanyId) { using (XPObjectSpaceProvider objectSpaceProvider = CreateObjectSpaceProvider(CompanyId)) { IObjectSpace objectSpace = objectSpaceProvider.CreateObjectSpace(); //ReportData reportData = objectSpace.FindObject<ReportData>(new BinaryOperator("Name", "Invoice")); //ReportData reportData = objectSpace.FindObject<ReportData>(new BinaryOperator("DisplayName", ReportName)); ReportDataV2 reportData = objectSpace.FindObject <ReportDataV2>(new BinaryOperator("DisplayName", ReportName)); //ReportDataV2 reportData = objectSpace.GetObjectByKey<ReportDataV2>(Guid.Parse("9D1BD93A-5E61-4193-A8FF-190916AFF298")); return(ExportReport(reportData, objectSpaceProvider, string.Empty, objectSpace)); } }
public void CreateReportMultiValueParameters() { ReportDataV2 reportData = ObjectSpace.FindObject <ReportDataV2>(new BinaryOperator("DisplayName", "ReportWithMultiValueParameters")); if (reportData == null) { reportData = ObjectSpace.CreateObject <ReportDataV2>(); XtraReport rep = new XtraReport(); #if !DXCORE3 byte[] byteArray = Encoding.UTF8.GetBytes(ConvertVersion(OrdinalReportResource.ReportLayout)); MemoryStream stream = new MemoryStream(byteArray); rep.LoadLayout(stream); #else var assembly = Assembly.GetExecutingAssembly(); var resourceNames = assembly.GetManifestResourceNames(); var resourceName = resourceNames.FirstOrDefault(p => p.Contains("OrdinalReport.repx")); using (Stream stream = assembly.GetManifestResourceStream(resourceName)) { rep.LoadLayout(stream); } #endif rep.DisplayName = "ReportWithMultiValueParameters"; rep.FilterString = "[Title Of Courtesy] In (?parameterTitle) Or [Position] In (?parameterPosition)"; DevExpress.XtraReports.Parameters.Parameter parameterTitle = new DevExpress.XtraReports.Parameters.Parameter(); DevExpress.XtraReports.Parameters.Parameter parameterPosition = new DevExpress.XtraReports.Parameters.Parameter(); parameterTitle.Description = "Title"; parameterTitle.Type = typeof(TitleOfCourtesy); parameterTitle.Name = "parameterTitle"; parameterTitle.MultiValue = true; parameterPosition.Description = "Position"; parameterPosition.Name = "parameterPosition"; parameterPosition.Type = typeof(Position); parameterPosition.MultiValue = true; rep.Parameters.AddRange(new DevExpress.XtraReports.Parameters.Parameter[] { parameterTitle, parameterPosition }); XRControl control = rep.FindControl("label9", true); if (control != null) { control.Text = "Contacts with parameters"; } ReportDataProvider.ReportsStorage.SaveReport(reportData, rep); } }
private void ObtenerCorteCaja() { int oidCorte = session.Query <CorteDeCaja>().Where(x => x.Sucursal == sucursal && x.Finalizado == false).Max(fcd => fcd.Oid); CorteDeCaja corte = session.Query <CorteDeCaja>().Where(x => x.Oid == oidCorte).FirstOrDefault(); if (corte != null) { if (corte.Solicitado) { List <CorteDeCaja> listaCorte = new List <CorteDeCaja>(); ReportDataV2 reportData = ObjectsPaceConnection.Session.Query <ReportDataV2>().Where(x => x.DisplayName == "CorteDeCaja").FirstOrDefault(); XtraReport report = ReportDataProvider.ReportsStorage.LoadReport(reportData); listaCorte.Add(corte); report.DataSource = listaCorte; using (ReportPrintTool pt = new ReportPrintTool(report)) { corte.Solicitado = false; session.Save(corte); pt.ShowPreviewDialog(); // pt.ShowPreviewDialog(UserLookAndFeel.Default); } } if (corte.ReporteCobros) { List <CobroPendiente> listaCobrado = session.Query <CobroPendiente>(). Where(cobro => cobro.Venta.Turno == corte.Turno).ToList(); ReportDataV2 reportData = ObjectsPaceConnection.Session.FindObject <ReportDataV2>( new BinaryOperator("DisplayName", "Comandas Cobradas por Turno")); XtraReport report = ReportDataProvider.ReportsStorage.LoadReport(reportData); report.DataSource = listaCobrado; using (ReportPrintTool pt = new ReportPrintTool(report)) { corte.ReporteCobros = false; session.Save(corte); pt.ShowPreviewDialog(); // pt.ShowPreviewDialog(UserLookAndFeel.Default); } } } BuscarReporteEmpleado(); }
private void ConsultarVentasPendientes() { List <Venta> ventas = session.Query <Venta>().Where(v => null == v.Impreso || v.Impreso == false).Where(v => v.Turno.Usuario.Sucursal == sucursal) .ToList(); List <Venta> listaVacia = new List <Venta>(); foreach (Venta venta in ventas) { venta.Impreso = true; session.Save(venta); venta.FechaImpresion = DateTime.Now; List <Venta> dsVentas = new List <Venta>(); dsVentas.Add(venta); //obtiene formato de reporte guardado y crea un xtrareport ReportDataV2 reportData = listaReportesDoc.Where(r => r.TipoDoc == venta.TipoDocumento).FirstOrDefault().Reporte; var varRepor = ReportDataProvider.ReportsStorage.LoadReport(reportData); XtraReport report = varRepor; report.DataSource = dsVentas; //PrintToolBase tool = new PrintToolBase(report.PrintingSystem); //tool.Print(venta.TipoDocumento.NombreImpresora); report.CreateDocument(); using (ReportPrintTool pt = new ReportPrintTool(report)) { string NombreImpresor = ""; string nombre = venta.TipoDocumento.NombreImpresora; NombreImpresor = nombre == null ? "" : nombre; pt.ShowPreviewDialog(); //if (NombreImpresor != "") // pt.Print(NombreImpresor); //else // pt.PrintDialog(); } } }
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; } }
public void CreateReportWithBookmark() { ReportDataV2 reportData = ObjectSpace.FindObject <ReportDataV2>(new BinaryOperator("DisplayName", "ReportWithBookmark")); if (reportData == null) { reportData = ObjectSpace.CreateObject <ReportDataV2>(); XtraReport rep = new XtraReport(); #if !DXCORE3 byte[] byteArray = Encoding.UTF8.GetBytes(ConvertVersion(OrdinalReportResource.ReportLayout)); MemoryStream stream = new MemoryStream(byteArray); rep.LoadLayout(stream); #else var assembly = Assembly.GetExecutingAssembly(); var resourceNames = assembly.GetManifestResourceNames(); var resourceName = resourceNames.FirstOrDefault(p => p.Contains("OrdinalReport.repx")); using (Stream stream = assembly.GetManifestResourceStream(resourceName)) { rep.LoadLayout(stream); } #endif rep.DisplayName = "ReportWithBookmark"; rep.Bookmark = "Names"; XRControl control = rep.FindControl("label5", true); if (control != null) { control.DataBindings.Add(new DevExpress.XtraReports.UI.XRBinding("Bookmark", null, "FirstName")); } control = rep.FindControl("label9", true); if (control != null) { control.Text = "Report with bookmarks"; } ReportDataProvider.ReportsStorage.SaveReport(reportData, rep); } }
private ReportDataV2 CreateReport(string reportName, string layoutName, string displayName = null, Type parameters = null, string subReportUrl = null) { if (displayName == null) { displayName = reportName; } ReportDataV2 reportData = ObjectSpace.FindObject <ReportDataV2>(new BinaryOperator("DisplayName", displayName)); if (reportData == null) { reportData = ObjectSpace.CreateObject <ReportDataV2>(); XtraReport rep = new XtraReport(); var assembly = Assembly.GetExecutingAssembly(); var resourceNames = assembly.GetManifestResourceNames(); var resourceName = resourceNames.FirstOrDefault(p => p.Contains(layoutName)); using (Stream stream = assembly.GetManifestResourceStream(resourceName)) { rep.LoadLayout(stream); } var subreport = rep.AllControls <XRSubreport>().FirstOrDefault(); if (subreport != null && subReportUrl != null) { subreport.ReportSourceUrl = subReportUrl; } rep.DisplayName = displayName; if (parameters != null) { reportData.ParametersObjectType = parameters; } ReportDataProvider.ReportsStorage.SaveReport(reportData, rep); reportData.IsInplaceReport = true; } ObjectSpace.CommitChanges(); return(reportData); }
public override void UpdateDatabaseAfterUpdateSchema() { base.UpdateDatabaseAfterUpdateSchema(); Position developerPosition = ObjectSpace.FindObject <Position>(CriteriaOperator.Parse("Title == 'Developer'")); if (developerPosition == null) { developerPosition = ObjectSpace.CreateObject <Position>(); developerPosition.Title = "Developer"; } Position managerPosition = ObjectSpace.FindObject <Position>(CriteriaOperator.Parse("Title == 'Manager'")); if (managerPosition == null) { managerPosition = ObjectSpace.CreateObject <Position>(); managerPosition.Title = "Manager"; } Contact contactJohn = ObjectSpace.FindObject <Contact>(CriteriaOperator.Parse("FirstName == 'John' && LastName == 'Nilsen'")); if (contactJohn == null) { contactJohn = ObjectSpace.CreateObject <Contact>(); contactJohn.FirstName = "John"; contactJohn.LastName = "Nilsen"; contactJohn.Email = "*****@*****.**"; contactJohn.Birthday = new DateTime(1981, 10, 3); contactJohn.Position = developerPosition; } PhoneNumber johnPhoneNumber_1 = ObjectSpace.FindObject <PhoneNumber>(CriteriaOperator.Parse("Number == '888-111-222'")); if (johnPhoneNumber_1 == null) { johnPhoneNumber_1 = ObjectSpace.CreateObject <PhoneNumber>(); johnPhoneNumber_1.Number = "888-111-222"; contactJohn.PhoneNumbers.Add(johnPhoneNumber_1); } PhoneNumber johnPhoneNumber_2 = ObjectSpace.FindObject <PhoneNumber>(CriteriaOperator.Parse("Number == '888-333-222'")); if (johnPhoneNumber_2 == null) { johnPhoneNumber_2 = ObjectSpace.CreateObject <PhoneNumber>(); johnPhoneNumber_2.Number = "888-333-222"; contactJohn.PhoneNumbers.Add(johnPhoneNumber_2); } ObjectSpace.CommitChanges(); Contact contactMary = ObjectSpace.FindObject <Contact>(CriteriaOperator.Parse("FirstName == 'Mary' && LastName == 'Tellitson'")); if (contactMary == null) { contactMary = ObjectSpace.CreateObject <Contact>(); contactMary.FirstName = "Mary"; contactMary.LastName = "Tellitson"; contactMary.Email = "*****@*****.**"; contactMary.Birthday = new DateTime(1980, 11, 27); contactMary.Position = managerPosition; } PhoneNumber maryPhoneNumber_1 = ObjectSpace.FindObject <PhoneNumber>(CriteriaOperator.Parse("Number == '999-999-999'")); if (maryPhoneNumber_1 == null) { maryPhoneNumber_1 = ObjectSpace.CreateObject <PhoneNumber>(); maryPhoneNumber_1.Number = "999-999-999"; contactMary.PhoneNumbers.Add(maryPhoneNumber_1); } PhoneNumber maryPhoneNumber_2 = ObjectSpace.FindObject <PhoneNumber>(CriteriaOperator.Parse("Number == '999-999-777'")); if (maryPhoneNumber_2 == null) { maryPhoneNumber_2 = ObjectSpace.CreateObject <PhoneNumber>(); maryPhoneNumber_2.Number = "999-999-777"; contactMary.PhoneNumbers.Add(maryPhoneNumber_2); } ObjectSpace.CommitChanges(); Company myOrg = ObjectSpace.FindObject <Company>(CriteriaOperator.Parse("Name == 'Demo Company'")); if (myOrg == null) { myOrg = ObjectSpace.CreateObject <Company>(); myOrg.Name = "Demo Company"; myOrg.City = "DefaultCity"; } #if !DXCORE3 CreateReport("OrdinalReport", OrdinalReportResource.ReportLayout, "ReportWithParametersObject", typeof(DemoParameters)); ReportDataV2 reportData = CreateReport("SubreportCompany", SubreportCompanyLayout.ReportLayout); string reportWithSubReportLayout = ReportWithSubReportLayout.ReportLayout.Replace("SubReportKEY", ObjectSpace.GetObjectHandle(reportData)); ReportDataV2 simpleSubReportData = CreateReport("SimpleSubReport", SimpleSubReportLayout.ReportLayout); string reportWithSubReportDifferentEnumsLayout = ReportWithSubReportDifferentEnumsLayout.ReportLayout.Replace("SubReportKEY", ObjectSpace.GetObjectHandle(simpleSubReportData)); CreateReport("ReportWithSecurity", ReportWithSecurity.ReportLayout); CreateReport("ReportWithSubReportDifferentEnums", reportWithSubReportDifferentEnumsLayout); CreateReport("ReportWithSubReport", reportWithSubReportLayout); CreateReport("ReportWithViewDataSource", ReportWithViewDataSourceLayout.ReportLayout); CreateReport("OrdinalReport", OrdinalReportResource.ReportLayout); #else CreateReport("OrdinalReport", "OrdinalReport.repx"); CreateReport("ReportWithSecurity", "ReportWithSecurity.repx"); CreateReport("OrdinalReport", "OrdinalReport.repx", "ReportWithParametersObject", typeof(DemoParameters)); ReportDataV2 simpleSubReportData = CreateReport("SimpleSubReport", "SimpleSubReport.repx"); CreateReport("ReportWithSubReportDifferentEnums", "ReportWithSubReportDifferentEnums.repx", subReportUrl: ObjectSpace.GetObjectHandle(simpleSubReportData)); ReportDataV2 reportData = CreateReport("SubreportCompany", "SubreportCompany.repx"); CreateReport("ReportWithSubReport", "ReportWithSubReport.repx", subReportUrl: ObjectSpace.GetObjectHandle(reportData)); CreateReport("ReportWithViewDataSource", "ReportWithViewDataSource.repx"); #endif CreateReportParameters(); CreateReportMultiValueParameters(); CreateReportWithBookmark(); CreateUser(); SimpleObjectWithEnum simpleObjectWithEnum = ObjectSpace.FindObject <SimpleObjectWithEnum>(CriteriaOperator.Parse("Name == 'One'")); if (simpleObjectWithEnum == null) { simpleObjectWithEnum = ObjectSpace.CreateObject <SimpleObjectWithEnum>(); simpleObjectWithEnum.Name = "One"; simpleObjectWithEnum.SimpleEnum = SimpleEnum.One; } ObjectWithSecurity objectWithSecurity = ObjectSpace.FindObject <ObjectWithSecurity>(new BinaryOperator("Name", "TestObject")); if (objectWithSecurity == null) { objectWithSecurity = ObjectSpace.CreateObject <ObjectWithSecurity>(); objectWithSecurity.Name = "TestObject"; PermissionPolicyUser user = ObjectSpace.FindObject <PermissionPolicyUser>(new BinaryOperator("UserName", "User")); objectWithSecurity.User = user; } ObjectSpace.CommitChanges(); }
public override IEnumerable <ModuleUpdater> GetModuleUpdaters(IObjectSpace objectSpace, Version versionFromDB) { ModuleUpdater updater = new DatabaseUpdate.Updater(objectSpace, versionFromDB); PredefinedReportsUpdater predefinedReportsUpdater = new PredefinedReportsUpdater(Application, objectSpace, versionFromDB); #region Predefined/Custom Reports ReportDataV2 reportDataV2 = objectSpace.FindObject <ReportDataV2>(new BinaryOperator("PredefinedReportType", typeof(Invoice))); if (reportDataV2 != null) { predefinedReportsUpdater.AddPredefinedReport <InvoiceReport>(reportDataV2.DisplayName, typeof(Invoice), isInplaceReport: reportDataV2.IsInplaceReport); } else { predefinedReportsUpdater.AddPredefinedReport <InvoiceReport>("Print Invoice", typeof(Invoice), isInplaceReport: true); } reportDataV2 = objectSpace.FindObject <ReportDataV2>(new BinaryOperator("PredefinedReportType", typeof(Quote))); if (reportDataV2 != null) { predefinedReportsUpdater.AddPredefinedReport <QuoteReport>(reportDataV2.DisplayName, typeof(Quote), isInplaceReport: reportDataV2.IsInplaceReport); } else { predefinedReportsUpdater.AddPredefinedReport <QuoteReport>("Print Quote", typeof(Quote), isInplaceReport: true); } reportDataV2 = objectSpace.FindObject <ReportDataV2>(new BinaryOperator("PredefinedReportType", typeof(CreditNote))); if (reportDataV2 != null) { predefinedReportsUpdater.AddPredefinedReport <CreditNoteReport>(reportDataV2.DisplayName, typeof(CreditNote), isInplaceReport: reportDataV2.IsInplaceReport); } else { predefinedReportsUpdater.AddPredefinedReport <CreditNoteReport>("Print Credit Note", typeof(CreditNote), isInplaceReport: true); } reportDataV2 = objectSpace.FindObject <ReportDataV2>(new BinaryOperator("PredefinedReportType", typeof(SupplierCreditNote))); if (reportDataV2 != null) { predefinedReportsUpdater.AddPredefinedReport <SupplierCreditNoteReport>(reportDataV2.DisplayName, typeof(SupplierCreditNote), isInplaceReport: reportDataV2.IsInplaceReport); } else { predefinedReportsUpdater.AddPredefinedReport <SupplierCreditNoteReport>("Print Supplier Credit Note", typeof(SupplierCreditNote), isInplaceReport: true); } reportDataV2 = objectSpace.FindObject <ReportDataV2>(new BinaryOperator("PredefinedReportType", typeof(JobCard))); if (reportDataV2 != null) { predefinedReportsUpdater.AddPredefinedReport <JobCardReport>(reportDataV2.DisplayName, typeof(JobCard), isInplaceReport: reportDataV2.IsInplaceReport); } else { predefinedReportsUpdater.AddPredefinedReport <JobCardReport>("Print Jobcard", typeof(JobCard), isInplaceReport: true); } reportDataV2 = objectSpace.FindObject <ReportDataV2>(new BinaryOperator("PredefinedReportType", typeof(Purchase))); if (reportDataV2 != null) { predefinedReportsUpdater.AddPredefinedReport <PurchaseReport>(reportDataV2.DisplayName, typeof(Purchase), isInplaceReport: reportDataV2.IsInplaceReport); } else { predefinedReportsUpdater.AddPredefinedReport <PurchaseReport>("Print Purchase", typeof(Purchase), isInplaceReport: true); } reportDataV2 = objectSpace.FindObject <ReportDataV2>(new BinaryOperator("PredefinedReportType", typeof(RequestForQuote))); if (reportDataV2 != null) { predefinedReportsUpdater.AddPredefinedReport <RequestForQuoteReport>(reportDataV2.DisplayName, typeof(RequestForQuote), isInplaceReport: reportDataV2.IsInplaceReport); } else { predefinedReportsUpdater.AddPredefinedReport <RequestForQuoteReport>("Print Request For Quote", typeof(RequestForQuote), isInplaceReport: true); } #endregion predefinedReportsUpdater.AddPredefinedReport <ClientStatementReport>("Print Statement", typeof(Vendor), isInplaceReport: true); predefinedReportsUpdater.AddPredefinedReport <TimeTrackingReport>("Time Tracking", typeof(WorkFlowTimeTracking), isInplaceReport: false); predefinedReportsUpdater.AddPredefinedReport <PickingSlipReport>("Picking Slip", typeof(MassInventoryMovement), isInplaceReport: true); predefinedReportsUpdater.AddPredefinedReport <TransactionReport>("Accounts Aging - Accounts", typeof(Transaction), isInplaceReport: false); predefinedReportsUpdater.AddPredefinedReport <TransactionReportCreditors>("Accounts Aging - Suppliers", typeof(Transaction), isInplaceReport: false); //CustomFieldHelper.CreateCustomFields(_typesInfo, objectSpace); return(new ModuleUpdater[] { updater, predefinedReportsUpdater }); }