From 4b41ed6ddef72f8be0a4959b2a23af7ef4f70900 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Fri, 3 Apr 2026 12:31:42 +0200 Subject: [PATCH] - Gestito ReportDesign - Importazione ReportDesign in ReportViewer --- .../Components/Layout/NavMenu.razor | 5 + .../Pages/CustomReportStorageWebExtension.cs | 66 +- .../Components/Pages/ReportDesign.razor | 15 + .../Components/Pages/ReportDesign.razor.cs | 62 ++ .../Components/Pages/ReportViewer.razor | 5 +- .../Components/Pages/ReportViewer.razor.cs | 22 +- .../Components/Reports/OfferReport.cs | 2 + .../Components/Reports/TestReport.Designer.cs | 750 ------------------ .../Components/Reports/TestReport.cs | 16 - .../Components/Reports/TestReport.resx | 123 --- TestDevExpress/Program.cs | 5 +- TestDevExpress/Reports/TestReport1.repx | 173 ++++ .../CustomReportStorageWebExtension.cs | 73 ++ TestDevExpress/Services/MyReportProvider.cs | 63 ++ TestDevExpress/appsettings.json | 1 + 15 files changed, 480 insertions(+), 901 deletions(-) create mode 100644 TestDevExpress/Components/Pages/ReportDesign.razor create mode 100644 TestDevExpress/Components/Pages/ReportDesign.razor.cs delete mode 100644 TestDevExpress/Components/Reports/TestReport.Designer.cs delete mode 100644 TestDevExpress/Components/Reports/TestReport.cs delete mode 100644 TestDevExpress/Components/Reports/TestReport.resx create mode 100644 TestDevExpress/Reports/TestReport1.repx create mode 100644 TestDevExpress/Services/CustomReportStorageWebExtension.cs create mode 100644 TestDevExpress/Services/MyReportProvider.cs diff --git a/TestDevExpress/Components/Layout/NavMenu.razor b/TestDevExpress/Components/Layout/NavMenu.razor index 6a070f6..0efb774 100644 --- a/TestDevExpress/Components/Layout/NavMenu.razor +++ b/TestDevExpress/Components/Layout/NavMenu.razor @@ -31,6 +31,11 @@ Report + diff --git a/TestDevExpress/Components/Pages/CustomReportStorageWebExtension.cs b/TestDevExpress/Components/Pages/CustomReportStorageWebExtension.cs index a1009ca..fb1c255 100644 --- a/TestDevExpress/Components/Pages/CustomReportStorageWebExtension.cs +++ b/TestDevExpress/Components/Pages/CustomReportStorageWebExtension.cs @@ -1,5 +1,6 @@ using DevExpress.XtraReports.UI; using System.ServiceModel; +using System.Web; public class CustomReportStorageWebExtension : DevExpress.XtraReports.Web.Extensions.ReportStorageWebExtension { @@ -38,18 +39,73 @@ public class CustomReportStorageWebExtension : DevExpress.XtraReports.Web.Extens // This method is called if the **IsValidUrl** method returns **true**. // You can use the **GetData** method to process report parameters sent from the client // if the parameters are included in the report URL's query string. + //try + //{ + // if (Directory.EnumerateFiles(reportDirectory).Select(Path.GetFileNameWithoutExtension).Contains(url)) + // { + // return File.ReadAllBytes(Path.Combine(reportDirectory, url + FileExtension)); + // } + //} + //catch (Exception) + //{ + // throw new FaultException(new FaultReason("Could not get report data."), new FaultCode("Server"), "GetData"); + //} + //throw new FaultException(new FaultReason(string.Format("Could not find report '{0}'.", url)), new FaultCode("Server"), "GetData"); + + string ReportDirectory = "Reports"; try { - if (Directory.EnumerateFiles(reportDirectory).Select(Path.GetFileNameWithoutExtension).Contains(url)) + // Parse the string with the report name and parameter values. + string[] parts = url.Split('?'); + string reportName = parts[0]; + string parametersQueryString = parts.Length > 1 ? parts[1] : String.Empty; + + // Create a report instance. + XtraReport report = null; + + if (Directory.EnumerateFiles(ReportDirectory). + Select(Path.GetFileNameWithoutExtension).Contains(reportName)) { - return File.ReadAllBytes(Path.Combine(reportDirectory, url + FileExtension)); + byte[] reportBytes = File.ReadAllBytes(Path.Combine(ReportDirectory, reportName + FileExtension)); + using (MemoryStream ms = new MemoryStream(reportBytes)) + report = XtraReport.FromStream(ms); + } + + if (report != null) + { + // Apply the parameter values to the report. + var parameters = HttpUtility.ParseQueryString(parametersQueryString); + + foreach (string parameterName in parameters.AllKeys) + { + report.Parameters[parameterName].Value = Convert.ChangeType( + parameters.Get(parameterName), report.Parameters[parameterName].Type); + } + + // Disable the Visible property for all report parameters + // to hide the Parameters Panel in the viewer. + foreach (var parameter in report.Parameters) + { + parameter.Visible = false; + } + + // If you do not hide the panel, disable the report's RequestParameters property. + // report.RequestParameters = false; + + using (MemoryStream ms = new MemoryStream()) + { + report.SaveLayoutToXml(ms); + return ms.ToArray(); + } } } - catch (Exception) + catch (Exception ex) { - throw new FaultException(new FaultReason("Could not get report data."), new FaultCode("Server"), "GetData"); + throw new DevExpress.XtraReports.Web.ClientControls.FaultException( + "Could not get report data.", ex); } - throw new FaultException(new FaultReason(string.Format("Could not find report '{0}'.", url)), new FaultCode("Server"), "GetData"); + throw new DevExpress.XtraReports.Web.ClientControls.FaultException( + string.Format("Could not find report '{0}'.", url)); } public override Dictionary GetUrls() diff --git a/TestDevExpress/Components/Pages/ReportDesign.razor b/TestDevExpress/Components/Pages/ReportDesign.razor new file mode 100644 index 0000000..35da2a9 --- /dev/null +++ b/TestDevExpress/Components/Pages/ReportDesign.razor @@ -0,0 +1,15 @@ +@page "/design" +@rendermode InteractiveServer + +

ReportViewer

+ + + + + + + + + + + diff --git a/TestDevExpress/Components/Pages/ReportDesign.razor.cs b/TestDevExpress/Components/Pages/ReportDesign.razor.cs new file mode 100644 index 0000000..d6701f3 --- /dev/null +++ b/TestDevExpress/Components/Pages/ReportDesign.razor.cs @@ -0,0 +1,62 @@ +using DevExpress.Blazor.Reporting; +using DevExpress.DataAccess; +using DevExpress.DataAccess.Json; +using DevExpress.Drawing.Internal.Fonts.Interop; +using DevExpress.Security; +using DevExpress.XtraReports; +using DevExpress.XtraReports.UI; +using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.WebUtilities; +using TestDevExpress.Components.Reports; + +namespace TestDevExpress.Components.Pages +{ + public partial class ReportDesign + { + #region Protected Methods + + private string pdfUrl + { + get => $"download-offer?id={oID}"; + } + private int oID = 0; + protected override void OnInitialized() + { + // calcolo i parametri x IMG e Json da conf + string apiUrl = _config.GetValue("ServerConf:ApiBaseUrl") ?? "https://iis01.egalware.com/lux/srv/api"; + string imgUrl = _config.GetValue("ServerConf:ImageUrl") ?? "image"; + string dataUrl = _config.GetValue("ServerConf:DataUrl") ?? "report/offert/"; + + string imgFullUrl = $"{apiUrl}/{imgUrl}/"; + string dataFullUrl = $"{apiUrl}/{dataUrl}"; + + //cerco id da URL x offerta da mostrare + var uri = NavManager.ToAbsoluteUri(NavManager.Uri); + if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("OfferId", out var offerId)) + { + int.TryParse(offerId, out oID); + currReport = new OfferReport(dataFullUrl, oID); + currReport.Parameters["pImgPath"].Value = imgFullUrl; + } + } + + #endregion Protected Methods + + #region Private Fields + + private OfferReport currReport = new(); + private DxReportViewer? reportViewer; + + #endregion Private Fields + + #region Private Properties + + [Inject] + private IConfiguration _config { get; set; } = null!; + + [Inject] + private NavigationManager NavManager { get; set; } = null!; + + #endregion Private Properties + } +} \ No newline at end of file diff --git a/TestDevExpress/Components/Pages/ReportViewer.razor b/TestDevExpress/Components/Pages/ReportViewer.razor index d03e3d7..8fcc934 100644 --- a/TestDevExpress/Components/Pages/ReportViewer.razor +++ b/TestDevExpress/Components/Pages/ReportViewer.razor @@ -16,10 +16,7 @@ Download PDF - + -@* - *@ - diff --git a/TestDevExpress/Components/Pages/ReportViewer.razor.cs b/TestDevExpress/Components/Pages/ReportViewer.razor.cs index e331884..2c20012 100644 --- a/TestDevExpress/Components/Pages/ReportViewer.razor.cs +++ b/TestDevExpress/Components/Pages/ReportViewer.razor.cs @@ -1,18 +1,24 @@ using DevExpress.Blazor.Reporting; using DevExpress.DataAccess; using DevExpress.DataAccess.Json; +using DevExpress.DataAccess.ObjectBinding; using DevExpress.Drawing.Internal.Fonts.Interop; using DevExpress.Security; +using DevExpress.XtraPrinting.Native.Properties; using DevExpress.XtraReports; +using DevExpress.XtraReports.Parameters; +using DevExpress.XtraReports.Services; using DevExpress.XtraReports.UI; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.WebUtilities; +using System.Security.Cryptography; using TestDevExpress.Components.Reports; namespace TestDevExpress.Components.Pages { public partial class ReportViewer { + #region Protected Methods private string pdfUrl @@ -31,12 +37,20 @@ namespace TestDevExpress.Components.Pages string dataFullUrl = $"{apiUrl}/{dataUrl}"; //cerco id da URL x offerta da mostrare + //var uri = NavManager.ToAbsoluteUri(NavManager.Uri); + //if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("OfferId", out var offerId)) + //{ + // int.TryParse(offerId, out oID); + // currReport = new OfferReport(dataFullUrl, oID); + // currReport.Parameters["pImgPath"].Value = imgFullUrl; + //} + var uri = NavManager.ToAbsoluteUri(NavManager.Uri); if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("OfferId", out var offerId)) { int.TryParse(offerId, out oID); - currReport = new OfferReport(dataFullUrl, oID); - currReport.Parameters["pImgPath"].Value = imgFullUrl; + Report = reportProvider.GetReport("TestReport1?URL=" + dataFullUrl + "?pOfferId=" + offerId + "&pImgPath=" + imgFullUrl, null); + } } @@ -46,6 +60,7 @@ namespace TestDevExpress.Components.Pages private OfferReport currReport = new(); private DxReportViewer? reportViewer; + private XtraReport Report = new OfferReport(); #endregion Private Fields @@ -57,6 +72,9 @@ namespace TestDevExpress.Components.Pages [Inject] private NavigationManager NavManager { get; set; } = null!; + [Inject] + public IReportProvider reportProvider { get; set; } + #endregion Private Properties } } \ No newline at end of file diff --git a/TestDevExpress/Components/Reports/OfferReport.cs b/TestDevExpress/Components/Reports/OfferReport.cs index 12726f7..b6bf1a4 100644 --- a/TestDevExpress/Components/Reports/OfferReport.cs +++ b/TestDevExpress/Components/Reports/OfferReport.cs @@ -1,4 +1,6 @@ using DevExpress.DataAccess.Json; +using DevExpress.XtraExport; +using DevExpress.XtraReports.Services; using DevExpress.XtraReports.UI; using System; using System.Collections; diff --git a/TestDevExpress/Components/Reports/TestReport.Designer.cs b/TestDevExpress/Components/Reports/TestReport.Designer.cs deleted file mode 100644 index 2e02bbc..0000000 --- a/TestDevExpress/Components/Reports/TestReport.Designer.cs +++ /dev/null @@ -1,750 +0,0 @@ -namespace TestDevExpress.Components.Pages -{ - partial class TestReport - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - DevExpress.DataAccess.Sql.SelectQuery selectQuery2 = new DevExpress.DataAccess.Sql.SelectQuery(); - DevExpress.DataAccess.Sql.Column column9 = new DevExpress.DataAccess.Sql.Column(); - DevExpress.DataAccess.Sql.ColumnExpression columnExpression9 = new DevExpress.DataAccess.Sql.ColumnExpression(); - DevExpress.DataAccess.Sql.Table table2 = new DevExpress.DataAccess.Sql.Table(); - DevExpress.DataAccess.Sql.Column column10 = new DevExpress.DataAccess.Sql.Column(); - DevExpress.DataAccess.Sql.ColumnExpression columnExpression10 = new DevExpress.DataAccess.Sql.ColumnExpression(); - DevExpress.DataAccess.Sql.Column column11 = new DevExpress.DataAccess.Sql.Column(); - DevExpress.DataAccess.Sql.ColumnExpression columnExpression11 = new DevExpress.DataAccess.Sql.ColumnExpression(); - DevExpress.DataAccess.Sql.Column column12 = new DevExpress.DataAccess.Sql.Column(); - DevExpress.DataAccess.Sql.ColumnExpression columnExpression12 = new DevExpress.DataAccess.Sql.ColumnExpression(); - DevExpress.DataAccess.Sql.Column column13 = new DevExpress.DataAccess.Sql.Column(); - DevExpress.DataAccess.Sql.ColumnExpression columnExpression13 = new DevExpress.DataAccess.Sql.ColumnExpression(); - DevExpress.DataAccess.Sql.Column column14 = new DevExpress.DataAccess.Sql.Column(); - DevExpress.DataAccess.Sql.ColumnExpression columnExpression14 = new DevExpress.DataAccess.Sql.ColumnExpression(); - DevExpress.DataAccess.Sql.Column column15 = new DevExpress.DataAccess.Sql.Column(); - DevExpress.DataAccess.Sql.ColumnExpression columnExpression15 = new DevExpress.DataAccess.Sql.ColumnExpression(); - DevExpress.DataAccess.Sql.Column column16 = new DevExpress.DataAccess.Sql.Column(); - DevExpress.DataAccess.Sql.ColumnExpression columnExpression16 = new DevExpress.DataAccess.Sql.ColumnExpression(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TestReport)); - DevExpress.XtraReports.Parameters.DynamicListLookUpSettings dynamicListLookUpSettings2 = new DevExpress.XtraReports.Parameters.DynamicListLookUpSettings(); - DevExpress.XtraReports.UI.XRSummary xrSummary3 = new DevExpress.XtraReports.UI.XRSummary(); - DevExpress.XtraReports.UI.XRSummary xrSummary4 = new DevExpress.XtraReports.UI.XRSummary(); - DevExpress.XtraReports.UI.XRTableOfContentsLevel xrTableOfContentsLevel3 = new DevExpress.XtraReports.UI.XRTableOfContentsLevel(); - DevExpress.XtraReports.UI.XRTableOfContentsLevel xrTableOfContentsLevel4 = new DevExpress.XtraReports.UI.XRTableOfContentsLevel(); - this.sqlDataSource1 = new DevExpress.DataAccess.Sql.SqlDataSource(this.components); - this.Detail = new DevExpress.XtraReports.UI.DetailBand(); - this.xrTable1 = new DevExpress.XtraReports.UI.XRTable(); - this.xrTableRow1 = new DevExpress.XtraReports.UI.XRTableRow(); - this.xrTableCell1 = new DevExpress.XtraReports.UI.XRTableCell(); - this.he = new DevExpress.XtraReports.UI.XRLabel(); - this.xrTableCell2 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell3 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell4 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell5 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableRow2 = new DevExpress.XtraReports.UI.XRTableRow(); - this.xrTableCell6 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell7 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell8 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell9 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell10 = new DevExpress.XtraReports.UI.XRTableCell(); - this.TopMargin = new DevExpress.XtraReports.UI.TopMarginBand(); - this.BottomMargin = new DevExpress.XtraReports.UI.BottomMarginBand(); - this.GroupHeader1 = new DevExpress.XtraReports.UI.GroupHeaderBand(); - this.xrPageInfo2 = new DevExpress.XtraReports.UI.XRPageInfo(); - this.xrPageInfo1 = new DevExpress.XtraReports.UI.XRPageInfo(); - this.xrTable2 = new DevExpress.XtraReports.UI.XRTable(); - this.xrTableRow3 = new DevExpress.XtraReports.UI.XRTableRow(); - this.xrTableCell11 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell12 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell13 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell14 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell15 = new DevExpress.XtraReports.UI.XRTableCell(); - this.orderID = new DevExpress.XtraReports.Parameters.Parameter(); - this.HeaderStyle = new DevExpress.XtraReports.UI.XRControlStyle(); - this.OddStyle = new DevExpress.XtraReports.UI.XRControlStyle(); - this.EvenStyle = new DevExpress.XtraReports.UI.XRControlStyle(); - this.isRegularPriceProduct = new DevExpress.XtraReports.UI.CalculatedField(); - this.groupHeaderBand1 = new DevExpress.XtraReports.UI.GroupHeaderBand(); - this.xrLabel1 = new DevExpress.XtraReports.UI.XRLabel(); - this.groupFooterBand1 = new DevExpress.XtraReports.UI.GroupFooterBand(); - this.xrLabel3 = new DevExpress.XtraReports.UI.XRLabel(); - this.xrLabel2 = new DevExpress.XtraReports.UI.XRLabel(); - this.ReportHeader = new DevExpress.XtraReports.UI.ReportHeaderBand(); - this.xrTableOfContents1 = new DevExpress.XtraReports.UI.XRTableOfContents(); - ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); - // - // sqlDataSource1 - // - this.sqlDataSource1.ConnectionName = "nwind"; - this.sqlDataSource1.Name = "sqlDataSource1"; - columnExpression9.ColumnName = "OrderID"; - table2.Name = "OrderDetailsExtended"; - columnExpression9.Table = table2; - column9.Expression = columnExpression9; - columnExpression10.ColumnName = "ProductID"; - columnExpression10.Table = table2; - column10.Expression = columnExpression10; - columnExpression11.ColumnName = "ProductName"; - columnExpression11.Table = table2; - column11.Expression = columnExpression11; - columnExpression12.ColumnName = "UnitPrice"; - columnExpression12.Table = table2; - column12.Expression = columnExpression12; - columnExpression13.ColumnName = "Quantity"; - columnExpression13.Table = table2; - column13.Expression = columnExpression13; - columnExpression14.ColumnName = "Discount"; - columnExpression14.Table = table2; - column14.Expression = columnExpression14; - columnExpression15.ColumnName = "ExtendedPrice"; - columnExpression15.Table = table2; - column15.Expression = columnExpression15; - columnExpression16.ColumnName = "Supplier"; - columnExpression16.Table = table2; - column16.Expression = columnExpression16; - selectQuery2.Columns.Add(column9); - selectQuery2.Columns.Add(column10); - selectQuery2.Columns.Add(column11); - selectQuery2.Columns.Add(column12); - selectQuery2.Columns.Add(column13); - selectQuery2.Columns.Add(column14); - selectQuery2.Columns.Add(column15); - selectQuery2.Columns.Add(column16); - selectQuery2.Name = "OrderDetailsExtended"; - selectQuery2.Tables.Add(table2); - this.sqlDataSource1.Queries.AddRange(new DevExpress.DataAccess.Sql.SqlQuery[] { - selectQuery2}); - this.sqlDataSource1.ResultSchemaSerializable = resources.GetString("sqlDataSource1.ResultSchemaSerializable"); - // - // Detail - // - this.Detail.Borders = DevExpress.XtraPrinting.BorderSide.Bottom; - this.Detail.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { - this.xrTable1}); - this.Detail.Dpi = 96F; - this.Detail.EvenStyleName = "EvenStyle"; - this.Detail.HeightF = 90F; - this.Detail.HierarchyPrintOptions.Indent = 19.2F; - this.Detail.KeepTogether = true; - this.Detail.Name = "Detail"; - this.Detail.OddStyleName = "OddStyle"; - this.Detail.Padding = new DevExpress.XtraPrinting.PaddingInfo(0F, 0F, 0F, 0F, 96F); - this.Detail.StylePriority.UseBorders = false; - this.Detail.StylePriority.UseTextAlignment = false; - this.Detail.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; - // - // xrTable1 - // - this.xrTable1.Dpi = 96F; - this.xrTable1.LocationFloat = new DevExpress.Utils.PointFloat(0.3000488F, 0F); - this.xrTable1.Name = "xrTable1"; - this.xrTable1.Padding = new DevExpress.XtraPrinting.PaddingInfo(2F, 2F, 0F, 0F, 96F); - this.xrTable1.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { - this.xrTableRow1, - this.xrTableRow2}); - this.xrTable1.SizeF = new System.Drawing.SizeF(671.7F, 90F); - // - // xrTableRow1 - // - this.xrTableRow1.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] { - this.xrTableCell1, - this.xrTableCell2, - this.xrTableCell3, - this.xrTableCell4, - this.xrTableCell5}); - this.xrTableRow1.Dpi = 96F; - this.xrTableRow1.Name = "xrTableRow1"; - this.xrTableRow1.Weight = 33.541666666666664D; - // - // xrTableCell1 - // - this.xrTableCell1.Bookmark = "[ProductName]"; - this.xrTableCell1.BookmarkParent = this.he; - this.xrTableCell1.Borders = DevExpress.XtraPrinting.BorderSide.None; - this.xrTableCell1.Dpi = 96F; - this.xrTableCell1.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] { - new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[ProductName]"), - new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Bookmark", "[ProductName]")}); - this.xrTableCell1.Font = new DevExpress.Drawing.DXFont("Arial", 9.75F, DevExpress.Drawing.DXFontStyle.Bold); - this.xrTableCell1.Multiline = true; - this.xrTableCell1.Name = "xrTableCell1"; - this.xrTableCell1.Padding = new DevExpress.XtraPrinting.PaddingInfo(15F, 5F, 0F, 2F, 96F); - this.xrTableCell1.StylePriority.UseBorders = false; - this.xrTableCell1.StylePriority.UseFont = false; - this.xrTableCell1.StylePriority.UsePadding = false; - this.xrTableCell1.StylePriority.UseTextAlignment = false; - this.xrTableCell1.Text = "xrTableCell1"; - this.xrTableCell1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.BottomLeft; - this.xrTableCell1.Weight = 1.7094017746102095D; - // - // he - // - this.he.BackColor = System.Drawing.Color.Transparent; - this.he.Borders = DevExpress.XtraPrinting.BorderSide.None; - this.he.Dpi = 96F; - this.he.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] { - new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[OrderID]"), - new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Bookmark", "iif([isRegularPriceProduct],\n \'Products with Regular Price (less than $10)\',\n " + - " \'Expensive Products ($10 or greater)\')")}); - this.he.Font = new DevExpress.Drawing.DXFont("Arial", 18F, DevExpress.Drawing.DXFontStyle.Bold); - this.he.ForeColor = System.Drawing.Color.Black; - this.he.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F); - this.he.Multiline = true; - this.he.Name = "he"; - this.he.Padding = new DevExpress.XtraPrinting.PaddingInfo(2F, 2F, 0F, 0F, 96F); - this.he.SizeF = new System.Drawing.SizeF(425.5F, 35F); - this.he.StylePriority.UseBackColor = false; - this.he.StylePriority.UseBorders = false; - this.he.StylePriority.UseFont = false; - this.he.StylePriority.UseForeColor = false; - this.he.Text = "he"; - this.he.TextFormatString = "Details for Customer Order # {0}"; - // - // xrTableCell2 - // - this.xrTableCell2.Dpi = 96F; - this.xrTableCell2.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] { - new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[UnitPrice]")}); - this.xrTableCell2.Font = new DevExpress.Drawing.DXFont("Arial", 9.75F); - this.xrTableCell2.Multiline = true; - this.xrTableCell2.Name = "xrTableCell2"; - this.xrTableCell2.Padding = new DevExpress.XtraPrinting.PaddingInfo(2F, 15F, 15F, 0F, 96F); - this.xrTableCell2.RowSpan = 2; - this.xrTableCell2.StylePriority.UseFont = false; - this.xrTableCell2.StylePriority.UsePadding = false; - this.xrTableCell2.Text = "xrTableCell2"; - this.xrTableCell2.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; - this.xrTableCell2.TextFormatString = "{0:$#,##.00}"; - this.xrTableCell2.Weight = 0.50000042385525179D; - // - // xrTableCell3 - // - this.xrTableCell3.Dpi = 96F; - this.xrTableCell3.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] { - new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Quantity]")}); - this.xrTableCell3.Font = new DevExpress.Drawing.DXFont("Arial", 9.75F); - this.xrTableCell3.Multiline = true; - this.xrTableCell3.Name = "xrTableCell3"; - this.xrTableCell3.Padding = new DevExpress.XtraPrinting.PaddingInfo(2F, 15F, 15F, 0F, 96F); - this.xrTableCell3.RowSpan = 2; - this.xrTableCell3.StylePriority.UseFont = false; - this.xrTableCell3.StylePriority.UsePadding = false; - this.xrTableCell3.Text = "xrTableCell3"; - this.xrTableCell3.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; - this.xrTableCell3.Weight = 0.43696475232768278D; - // - // xrTableCell4 - // - this.xrTableCell4.Dpi = 96F; - this.xrTableCell4.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] { - new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Discount]")}); - this.xrTableCell4.Font = new DevExpress.Drawing.DXFont("Arial", 9.75F); - this.xrTableCell4.Multiline = true; - this.xrTableCell4.Name = "xrTableCell4"; - this.xrTableCell4.Padding = new DevExpress.XtraPrinting.PaddingInfo(2F, 15F, 15F, 0F, 96F); - this.xrTableCell4.RowSpan = 2; - this.xrTableCell4.StylePriority.UseFont = false; - this.xrTableCell4.StylePriority.UsePadding = false; - this.xrTableCell4.Text = "xrTableCell4"; - this.xrTableCell4.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; - this.xrTableCell4.TextFormatString = "{0:0%}"; - this.xrTableCell4.Weight = 0.44230793683956826D; - // - // xrTableCell5 - // - this.xrTableCell5.Dpi = 96F; - this.xrTableCell5.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] { - new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[ExtendedPrice]")}); - this.xrTableCell5.Font = new DevExpress.Drawing.DXFont("Arial", 9.75F); - this.xrTableCell5.Multiline = true; - this.xrTableCell5.Name = "xrTableCell5"; - this.xrTableCell5.Padding = new DevExpress.XtraPrinting.PaddingInfo(2F, 15F, 15F, 0F, 96F); - this.xrTableCell5.RowSpan = 2; - this.xrTableCell5.StylePriority.UseFont = false; - this.xrTableCell5.StylePriority.UsePadding = false; - this.xrTableCell5.Text = "xrTableCell5"; - this.xrTableCell5.TextFormatString = "{0:#.00}"; - this.xrTableCell5.Weight = 0.49946587717431218D; - // - // xrTableRow2 - // - this.xrTableRow2.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] { - this.xrTableCell6, - this.xrTableCell7, - this.xrTableCell8, - this.xrTableCell9, - this.xrTableCell10}); - this.xrTableRow2.Dpi = 96F; - this.xrTableRow2.Name = "xrTableRow2"; - this.xrTableRow2.Weight = 52.708333333333336D; - // - // xrTableCell6 - // - this.xrTableCell6.CanGrow = false; - this.xrTableCell6.Dpi = 96F; - this.xrTableCell6.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] { - new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Supplier]")}); - this.xrTableCell6.Font = new DevExpress.Drawing.DXFont("Arial", 9.75F); - this.xrTableCell6.Multiline = true; - this.xrTableCell6.Name = "xrTableCell6"; - this.xrTableCell6.Padding = new DevExpress.XtraPrinting.PaddingInfo(15F, 5F, 0F, 10F, 96F); - this.xrTableCell6.StylePriority.UseFont = false; - this.xrTableCell6.StylePriority.UsePadding = false; - this.xrTableCell6.StylePriority.UseTextAlignment = false; - this.xrTableCell6.Text = "xrTableCell6"; - this.xrTableCell6.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft; - this.xrTableCell6.TextFitMode = DevExpress.XtraReports.UI.TextFitMode.ShrinkOnly; - this.xrTableCell6.Weight = 1.7094017746102095D; - // - // xrTableCell7 - // - this.xrTableCell7.Dpi = 96F; - this.xrTableCell7.Multiline = true; - this.xrTableCell7.Name = "xrTableCell7"; - this.xrTableCell7.Text = "xrTableCell7"; - this.xrTableCell7.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; - this.xrTableCell7.Weight = 0.50000042385525179D; - // - // xrTableCell8 - // - this.xrTableCell8.Dpi = 96F; - this.xrTableCell8.Multiline = true; - this.xrTableCell8.Name = "xrTableCell8"; - this.xrTableCell8.Text = "xrTableCell8"; - this.xrTableCell8.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; - this.xrTableCell8.Weight = 0.43696475232768278D; - // - // xrTableCell9 - // - this.xrTableCell9.Dpi = 96F; - this.xrTableCell9.Multiline = true; - this.xrTableCell9.Name = "xrTableCell9"; - this.xrTableCell9.Text = "xrTableCell9"; - this.xrTableCell9.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; - this.xrTableCell9.Weight = 0.44230793683956826D; - // - // xrTableCell10 - // - this.xrTableCell10.Dpi = 96F; - this.xrTableCell10.Multiline = true; - this.xrTableCell10.Name = "xrTableCell10"; - this.xrTableCell10.Text = "xrTableCell10"; - this.xrTableCell10.Weight = 0.49946587717431218D; - // - // TopMargin - // - this.TopMargin.Dpi = 96F; - this.TopMargin.HeightF = 72F; - this.TopMargin.Name = "TopMargin"; - this.TopMargin.Padding = new DevExpress.XtraPrinting.PaddingInfo(0F, 0F, 0F, 0F, 96F); - this.TopMargin.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft; - // - // BottomMargin - // - this.BottomMargin.Dpi = 96F; - this.BottomMargin.HeightF = 72F; - this.BottomMargin.Name = "BottomMargin"; - this.BottomMargin.Padding = new DevExpress.XtraPrinting.PaddingInfo(0F, 0F, 0F, 0F, 96F); - this.BottomMargin.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft; - // - // GroupHeader1 - // - this.GroupHeader1.Borders = ((DevExpress.XtraPrinting.BorderSide)((DevExpress.XtraPrinting.BorderSide.Top | DevExpress.XtraPrinting.BorderSide.Bottom))); - this.GroupHeader1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { - this.xrPageInfo2, - this.xrPageInfo1, - this.he, - this.xrTable2}); - this.GroupHeader1.Dpi = 96F; - this.GroupHeader1.Font = new DevExpress.Drawing.DXFont("Arial", 9.75F, DevExpress.Drawing.DXFontStyle.Bold); - this.GroupHeader1.HeightF = 109F; - this.GroupHeader1.Level = 1; - this.GroupHeader1.Name = "GroupHeader1"; - this.GroupHeader1.RepeatEveryPage = true; - this.GroupHeader1.StyleName = "HeaderStyle"; - this.GroupHeader1.StylePriority.UseBorders = false; - this.GroupHeader1.StylePriority.UseFont = false; - // - // xrPageInfo2 - // - this.xrPageInfo2.BackColor = System.Drawing.Color.Transparent; - this.xrPageInfo2.Dpi = 96F; - this.xrPageInfo2.Font = new DevExpress.Drawing.DXFont("Segoe UI", 10F, DevExpress.Drawing.DXFontStyle.Bold); - this.xrPageInfo2.ForeColor = System.Drawing.Color.Black; - this.xrPageInfo2.LocationFloat = new DevExpress.Utils.PointFloat(0F, 35F); - this.xrPageInfo2.Name = "xrPageInfo2"; - this.xrPageInfo2.Padding = new DevExpress.XtraPrinting.PaddingInfo(2F, 2F, 0F, 0F, 96F); - this.xrPageInfo2.PageInfo = DevExpress.XtraPrinting.PageInfo.DateTime; - this.xrPageInfo2.SizeF = new System.Drawing.SizeF(425.5F, 30.08003F); - this.xrPageInfo2.StylePriority.UseBackColor = false; - this.xrPageInfo2.StylePriority.UseFont = false; - this.xrPageInfo2.StylePriority.UseForeColor = false; - this.xrPageInfo2.StylePriority.UseTextAlignment = false; - this.xrPageInfo2.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft; - this.xrPageInfo2.TextFormatString = "{0:d MMMM yyyy HH:mm}"; - // - // xrPageInfo1 - // - this.xrPageInfo1.BackColor = System.Drawing.Color.Transparent; - this.xrPageInfo1.Borders = DevExpress.XtraPrinting.BorderSide.None; - this.xrPageInfo1.Dpi = 96F; - this.xrPageInfo1.Font = new DevExpress.Drawing.DXFont("Segoe UI", 10F, DevExpress.Drawing.DXFontStyle.Bold); - this.xrPageInfo1.ForeColor = System.Drawing.Color.Black; - this.xrPageInfo1.LocationFloat = new DevExpress.Utils.PointFloat(572F, 0F); - this.xrPageInfo1.Name = "xrPageInfo1"; - this.xrPageInfo1.Padding = new DevExpress.XtraPrinting.PaddingInfo(2F, 15F, 0F, 0F, 96F); - this.xrPageInfo1.SizeF = new System.Drawing.SizeF(100F, 35F); - this.xrPageInfo1.StylePriority.UseBackColor = false; - this.xrPageInfo1.StylePriority.UseBorders = false; - this.xrPageInfo1.StylePriority.UseFont = false; - this.xrPageInfo1.StylePriority.UseForeColor = false; - this.xrPageInfo1.StylePriority.UsePadding = false; - this.xrPageInfo1.StylePriority.UseTextAlignment = false; - this.xrPageInfo1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; - this.xrPageInfo1.TextFormatString = "Page {0} of {1}"; - // - // xrTable2 - // - this.xrTable2.Dpi = 96F; - this.xrTable2.LocationFloat = new DevExpress.Utils.PointFloat(0F, 65.08002F); - this.xrTable2.Name = "xrTable2"; - this.xrTable2.Padding = new DevExpress.XtraPrinting.PaddingInfo(2F, 2F, 0F, 0F, 96F); - this.xrTable2.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { - this.xrTableRow3}); - this.xrTable2.SizeF = new System.Drawing.SizeF(671.7F, 24F); - // - // xrTableRow3 - // - this.xrTableRow3.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] { - this.xrTableCell11, - this.xrTableCell12, - this.xrTableCell13, - this.xrTableCell14, - this.xrTableCell15}); - this.xrTableRow3.Dpi = 96F; - this.xrTableRow3.Name = "xrTableRow3"; - this.xrTableRow3.Weight = 23D; - // - // xrTableCell11 - // - this.xrTableCell11.Dpi = 96F; - this.xrTableCell11.Multiline = true; - this.xrTableCell11.Name = "xrTableCell11"; - this.xrTableCell11.Padding = new DevExpress.XtraPrinting.PaddingInfo(15F, 5F, 0F, 0F, 96F); - this.xrTableCell11.StylePriority.UsePadding = false; - this.xrTableCell11.StylePriority.UseTextAlignment = false; - this.xrTableCell11.Text = "Product Name"; - this.xrTableCell11.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft; - this.xrTableCell11.Weight = 1.191592466263544D; - // - // xrTableCell12 - // - this.xrTableCell12.Dpi = 96F; - this.xrTableCell12.Multiline = true; - this.xrTableCell12.Name = "xrTableCell12"; - this.xrTableCell12.Padding = new DevExpress.XtraPrinting.PaddingInfo(0F, 15F, 0F, 0F, 96F); - this.xrTableCell12.StylePriority.UsePadding = false; - this.xrTableCell12.StylePriority.UseTextAlignment = false; - this.xrTableCell12.Text = "Unit Price"; - this.xrTableCell12.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; - this.xrTableCell12.Weight = 0.3482146717253185D; - // - // xrTableCell13 - // - this.xrTableCell13.Dpi = 96F; - this.xrTableCell13.Multiline = true; - this.xrTableCell13.Name = "xrTableCell13"; - this.xrTableCell13.Padding = new DevExpress.XtraPrinting.PaddingInfo(0F, 15F, 0F, 0F, 96F); - this.xrTableCell13.StylePriority.UsePadding = false; - this.xrTableCell13.StylePriority.UseTextAlignment = false; - this.xrTableCell13.Text = "Quantity"; - this.xrTableCell13.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; - this.xrTableCell13.Weight = 0.30431477228800463D; - // - // xrTableCell14 - // - this.xrTableCell14.Dpi = 96F; - this.xrTableCell14.Multiline = true; - this.xrTableCell14.Name = "xrTableCell14"; - this.xrTableCell14.Padding = new DevExpress.XtraPrinting.PaddingInfo(0F, 15F, 0F, 0F, 96F); - this.xrTableCell14.StylePriority.UsePadding = false; - this.xrTableCell14.StylePriority.UseTextAlignment = false; - this.xrTableCell14.Text = "Discount"; - this.xrTableCell14.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; - this.xrTableCell14.Weight = 0.30803591864449636D; - // - // xrTableCell15 - // - this.xrTableCell15.Dpi = 96F; - this.xrTableCell15.Multiline = true; - this.xrTableCell15.Name = "xrTableCell15"; - this.xrTableCell15.Padding = new DevExpress.XtraPrinting.PaddingInfo(0F, 15F, 0F, 0F, 96F); - this.xrTableCell15.StylePriority.UsePadding = false; - this.xrTableCell15.StylePriority.UseTextAlignment = false; - this.xrTableCell15.Text = "Extended Price"; - this.xrTableCell15.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; - this.xrTableCell15.Weight = 0.34784217107863658D; - // - // orderID - // - this.orderID.Description = "OrderID"; - this.orderID.Name = "orderID"; - this.orderID.Type = typeof(long); - this.orderID.ValueInfo = "0"; - dynamicListLookUpSettings2.DataMember = "OrderDetailsExtended"; - dynamicListLookUpSettings2.DataSource = this.sqlDataSource1; - dynamicListLookUpSettings2.DisplayMember = "OrderID"; - dynamicListLookUpSettings2.SortMember = "OrderID"; - dynamicListLookUpSettings2.SortOrder = DevExpress.Data.ColumnSortOrder.Ascending; - dynamicListLookUpSettings2.ValueMember = "OrderID"; - this.orderID.ValueSourceSettings = dynamicListLookUpSettings2; - // - // HeaderStyle - // - this.HeaderStyle.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(127)))), ((int)(((byte)(127)))), ((int)(((byte)(127))))); - this.HeaderStyle.BorderColor = System.Drawing.Color.Gray; - this.HeaderStyle.Font = new DevExpress.Drawing.DXFont("Segoe UI", 8F, DevExpress.Drawing.DXFontStyle.Bold); - this.HeaderStyle.ForeColor = System.Drawing.Color.White; - this.HeaderStyle.Name = "HeaderStyle"; - this.HeaderStyle.Padding = new DevExpress.XtraPrinting.PaddingInfo(0F, 5F, 0F, 0F, 96F); - // - // OddStyle - // - this.OddStyle.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(234)))), ((int)(((byte)(245)))), ((int)(((byte)(255))))); - this.OddStyle.BorderColor = System.Drawing.Color.Transparent; - this.OddStyle.Font = new DevExpress.Drawing.DXFont("Segoe UI", 12F); - this.OddStyle.ForeColor = System.Drawing.Color.Black; - this.OddStyle.Name = "OddStyle"; - this.OddStyle.Padding = new DevExpress.XtraPrinting.PaddingInfo(5F, 5F, 0F, 0F, 96F); - // - // EvenStyle - // - this.EvenStyle.BackColor = System.Drawing.Color.White; - this.EvenStyle.BorderColor = System.Drawing.Color.Transparent; - this.EvenStyle.Font = new DevExpress.Drawing.DXFont("Segoe UI", 12F); - this.EvenStyle.ForeColor = System.Drawing.Color.Black; - this.EvenStyle.Name = "EvenStyle"; - this.EvenStyle.Padding = new DevExpress.XtraPrinting.PaddingInfo(5F, 5F, 0F, 0F, 96F); - // - // isRegularPriceProduct - // - this.isRegularPriceProduct.DataMember = "OrderDetailsExtended"; - this.isRegularPriceProduct.Expression = "[UnitPrice]<10"; - this.isRegularPriceProduct.FieldType = DevExpress.XtraReports.UI.FieldType.Boolean; - this.isRegularPriceProduct.Name = "isRegularPriceProduct"; - // - // groupHeaderBand1 - // - this.groupHeaderBand1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { - this.xrLabel1}); - this.groupHeaderBand1.Dpi = 96F; - this.groupHeaderBand1.GroupFields.AddRange(new DevExpress.XtraReports.UI.GroupField[] { - new DevExpress.XtraReports.UI.GroupField("isRegularPriceProduct", DevExpress.XtraReports.UI.XRColumnSortOrder.Descending)}); - this.groupHeaderBand1.HeightF = 50.00002F; - this.groupHeaderBand1.Name = "groupHeaderBand1"; - this.groupHeaderBand1.PageBreak = DevExpress.XtraReports.UI.PageBreak.BeforeBandExceptFirstEntry; - this.groupHeaderBand1.RepeatEveryPage = true; - // - // xrLabel1 - // - this.xrLabel1.Borders = DevExpress.XtraPrinting.BorderSide.Bottom; - this.xrLabel1.Dpi = 96F; - this.xrLabel1.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] { - new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "iif([isRegularPriceProduct],\n \'Products with Regular Price (less than $10)\',\n " + - " \'Expensive Products ($10 or greater)\')")}); - this.xrLabel1.Font = new DevExpress.Drawing.DXFont("Segoe UI", 16F); - this.xrLabel1.LocationFloat = new DevExpress.Utils.PointFloat(0.3000488F, 0F); - this.xrLabel1.Multiline = true; - this.xrLabel1.Name = "xrLabel1"; - this.xrLabel1.Padding = new DevExpress.XtraPrinting.PaddingInfo(15F, 2F, 0F, 0F, 96F); - this.xrLabel1.SizeF = new System.Drawing.SizeF(671.7F, 50.00002F); - this.xrLabel1.StylePriority.UseBorders = false; - this.xrLabel1.StylePriority.UseFont = false; - this.xrLabel1.StylePriority.UsePadding = false; - this.xrLabel1.StylePriority.UseTextAlignment = false; - this.xrLabel1.Text = "xrLabel1"; - this.xrLabel1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft; - // - // groupFooterBand1 - // - this.groupFooterBand1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { - this.xrLabel3, - this.xrLabel2}); - this.groupFooterBand1.Dpi = 96F; - this.groupFooterBand1.HeightF = 96F; - this.groupFooterBand1.Name = "groupFooterBand1"; - this.groupFooterBand1.RepeatEveryPage = true; - // - // xrLabel3 - // - this.xrLabel3.Dpi = 96F; - this.xrLabel3.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] { - new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "sumSum([ExtendedPrice])")}); - this.xrLabel3.Font = new DevExpress.Drawing.DXFont("Segoe UI", 12F); - this.xrLabel3.LocationFloat = new DevExpress.Utils.PointFloat(0F, 37.08002F); - this.xrLabel3.Multiline = true; - this.xrLabel3.Name = "xrLabel3"; - this.xrLabel3.Padding = new DevExpress.XtraPrinting.PaddingInfo(2F, 15F, 0F, 0F, 96F); - this.xrLabel3.SizeF = new System.Drawing.SizeF(672F, 37.08002F); - this.xrLabel3.StylePriority.UseFont = false; - this.xrLabel3.StylePriority.UsePadding = false; - this.xrLabel3.StylePriority.UseTextAlignment = false; - xrSummary3.Running = DevExpress.XtraReports.UI.SummaryRunning.Group; - this.xrLabel3.Summary = xrSummary3; - this.xrLabel3.Text = "xrLabel3"; - this.xrLabel3.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; - this.xrLabel3.TextFormatString = "Total Extended Price: {0:$0.00}"; - // - // xrLabel2 - // - this.xrLabel2.Dpi = 96F; - this.xrLabel2.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] { - new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "sumCount([ProductID])")}); - this.xrLabel2.Font = new DevExpress.Drawing.DXFont("Segoe UI", 12F); - this.xrLabel2.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F); - this.xrLabel2.Multiline = true; - this.xrLabel2.Name = "xrLabel2"; - this.xrLabel2.Padding = new DevExpress.XtraPrinting.PaddingInfo(2F, 15F, 0F, 0F, 96F); - this.xrLabel2.SizeF = new System.Drawing.SizeF(672F, 37.08F); - this.xrLabel2.StylePriority.UseFont = false; - this.xrLabel2.StylePriority.UsePadding = false; - this.xrLabel2.StylePriority.UseTextAlignment = false; - xrSummary4.Running = DevExpress.XtraReports.UI.SummaryRunning.Group; - this.xrLabel2.Summary = xrSummary4; - this.xrLabel2.Text = "xrLabel2"; - this.xrLabel2.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; - this.xrLabel2.TextFormatString = "Products Count: {0}"; - // - // ReportHeader - // - this.ReportHeader.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { - this.xrTableOfContents1}); - this.ReportHeader.Dpi = 96F; - this.ReportHeader.HeightF = 108.08F; - this.ReportHeader.Name = "ReportHeader"; - // - // xrTableOfContents1 - // - this.xrTableOfContents1.Dpi = 96F; - this.xrTableOfContents1.LevelDefault.Height = 22.08F; - this.xrTableOfContents1.LevelDefault.Padding = new DevExpress.XtraPrinting.PaddingInfo(0F, 0F, 0F, 0F, 96F); - xrTableOfContentsLevel3.Font = new DevExpress.Drawing.DXFont("Segoe UI", 10F); - xrTableOfContentsLevel3.Padding = new DevExpress.XtraPrinting.PaddingInfo(0F, 0F, 0F, 0F, 96F); - xrTableOfContentsLevel4.Font = new DevExpress.Drawing.DXFont("Segoe UI", 9F); - xrTableOfContentsLevel4.Indent = 30F; - xrTableOfContentsLevel4.Padding = new DevExpress.XtraPrinting.PaddingInfo(0F, 0F, 0F, 0F, 96F); - this.xrTableOfContents1.Levels.Add(xrTableOfContentsLevel3); - this.xrTableOfContents1.Levels.Add(xrTableOfContentsLevel4); - this.xrTableOfContents1.LevelTitle.Font = new DevExpress.Drawing.DXFont("Segoe UI", 22F); - this.xrTableOfContents1.LevelTitle.Height = 40F; - this.xrTableOfContents1.LevelTitle.Padding = new DevExpress.XtraPrinting.PaddingInfo(0F, 0F, 0F, 0F, 96F); - this.xrTableOfContents1.LevelTitle.Text = "Details for Customer Order"; - this.xrTableOfContents1.LevelTitle.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter; - this.xrTableOfContents1.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F); - this.xrTableOfContents1.Name = "xrTableOfContents1"; - // - // TestReport - // - this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] { - this.Detail, - this.TopMargin, - this.BottomMargin, - this.GroupHeader1, - this.groupHeaderBand1, - this.groupFooterBand1, - this.ReportHeader}); - this.Bookmark = "Details for Customer Order"; - this.CalculatedFields.AddRange(new DevExpress.XtraReports.UI.CalculatedField[] { - this.isRegularPriceProduct}); - this.ComponentStorage.AddRange(new System.ComponentModel.IComponent[] { - this.sqlDataSource1}); - this.DataMember = "OrderDetailsExtended"; - this.DataSource = this.sqlDataSource1; - this.Dpi = 96F; - this.FilterString = "[OrderID] = ?orderID"; - this.Margins = new DevExpress.Drawing.DXMargins(72F, 72F, 72F, 72F); - this.PageHeightF = 1056F; - this.PageWidthF = 816F; - this.Parameters.AddRange(new DevExpress.XtraReports.Parameters.Parameter[] { - this.orderID}); - this.ReportUnit = DevExpress.XtraReports.UI.ReportUnit.Pixels; - this.SnapGridSize = 12.5F; - this.StyleSheet.AddRange(new DevExpress.XtraReports.UI.XRControlStyle[] { - this.HeaderStyle, - this.OddStyle, - this.EvenStyle}); - this.Version = "25.2"; - ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); - - } - - #endregion - - private DevExpress.XtraReports.UI.DetailBand Detail; - private DevExpress.XtraReports.UI.TopMarginBand TopMargin; - private DevExpress.XtraReports.UI.BottomMarginBand BottomMargin; - private DevExpress.DataAccess.Sql.SqlDataSource sqlDataSource1; - private DevExpress.XtraReports.UI.XRTable xrTable1; - private DevExpress.XtraReports.UI.XRTableRow xrTableRow1; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell1; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell2; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell3; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell4; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell5; - private DevExpress.XtraReports.UI.XRTableRow xrTableRow2; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell6; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell7; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell8; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell9; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell10; - private DevExpress.XtraReports.UI.GroupHeaderBand GroupHeader1; - private DevExpress.XtraReports.UI.XRTable xrTable2; - private DevExpress.XtraReports.UI.XRTableRow xrTableRow3; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell11; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell12; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell13; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell14; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell15; - private DevExpress.XtraReports.Parameters.Parameter orderID; - private DevExpress.XtraReports.UI.XRLabel he; - private DevExpress.XtraReports.UI.XRControlStyle HeaderStyle; - private DevExpress.XtraReports.UI.XRControlStyle OddStyle; - private DevExpress.XtraReports.UI.XRControlStyle EvenStyle; - private DevExpress.XtraReports.UI.CalculatedField isRegularPriceProduct; - private DevExpress.XtraReports.UI.GroupHeaderBand groupHeaderBand1; - private DevExpress.XtraReports.UI.XRLabel xrLabel1; - private DevExpress.XtraReports.UI.GroupFooterBand groupFooterBand1; - private DevExpress.XtraReports.UI.XRLabel xrLabel3; - private DevExpress.XtraReports.UI.XRLabel xrLabel2; - private DevExpress.XtraReports.UI.XRPageInfo xrPageInfo1; - private DevExpress.XtraReports.UI.XRPageInfo xrPageInfo2; - private DevExpress.XtraReports.UI.ReportHeaderBand ReportHeader; - private DevExpress.XtraReports.UI.XRTableOfContents xrTableOfContents1; - } -} diff --git a/TestDevExpress/Components/Reports/TestReport.cs b/TestDevExpress/Components/Reports/TestReport.cs deleted file mode 100644 index 42cebaf..0000000 --- a/TestDevExpress/Components/Reports/TestReport.cs +++ /dev/null @@ -1,16 +0,0 @@ -using DevExpress.XtraReports.UI; -using System; -using System.Collections; -using System.ComponentModel; -using System.Drawing; - -namespace TestDevExpress.Components.Pages -{ - public partial class TestReport : DevExpress.XtraReports.UI.XtraReport - { - public TestReport() - { - InitializeComponent(); - } - } -} diff --git a/TestDevExpress/Components/Reports/TestReport.resx b/TestDevExpress/Components/Reports/TestReport.resx deleted file mode 100644 index 1b3543a..0000000 --- a/TestDevExpress/Components/Reports/TestReport.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - PERhdGFTZXQgTmFtZT0ic3FsRGF0YVNvdXJjZTEiPjxWaWV3IE5hbWU9Ik9yZGVyRGV0YWlsc0V4dGVuZGVkIj48RmllbGQgTmFtZT0iT3JkZXJJRCIgVHlwZT0iSW50NjQiIC8+PEZpZWxkIE5hbWU9IlByb2R1Y3RJRCIgVHlwZT0iSW50NjQiIC8+PEZpZWxkIE5hbWU9IlByb2R1Y3ROYW1lIiBUeXBlPSJTdHJpbmciIC8+PEZpZWxkIE5hbWU9IlVuaXRQcmljZSIgVHlwZT0iRGVjaW1hbCIgLz48RmllbGQgTmFtZT0iUXVhbnRpdHkiIFR5cGU9IkludDE2IiAvPjxGaWVsZCBOYW1lPSJEaXNjb3VudCIgVHlwZT0iRG91YmxlIiAvPjxGaWVsZCBOYW1lPSJFeHRlbmRlZFByaWNlIiBUeXBlPSJVbmtub3duIiAvPjxGaWVsZCBOYW1lPSJTdXBwbGllciIgVHlwZT0iVW5rbm93biIgLz48L1ZpZXc+PC9EYXRhU2V0Pg== - - \ No newline at end of file diff --git a/TestDevExpress/Program.cs b/TestDevExpress/Program.cs index b1151f0..b25aaf5 100644 --- a/TestDevExpress/Program.cs +++ b/TestDevExpress/Program.cs @@ -1,4 +1,5 @@ using DevExpress.Blazor.Reporting; +using DevExpress.XtraReports.Services; using DevExpress.XtraReports.Web.Extensions; using Microsoft.AspNetCore.Localization; using System.Globalization; @@ -30,8 +31,9 @@ builder.WebHost.UseStaticWebAssets(); builder.Services.AddScoped(); +builder.Services.AddScoped(); + var app = builder.Build(); -app.UseDevExpressBlazorReporting(); // Configure the HTTP request pipeline. if (!app.Environment.IsDevelopment()) @@ -45,6 +47,7 @@ app.UseAntiforgery(); app.MapRazorComponents() .AddInteractiveServerRenderMode(); +app.UseDevExpressBlazorReporting(); // cultura IT... var supportedCultures = new[]{ new CultureInfo("it-IT") diff --git a/TestDevExpress/Reports/TestReport1.repx b/TestDevExpress/Reports/TestReport1.repx new file mode 100644 index 0000000..86842fd --- /dev/null +++ b/TestDevExpress/Reports/TestReport1.repx @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/TestDevExpress/Services/CustomReportStorageWebExtension.cs b/TestDevExpress/Services/CustomReportStorageWebExtension.cs new file mode 100644 index 0000000..483209c --- /dev/null +++ b/TestDevExpress/Services/CustomReportStorageWebExtension.cs @@ -0,0 +1,73 @@ +using System; +using Microsoft.AspNetCore.Hosting; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using DevExpress.XtraReports.UI; +using DevExpress.XtraReports.Web.Extensions; +using System.Web; + +namespace TestDevExpress.Services +{ + public class CustomReportStorageWebExtension:ReportStorageWebExtension + { + + public override byte[] GetData(string url) + { + string ReportDirectory = "Reports"; + try + { + // Parse the string with the report name and parameter values. + string[] parts = url.Split('?'); + string reportName = parts[0]; + string parametersQueryString = parts.Length > 1 ? parts[1] : String.Empty; + + // Create a report instance. + XtraReport report = null; + + if (Directory.EnumerateFiles(ReportDirectory). + Select(Path.GetFileNameWithoutExtension).Contains(reportName)) + { + byte[] reportBytes = File.ReadAllBytes(Path.Combine(ReportDirectory, reportName + "repx")); + using (MemoryStream ms = new MemoryStream(reportBytes)) + report = XtraReport.FromStream(ms); + } + + if (report != null) + { + // Apply the parameter values to the report. + var parameters = HttpUtility.ParseQueryString(parametersQueryString); + + foreach (string parameterName in parameters.AllKeys) + { + report.Parameters[parameterName].Value = Convert.ChangeType( + parameters.Get(parameterName), report.Parameters[parameterName].Type); + } + + // Disable the Visible property for all report parameters + // to hide the Parameters Panel in the viewer. + foreach (var parameter in report.Parameters) + { + parameter.Visible = false; + } + + // If you do not hide the panel, disable the report's RequestParameters property. + // report.RequestParameters = false; + + using (MemoryStream ms = new MemoryStream()) + { + report.SaveLayoutToXml(ms); + return ms.ToArray(); + } + } + } + catch (Exception ex) + { + throw new DevExpress.XtraReports.Web.ClientControls.FaultException( + "Could not get report data.", ex); + } + throw new DevExpress.XtraReports.Web.ClientControls.FaultException( + string.Format("Could not find report '{0}'.", url)); + } + } +} diff --git a/TestDevExpress/Services/MyReportProvider.cs b/TestDevExpress/Services/MyReportProvider.cs new file mode 100644 index 0000000..5b2acf4 --- /dev/null +++ b/TestDevExpress/Services/MyReportProvider.cs @@ -0,0 +1,63 @@ +using DevExpress.Blazor.Reporting; +using DevExpress.DataAccess; +using DevExpress.DataAccess.Json; +using DevExpress.Drawing.Internal.Fonts.Interop; +using DevExpress.Security; +using DevExpress.XtraPrinting.Native.Properties; +using DevExpress.XtraReports; +using DevExpress.XtraReports.Services; +using DevExpress.XtraReports.UI; +using DevExpress.XtraReports.Web.ReportDesigner.Native; +using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.WebUtilities; +using System; +using System.Web; +using TestDevExpress.Components.Reports; + +public class MyReportProvider : IReportProvider +{ + public XtraReport GetReport(string id, ReportProviderContext context) + { + // Parse the string with the report name and parameter values. + string[] parts = id.Split('?'); + string reportName = parts[0]; + string parametersQueryString = parts.Length > 1 ? parts[2] : String.Empty; + var par = parametersQueryString.Split('&'); + List valueParList = new(); + for (int i = 0; i < par.Length; i++) + { + valueParList.Add(par[i].Split('=')[1]); + } + //var parameters = HttpUtility.ParseQueryString(parametersQueryString); + string urlImg = valueParList[1]; + string url = parts[1].Split('=')[1] + "/" + valueParList[0]; + // Create a report instance. + XtraReport report = null; + if (reportName == "TestReport1") + report = new OfferReport(urlImg, int.Parse(valueParList[0])); + else + { + throw new DevExpress.XtraReports.Web.ClientControls.FaultException( + string.Format("Could not find report '{0}'.", reportName) + ); + } + string reportFolder = "Reports"; + if (Directory.EnumerateFiles(reportFolder). + Select(Path.GetFileNameWithoutExtension).Contains(reportName)) + { + byte[] reportBytes = File.ReadAllBytes(Path.Combine(reportFolder, reportName + ".repx")); + using (MemoryStream ms = new MemoryStream(reportBytes)) + report = XtraReport.FromXmlStream(ms); + } + report.Parameters["pOfferId"].Value = valueParList[0]; + report.Parameters["pImgPath"].Value = valueParList[1]; + var jsonDataSource = report.DataSource as JsonDataSource; + if (jsonDataSource != null) + { + jsonDataSource.JsonSource = new UriJsonSource(new Uri(url)); + jsonDataSource.ConnectionName = null; + //RequestParameters = false; + } + return report; + } +} \ No newline at end of file diff --git a/TestDevExpress/appsettings.json b/TestDevExpress/appsettings.json index aa79824..ecbaadf 100644 --- a/TestDevExpress/appsettings.json +++ b/TestDevExpress/appsettings.json @@ -1,4 +1,5 @@ { + "DetailedErrors": true, "Logging": { "LogLevel": { "Default": "Information",