diff --git a/global.json b/global.json new file mode 100644 index 0000000..30fb034 --- /dev/null +++ b/global.json @@ -0,0 +1,6 @@ +{ + "projects": [ + "src", + "test" + ] +} diff --git a/src/DoddleReport.AbcPdf/DoddleReport.AbcPdf.csproj b/src/DoddleReport.AbcPdf/DoddleReport.AbcPdf.csproj index 9664216..a378ad2 100644 --- a/src/DoddleReport.AbcPdf/DoddleReport.AbcPdf.csproj +++ b/src/DoddleReport.AbcPdf/DoddleReport.AbcPdf.csproj @@ -1,135 +1,20 @@ - - + + - Debug - AnyCPU - 9.0.30729 - 2.0 - {355CAFF3-F806-4194-BE54-2F7640463CED} - Library - Properties - DoddleReport.AbcPdf - DoddleReport.AbcPdf - v4.0 - 512 - - - - - - - - - - - 3.5 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - + netstandard2.0 + 2.0 + Adds ABCpdf support to DoddleReport. Requires an ABCpdf license to work properly + doddle.report doddle.reporting doddle reporting pdf excel csv abcpdf + https://github.com/matthidinger/DoddleReport + Matt Hidinger - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - bin\Release\DoddleReport.AbcPdf.XML - - - false - - - - - - - - ..\packages\ABCpdf.9.0.0.5\lib\net20\ABCpdf.dll - True - - - - 3.5 - - - - 3.5 - - - 3.5 - - - - - - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - + - - - Designer - - + + - - {F08B2994-4D05-423E-A8FE-7D1E8A63472B} - DoddleReport - + - - - \ No newline at end of file + + diff --git a/src/DoddleReport.AbcPdf/DoddleReport.AbcPdf.nuspec b/src/DoddleReport.AbcPdf/DoddleReport.AbcPdf.nuspec deleted file mode 100644 index 5bb6cf4..0000000 --- a/src/DoddleReport.AbcPdf/DoddleReport.AbcPdf.nuspec +++ /dev/null @@ -1,20 +0,0 @@ - - - - $id$ - $version$ - $id$ - $description$ - $author$ - $author$ - https://github.com/matthidinger/DoddleReport - false - doddle.report doddle.reporting doddle reporting pdf excel csv abcpdf - - - - - - - - \ No newline at end of file diff --git a/src/DoddleReport.AbcPdf/PDFTable.cs b/src/DoddleReport.AbcPdf/PDFTable.cs index 2168a02..425b734 100644 --- a/src/DoddleReport.AbcPdf/PDFTable.cs +++ b/src/DoddleReport.AbcPdf/PDFTable.cs @@ -6,7 +6,7 @@ using System.Drawing; using System.Collections; using System.Globalization; -using WebSupergoo.ABCpdf7; +using WebSupergoo.ABCpdf10; namespace DoddleReport.AbcPdf { @@ -742,7 +742,7 @@ public int AddImage(XImage inImage, bool inStretch) mDoc.Rect.Bottom = mDoc.Rect.Top - inImage.Height * scale; PagePos thePos = new PagePos(this); - id = mDoc.AddImage(inImage); + id = mDoc.AddImageObject(inImage); thePos -= inImage.Height * scale; if (thePos < RowBottom) RowBottom = thePos; SaveRowObject(id, inImage); diff --git a/src/DoddleReport.AbcPdf/PdfDocument.cs b/src/DoddleReport.AbcPdf/PdfDocument.cs index 6049434..a6ce5ee 100644 --- a/src/DoddleReport.AbcPdf/PdfDocument.cs +++ b/src/DoddleReport.AbcPdf/PdfDocument.cs @@ -1,5 +1,5 @@ using System.IO; -using WebSupergoo.ABCpdf7; +using WebSupergoo.ABCpdf10; namespace DoddleReport.AbcPdf { diff --git a/src/DoddleReport.AbcPdf/PdfReportWriter.cs b/src/DoddleReport.AbcPdf/PdfReportWriter.cs index 3955ae2..0c5231d 100644 --- a/src/DoddleReport.AbcPdf/PdfReportWriter.cs +++ b/src/DoddleReport.AbcPdf/PdfReportWriter.cs @@ -1,7 +1,7 @@ using System; using System.Linq; using System.IO; -using WebSupergoo.ABCpdf7; +using WebSupergoo.ABCpdf10; namespace DoddleReport.AbcPdf { diff --git a/src/DoddleReport.AbcPdf/Properties/AssemblyInfo.cs b/src/DoddleReport.AbcPdf/Properties/AssemblyInfo.cs deleted file mode 100644 index 5760dea..0000000 --- a/src/DoddleReport.AbcPdf/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("DoddleReport.AbcPdf")] -[assembly: AssemblyDescription("Adds ABCpdf support to DoddleReport. Requires an ABCpdf license to work properly")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Matt Hidinger")] -[assembly: AssemblyProduct("DoddleReport.AbcPdf")] -[assembly: AssemblyCopyright("Copyright © 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("03fd366c-8b20-4360-9c11-f59ede91f277")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.5.2.0")] diff --git a/src/DoddleReport.AbcPdf/packages.config b/src/DoddleReport.AbcPdf/packages.config deleted file mode 100644 index 8e2e03d..0000000 --- a/src/DoddleReport.AbcPdf/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/DoddleReport.OpenXml/DoddleReport.OpenXml.csproj b/src/DoddleReport.OpenXml/DoddleReport.OpenXml.csproj index 332751f..f5e9249 100644 --- a/src/DoddleReport.OpenXml/DoddleReport.OpenXml.csproj +++ b/src/DoddleReport.OpenXml/DoddleReport.OpenXml.csproj @@ -1,89 +1,20 @@ - - + + - Debug - AnyCPU - 8.0.30703 - 2.0 - {0646C575-0EA6-4331-809C-10DC000929F3} - Library - Properties - DoddleReport.OpenXml - DoddleReport.OpenXml - v4.0 - 512 - - - ..\ + netstandard2.0 + 2.0 + Adds OpenXML support to DoddleReport. The currently supported format is Excel and is more robust than the default ExcelReportWriter in DoddleReport. + doddle.report doddle.reporting doddle reporting pdf excel csv openxml + https://github.com/matthidinger/DoddleReport + Matt Hidinger - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\DoddleReport.OpenXml.XML - - - false - - - - - - - - False - ..\packages\ClosedXML.0.68.1\lib\net40-client\ClosedXML.dll - - - True - ..\packages\DocumentFormat.OpenXml.1.0\lib\DocumentFormat.OpenXml.dll - - - - - - - - - - - - - - - - + - - Designer - - - + + - - {F08B2994-4D05-423E-A8FE-7D1E8A63472B} - DoddleReport - + - - - \ No newline at end of file + + diff --git a/src/DoddleReport.OpenXml/DoddleReport.OpenXml.nuspec b/src/DoddleReport.OpenXml/DoddleReport.OpenXml.nuspec deleted file mode 100644 index 757ddfc..0000000 --- a/src/DoddleReport.OpenXml/DoddleReport.OpenXml.nuspec +++ /dev/null @@ -1,20 +0,0 @@ - - - - $id$ - $version$ - $id$ - $description$ - $author$ - $author$ - https://github.com/matthidinger/DoddleReport - false - doddle.report doddle.reporting doddle reporting pdf excel csv openxml - - - - - - - - \ No newline at end of file diff --git a/src/DoddleReport.OpenXml/ExcelReportWriter.cs b/src/DoddleReport.OpenXml/ExcelReportWriter.cs index 20a4334..e30486c 100644 --- a/src/DoddleReport.OpenXml/ExcelReportWriter.cs +++ b/src/DoddleReport.OpenXml/ExcelReportWriter.cs @@ -3,6 +3,7 @@ using System.Globalization; using System.IO; using System.Linq; +using System.Reflection; using ClosedXML.Excel; namespace DoddleReport.OpenXml @@ -179,7 +180,7 @@ protected virtual void RenderRow(int rowCount, ReportRow reportRow, IXLRow dataR cell.SetDataType(XLCellValues.Boolean); cell.Value = reportRow[field]; } - else if (field.DataType.IsNumericType()) + else if (field.DataType.GetTypeInfo().IsNumber()) { cell.SetDataType(XLCellValues.Number); if (!string.Equals("{0}", field.DataFormatString)) diff --git a/src/DoddleReport.OpenXml/Extensions.cs b/src/DoddleReport.OpenXml/Extensions.cs index 5b0a7ba..db1e1ad 100644 --- a/src/DoddleReport.OpenXml/Extensions.cs +++ b/src/DoddleReport.OpenXml/Extensions.cs @@ -2,7 +2,6 @@ using System.Drawing; using System.IO; using System.Linq; -using System.Windows.Forms; using ClosedXML.Excel; namespace DoddleReport.OpenXml @@ -72,16 +71,18 @@ public static void CopyToXlStyle(this ReportStyle reportStyle, IXLStyle xlStyle) /// public static double PixelsToUnits(this int pixels, IXLFont xlFont) { + // TODO: This doesn't work in NETStandard, need to find a workaround + throw new PlatformNotSupportedException(); if (pixels < 5) { pixels = 5; } - var fontSize = (float)xlFont.FontSize; - var font = new Font(xlFont.FontName, fontSize, FontStyle.Regular); - int underscoreWidth = TextRenderer.MeasureText("__", font).Width; - double maxDigitWidth = Digits.Select(d => TextRenderer.MeasureText("_" + d + "_", font).Width - underscoreWidth).Max(); - return Math.Truncate((pixels - 5) / maxDigitWidth * 100 + 0.5) / 100; + //var fontSize = (float)xlFont.FontSize; + //var font = new Font(xlFont.FontName, fontSize, FontStyle.Regular); + //int underscoreWidth = TextRenderer.MeasureText("__", font).Width; + //double maxDigitWidth = Digits.Select(d => TextRenderer.MeasureText("_" + d + "_", font).Width - underscoreWidth).Max(); + //return Math.Truncate((pixels - 5) / maxDigitWidth * 100 + 0.5) / 100; } #endregion diff --git a/src/DoddleReport.OpenXml/Program.cs b/src/DoddleReport.OpenXml/Program.cs new file mode 100644 index 0000000..fff67cc --- /dev/null +++ b/src/DoddleReport.OpenXml/Program.cs @@ -0,0 +1,12 @@ +using System; + +namespace DoddleReport.OpenXml +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Hello World!"); + } + } +} diff --git a/src/DoddleReport.OpenXml/Properties/AssemblyInfo.cs b/src/DoddleReport.OpenXml/Properties/AssemblyInfo.cs deleted file mode 100644 index 814aee8..0000000 --- a/src/DoddleReport.OpenXml/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("DoddleReport.OpenXml")] -[assembly: AssemblyDescription("Adds OpenXML support to DoddleReport. The currently supported format is Excel and is more robust than the default ExcelReportWriter in DoddleReport.")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Matt Hidinger")] -[assembly: AssemblyProduct("DoddleReport.OpenXml")] -[assembly: AssemblyCopyright("Copyright © 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("c01a6fb8-3791-4875-a948-5f23e00d3b13")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.5.2.0")] diff --git a/src/DoddleReport.OpenXml/packages.config b/src/DoddleReport.OpenXml/packages.config deleted file mode 100644 index e93045d..0000000 --- a/src/DoddleReport.OpenXml/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/DoddleReport.Sample.AspnetCore/Controllers/HomeController.cs b/src/DoddleReport.Sample.AspnetCore/Controllers/HomeController.cs new file mode 100644 index 0000000..2d62557 --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/Controllers/HomeController.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using DoddleReport.Sample.AspnetCore.Models; + +namespace DoddleReport.Sample.AspnetCore.Controllers +{ + public class HomeController : Controller + { + public IActionResult Index() + { + return View(); + } + + public IActionResult About() + { + ViewData["Message"] = "Your application description page."; + + return View(); + } + + public IActionResult Contact() + { + ViewData["Message"] = "Your contact page."; + + return View(); + } + + public IActionResult Error() + { + return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); + } + } +} diff --git a/src/DoddleReport.Sample.AspnetCore/Controllers/ReportController.cs b/src/DoddleReport.Sample.AspnetCore/Controllers/ReportController.cs new file mode 100644 index 0000000..3c9ea7b --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/Controllers/ReportController.cs @@ -0,0 +1,91 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Threading.Tasks; +using DoddleReport.Sample.Web.Models; +using Microsoft.AspNetCore.Mvc; + +namespace DoddleReport.Sample.AspnetCore.Controllers +{ + public class ReportController : Controller + { + public IActionResult Index() + { + // Get the data for the report (any IEnumerable will work) + var query = DoddleProductRepository.GetAll(); + var totalProducts = query.Count; + var totalOrders = query.Sum(p => p.OrderCount); + + // Create the report and turn our query into a ReportSource + var report = new Report(query.ToReportSource()); + + + // Customize the Text Fields + report.TextFields.Title = "Products Report"; + report.TextFields.SubTitle = "This is a sample report showing how Doddle Report works"; + report.TextFields.Footer = "Copyright 2011 (c) The Doddle Project"; + report.TextFields.Header = string.Format(@" + Report Generated: {0} + Total Products: {1} + Total Orders: {2} + Total Sales: {3:c}", DateTime.Now, totalProducts, totalOrders, totalProducts * totalOrders); + + + // Render hints allow you to pass additional hints to the reports as they are being rendered + report.RenderHints.BooleanCheckboxes = true; + report.RenderHints.BooleansAsYesNo = true; + report.RenderHints.FreezeRows = 9; + report.RenderHints.FreezeColumns = 2; + + // Some writers (like PDF) support Orientation and page sizing + //report.RenderHints.Orientation = ReportOrientation.Landscape; + //report.RenderHints.PageSize = new SizeF(8.5f * 72f, 14f * 72f); //US Legal paper size + //report.RenderHints.PageSize = new SizeF(595.28f, 841.89f); //A4 paper size + //report.RenderHints.PageSize = new SizeF(842f, 1191f); //A3 paper size + + + // Customize the data fields + report.DataFields["Id"].Hidden = true; + report.DataFields["Price"].DataFormatString = "{0:c}"; + report.DataFields["Price"].ShowTotals = true; + report.DataFields["LastPurchase"].DataFormatString = "{0:d}"; + + // Assign a delegate to generate a string that will be used as the href attribute + // for a link in the given field, specific to the dataitem for that row. + // Some literal or constant is necessary for the root url if you want Excel + // navigable links in any writer that doesn't render in the context of the + // given web project (e.g. excel or pdf) + report.DataFields["Name"].Url(p => Url.Action("Index", "Products", new { p.Id }, "http")); + + // Advanced customized on a row-by-row basis + report.RenderingRow += report_RenderingRow; + + + return new ReportResult(report); + } + + void report_RenderingRow(object sender, ReportRowEventArgs e) + { + switch (e.Row.RowType) + { + case ReportRowType.HeaderRow: + e.Row.Fields["LastPurchase"].HeaderStyle.TextRotation = -90; + e.Row.Fields["UnitsInStock"].HeaderStyle.TextRotation = -90; + e.Row.Fields["LowStock"].HeaderStyle.TextRotation = -90; + break; + case ReportRowType.DataRow: + { + var unitsInStock = (int)e.Row["UnitsInStock"]; + if (unitsInStock < 100) + { + e.Row.Fields["UnitsInStock"].DataStyle.Bold = true; + e.Row.Fields["UnitsInStock"].DataStyle.ForeColor = Color.Maroon; + } + } + break; + } + } + + } +} \ No newline at end of file diff --git a/src/DoddleReport.Sample.AspnetCore/DoddleReport.Sample.AspnetCore.csproj b/src/DoddleReport.Sample.AspnetCore/DoddleReport.Sample.AspnetCore.csproj new file mode 100644 index 0000000..1c69f4c --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/DoddleReport.Sample.AspnetCore.csproj @@ -0,0 +1,21 @@ + + + + netcoreapp2.0 + + + + + + + + + + + + + + + + + diff --git a/src/DoddleReport.Sample.AspnetCore/Helpers/ProductReportHelper.cs b/src/DoddleReport.Sample.AspnetCore/Helpers/ProductReportHelper.cs new file mode 100644 index 0000000..5ff95fe --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/Helpers/ProductReportHelper.cs @@ -0,0 +1,47 @@ +using System; +using System.Linq; +using DoddleReport.Sample.Web.Models; + +namespace DoddleReport.Sample.Web.Helpers +{ + public static class ProductReportHelper + { + public static Report GetProductReport() + { + // Get the data for the report (any IEnumerable will work) + var query = DoddleProductRepository.GetAll(); + var totalProducts = query.Count; + var totalOrders = query.Sum(p => p.OrderCount); + + + // Create the report and turn our query into a ReportSource + var report = new Report(query.ToReportSource()); + + + // Customize the Text Fields + report.TextFields.Title = "Products Report"; + report.TextFields.SubTitle = "This is a sample report showing how Doddle Report works"; + report.TextFields.Footer = "Copyright 2011 (c) The Doddle Project"; + report.TextFields.Header = string.Format(@" + Report Generated: {0} + Total Products: {1} + Total Orders: {2} + Total Sales: {3:c}", DateTime.Now, totalProducts, totalOrders, totalProducts * totalOrders); + + + // Render hints allow you to pass additional hints to the reports as they are being rendered + report.RenderHints.BooleanCheckboxes = true; + report.RenderHints.BooleansAsYesNo = true; + //report.RenderHints.Orientation = ReportOrientation.Landscape; + + + // Customize the data fields + report.DataFields["Id"].Hidden = true; + report.DataFields["Price"].DataFormatString = "{0:c}"; + report.DataFields["Price"].ShowTotals = true; + report.DataFields["LastPurchase"].DataFormatString = "{0:d}"; + + return report; + } + } +} \ No newline at end of file diff --git a/src/DoddleReport.Sample.AspnetCore/Models/DoddleProductRepository.cs b/src/DoddleReport.Sample.AspnetCore/Models/DoddleProductRepository.cs new file mode 100644 index 0000000..251e7d2 --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/Models/DoddleProductRepository.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using System.Dynamic; +using System.Linq; + +namespace DoddleReport.Sample.Web.Models +{ + public class Product + { + public int Id { get; set; } + public string Name { get; set; } + public string Description { get; set; } + public double Price { get; set; } + public int OrderCount { get; set; } + public DateTime? LastPurchase { get; set; } + public int UnitsInStock { get; set; } + public bool? LowStock + { + get { return UnitsInStock < 300; } + } + } + + public static class DoddleProductRepository + { + public static List GetAll() + { + var rand = new Random(); + return Enumerable.Range(1, 200) + .Select(i => new Product + { + Id = i, + Name = "Product" + i, + Description = + "This is an example description showing long text in some of the items. Here is some UTF text €", + Price = rand.NextDouble()*100, + OrderCount = rand.Next(1000), + LastPurchase = DateTime.Now.AddDays(rand.Next(1000)), + UnitsInStock = rand.Next(0, 1000) + }) + .ToList(); + } + + public static IEnumerable GetAllExpando() + { + foreach(var product in GetAll()) + { + dynamic item = new ExpandoObject(); + + item.Id = product.Id; + item.Name = product.Name; + item.Description = product.Description + " (dynamic)"; + item.Price = product.Price; + item.OrderCount = product.OrderCount; + item.LastPuchase = product.LastPurchase; + item.UnitsInStock = product.UnitsInStock; + item.LowStock = product.LowStock; + + yield return item; + } + } + } +} \ No newline at end of file diff --git a/src/DoddleReport.Sample.AspnetCore/Models/ErrorViewModel.cs b/src/DoddleReport.Sample.AspnetCore/Models/ErrorViewModel.cs new file mode 100644 index 0000000..44bb894 --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/Models/ErrorViewModel.cs @@ -0,0 +1,11 @@ +using System; + +namespace DoddleReport.Sample.AspnetCore.Models +{ + public class ErrorViewModel + { + public string RequestId { get; set; } + + public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); + } +} \ No newline at end of file diff --git a/src/DoddleReport.Sample.AspnetCore/Program.cs b/src/DoddleReport.Sample.AspnetCore/Program.cs new file mode 100644 index 0000000..f45df55 --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/Program.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Logging; + +namespace DoddleReport.Sample.AspnetCore +{ + public class Program + { + public static void Main(string[] args) + { + BuildWebHost(args).Run(); + } + + public static IWebHost BuildWebHost(string[] args) => + WebHost.CreateDefaultBuilder(args) + .UseStartup() + .Build(); + } +} diff --git a/src/DoddleReport.Sample.AspnetCore/Properties/launchSettings.json b/src/DoddleReport.Sample.AspnetCore/Properties/launchSettings.json new file mode 100644 index 0000000..ccd59de --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:53241/", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "DoddleReport.Sample.AspnetCore": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "http://localhost:53242/" + } + } +} diff --git a/src/DoddleReport.Sample.AspnetCore/ReportResult.cs b/src/DoddleReport.Sample.AspnetCore/ReportResult.cs new file mode 100644 index 0000000..4288676 --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/ReportResult.cs @@ -0,0 +1,57 @@ +using DoddleReport.iTextSharp; +using Microsoft.AspNetCore.Mvc; + +namespace DoddleReport.Sample.AspnetCore +{ + public class ReportResult : ActionResult + { + private readonly Report _report; + private IReportWriter _writer; + private readonly string _contentType; + + /// + /// This property is optional. + /// If you don't specify a FileName then the name of the ActionResult being executed will be used. + /// If you do specify a FileName, you may omit the file extension. If the file extension is omitted then DoddleReport will attempt to get the extension from the URL being requested + /// + public string FileName { get; set; } + + + public ReportResult(Report report) : this(report, report.Writer) + { } + + public ReportResult(Report report, IReportWriter writer, string contentType = null) + { + _report = report; + _writer = writer; + _contentType = contentType; + } + + public override void ExecuteResult(ActionContext context) + { + var response = context.HttpContext.Response; + + if (_writer == null) + { + //var writerConfig = GetWriterFromExtension(context, defaultExtension); + //response.ContentType = writerConfig.ContentType; + //_writer = writerConfig.LoadWriter(); + _writer = new PdfReportWriter(); + } + else + { + response.ContentType = _contentType; + } + + if (!string.IsNullOrEmpty(FileName)) + { + //var extension = GetDownloadFileExtension(context.HttpContext.Request, defaultExtension); + var extension = ".pdf"; + response.Headers["content-disposition"] = string.Format("attachment; filename={0}{1}", FileName, extension); + } + + //response.RegisterForDispose() + _writer.WriteReport(_report, response.Body); + } + } +} \ No newline at end of file diff --git a/src/DoddleReport.Sample.AspnetCore/ReportRouteConstraint.cs b/src/DoddleReport.Sample.AspnetCore/ReportRouteConstraint.cs new file mode 100644 index 0000000..534bfc8 --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/ReportRouteConstraint.cs @@ -0,0 +1,25 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Routing; + +namespace DoddleReport.Sample.AspnetCore +{ + public class ReportRouteConstraint : IRouteConstraint + { + + public bool Match(HttpContext httpContext, IRouter route, string routeKey, RouteValueDictionary values, RouteDirection routeDirection) + { + if (routeDirection == RouteDirection.UrlGeneration) + { + return true; + } + + + return false; + // TODO: implement ReportRoute + //var configuredExtensions = Config.Report.Writers.OfType().Select(e => e.FileExtension).ToList(); + + //var requestExtension = Path.GetExtension(httpContext.Request.Url.AbsolutePath); + //return configuredExtensions.Contains(requestExtension, StringComparer.InvariantCultureIgnoreCase); + } + } +} \ No newline at end of file diff --git a/src/DoddleReport.Sample.AspnetCore/Startup.cs b/src/DoddleReport.Sample.AspnetCore/Startup.cs new file mode 100644 index 0000000..ed7996e --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/Startup.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using DoddleReport; + +namespace DoddleReport.Sample.AspnetCore +{ + public class Startup + { + public Startup(IConfiguration configuration) + { + Configuration = configuration; + } + + public IConfiguration Configuration { get; } + + // This method gets called by the runtime. Use this method to add services to the container. + public void ConfigureServices(IServiceCollection services) + { + services.AddMvc(); + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IHostingEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + app.UseBrowserLink(); + } + else + { + app.UseExceptionHandler("/Home/Error"); + } + + app.UseStaticFiles(); + + app.UseMvc(routes => + { + routes.MapRoute( + name: "default", + template: "{controller=Home}/{action=Index}/{id?}"); + }); + } + } +} diff --git a/src/DoddleReport.Sample.AspnetCore/Views/Home/About.cshtml b/src/DoddleReport.Sample.AspnetCore/Views/Home/About.cshtml new file mode 100644 index 0000000..3674e37 --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/Views/Home/About.cshtml @@ -0,0 +1,7 @@ +@{ + ViewData["Title"] = "About"; +} +

@ViewData["Title"]

+

@ViewData["Message"]

+ +

Use this area to provide additional information.

diff --git a/src/DoddleReport.Sample.AspnetCore/Views/Home/Contact.cshtml b/src/DoddleReport.Sample.AspnetCore/Views/Home/Contact.cshtml new file mode 100644 index 0000000..a11a186 --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/Views/Home/Contact.cshtml @@ -0,0 +1,17 @@ +@{ + ViewData["Title"] = "Contact"; +} +

@ViewData["Title"]

+

@ViewData["Message"]

+ +
+ One Microsoft Way
+ Redmond, WA 98052-6399
+ P: + 425.555.0100 +
+ +
+ Support: Support@example.com
+ Marketing: Marketing@example.com +
diff --git a/src/DoddleReport.Sample.AspnetCore/Views/Home/Index.cshtml b/src/DoddleReport.Sample.AspnetCore/Views/Home/Index.cshtml new file mode 100644 index 0000000..f804781 --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/Views/Home/Index.cshtml @@ -0,0 +1,106 @@ +@{ + ViewData["Title"] = "Home Page"; +} + + + + diff --git a/src/DoddleReport.Sample.AspnetCore/Views/Shared/Error.cshtml b/src/DoddleReport.Sample.AspnetCore/Views/Shared/Error.cshtml new file mode 100644 index 0000000..ec2ea6b --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/Views/Shared/Error.cshtml @@ -0,0 +1,22 @@ +@model ErrorViewModel +@{ + ViewData["Title"] = "Error"; +} + +

Error.

+

An error occurred while processing your request.

+ +@if (Model.ShowRequestId) +{ +

+ Request ID: @Model.RequestId +

+} + +

Development Mode

+

+ Swapping to Development environment will display more detailed information about the error that occurred. +

+

+ Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application. +

diff --git a/src/DoddleReport.Sample.AspnetCore/Views/Shared/_Layout.cshtml b/src/DoddleReport.Sample.AspnetCore/Views/Shared/_Layout.cshtml new file mode 100644 index 0000000..57c3bce --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/Views/Shared/_Layout.cshtml @@ -0,0 +1,71 @@ + + + + + + @ViewData["Title"] - DoddleReport.Sample.AspnetCore + + + + + + + + + + + + +
+ @RenderBody() +
+
+

© 2017 - DoddleReport.Sample.AspnetCore

+
+
+ + + + + + + + + + + + + @RenderSection("Scripts", required: false) + + diff --git a/src/DoddleReport.Sample.AspnetCore/Views/Shared/_ValidationScriptsPartial.cshtml b/src/DoddleReport.Sample.AspnetCore/Views/Shared/_ValidationScriptsPartial.cshtml new file mode 100644 index 0000000..a699aaf --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/Views/Shared/_ValidationScriptsPartial.cshtml @@ -0,0 +1,18 @@ + + + + + + + + diff --git a/src/DoddleReport.Sample.AspnetCore/Views/_ViewImports.cshtml b/src/DoddleReport.Sample.AspnetCore/Views/_ViewImports.cshtml new file mode 100644 index 0000000..028b779 --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/Views/_ViewImports.cshtml @@ -0,0 +1,3 @@ +@using DoddleReport.Sample.AspnetCore +@using DoddleReport.Sample.AspnetCore.Models +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers diff --git a/src/DoddleReport.Sample.AspnetCore/Views/_ViewStart.cshtml b/src/DoddleReport.Sample.AspnetCore/Views/_ViewStart.cshtml new file mode 100644 index 0000000..a5f1004 --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/Views/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "_Layout"; +} diff --git a/src/DoddleReport.Sample.AspnetCore/appsettings.Development.json b/src/DoddleReport.Sample.AspnetCore/appsettings.Development.json new file mode 100644 index 0000000..fa8ce71 --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/appsettings.Development.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "IncludeScopes": false, + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/src/DoddleReport.Sample.AspnetCore/appsettings.json b/src/DoddleReport.Sample.AspnetCore/appsettings.json new file mode 100644 index 0000000..5fff67b --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/appsettings.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "IncludeScopes": false, + "LogLevel": { + "Default": "Warning" + } + } +} diff --git a/src/DoddleReport.Sample.AspnetCore/bundleconfig.json b/src/DoddleReport.Sample.AspnetCore/bundleconfig.json new file mode 100644 index 0000000..6d3f9a5 --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/bundleconfig.json @@ -0,0 +1,24 @@ +// Configure bundling and minification for the project. +// More info at https://go.microsoft.com/fwlink/?LinkId=808241 +[ + { + "outputFileName": "wwwroot/css/site.min.css", + // An array of relative input file paths. Globbing patterns supported + "inputFiles": [ + "wwwroot/css/site.css" + ] + }, + { + "outputFileName": "wwwroot/js/site.min.js", + "inputFiles": [ + "wwwroot/js/site.js" + ], + // Optionally specify minification options + "minify": { + "enabled": true, + "renameLocals": true + }, + // Optionally generate .map file + "sourceMap": false + } +] diff --git a/src/DoddleReport.Sample.AspnetCore/wwwroot/css/site.css b/src/DoddleReport.Sample.AspnetCore/wwwroot/css/site.css new file mode 100644 index 0000000..6d0f6e4 --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/wwwroot/css/site.css @@ -0,0 +1,35 @@ +body { + padding-top: 50px; + padding-bottom: 20px; +} + +/* Wrapping element */ +/* Set some basic padding to keep content from hitting the edges */ +.body-content { + padding-left: 15px; + padding-right: 15px; +} + +/* Carousel */ +.carousel-caption p { + font-size: 20px; + line-height: 1.4; +} + +/* Make .svg files in the carousel display properly in older browsers */ +.carousel-inner .item img[src$=".svg"] { + width: 100%; +} + +/* QR code generator */ +#qrCode { + margin: 15px; +} + +/* Hide/rearrange for smaller screens */ +@media screen and (max-width: 767px) { + /* Hide captions */ + .carousel-caption { + display: none; + } +} diff --git a/src/DoddleReport.Sample.AspnetCore/wwwroot/css/site.min.css b/src/DoddleReport.Sample.AspnetCore/wwwroot/css/site.min.css new file mode 100644 index 0000000..5e93e30 --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/wwwroot/css/site.min.css @@ -0,0 +1 @@ +body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}} \ No newline at end of file diff --git a/src/DoddleReport.Sample.AspnetCore/wwwroot/favicon.ico b/src/DoddleReport.Sample.AspnetCore/wwwroot/favicon.ico new file mode 100644 index 0000000..a3a7999 Binary files /dev/null and b/src/DoddleReport.Sample.AspnetCore/wwwroot/favicon.ico differ diff --git a/src/DoddleReport.Sample.AspnetCore/wwwroot/images/banner1.svg b/src/DoddleReport.Sample.AspnetCore/wwwroot/images/banner1.svg new file mode 100644 index 0000000..1ab32b6 --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/wwwroot/images/banner1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/DoddleReport.Sample.AspnetCore/wwwroot/images/banner2.svg b/src/DoddleReport.Sample.AspnetCore/wwwroot/images/banner2.svg new file mode 100644 index 0000000..9679c60 --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/wwwroot/images/banner2.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/DoddleReport.Sample.AspnetCore/wwwroot/images/banner3.svg b/src/DoddleReport.Sample.AspnetCore/wwwroot/images/banner3.svg new file mode 100644 index 0000000..9be2c25 --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/wwwroot/images/banner3.svg @@ -0,0 +1 @@ +banner3b \ No newline at end of file diff --git a/src/DoddleReport.Sample.AspnetCore/wwwroot/images/banner4.svg b/src/DoddleReport.Sample.AspnetCore/wwwroot/images/banner4.svg new file mode 100644 index 0000000..38b3d7c --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/wwwroot/images/banner4.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/DoddleReport.Sample.AspnetCore/wwwroot/js/site.js b/src/DoddleReport.Sample.AspnetCore/wwwroot/js/site.js new file mode 100644 index 0000000..0f3411a --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/wwwroot/js/site.js @@ -0,0 +1 @@ +// Write your JavaScript code. diff --git a/src/DoddleReport.Sample.AspnetCore/wwwroot/js/site.min.js b/src/DoddleReport.Sample.AspnetCore/wwwroot/js/site.min.js new file mode 100644 index 0000000..e69de29 diff --git a/src/DoddleReport.Sample.AspnetCore/wwwroot/lib/bootstrap/.bower.json b/src/DoddleReport.Sample.AspnetCore/wwwroot/lib/bootstrap/.bower.json new file mode 100644 index 0000000..1e99b62 --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/wwwroot/lib/bootstrap/.bower.json @@ -0,0 +1,45 @@ +{ + "name": "bootstrap", + "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", + "keywords": [ + "css", + "js", + "less", + "mobile-first", + "responsive", + "front-end", + "framework", + "web" + ], + "homepage": "http://getbootstrap.com", + "license": "MIT", + "moduleType": "globals", + "main": [ + "less/bootstrap.less", + "dist/js/bootstrap.js" + ], + "ignore": [ + "/.*", + "_config.yml", + "CNAME", + "composer.json", + "CONTRIBUTING.md", + "docs", + "js/tests", + "test-infra" + ], + "dependencies": { + "jquery": "1.9.1 - 3" + }, + "version": "3.3.7", + "_release": "3.3.7", + "_resolution": { + "type": "version", + "tag": "v3.3.7", + "commit": "0b9c4a4007c44201dce9a6cc1a38407005c26c86" + }, + "_source": "https://github.com/twbs/bootstrap.git", + "_target": "v3.3.7", + "_originalSource": "bootstrap", + "_direct": true +} \ No newline at end of file diff --git a/src/DoddleReport.Sample.AspnetCore/wwwroot/lib/bootstrap/LICENSE b/src/DoddleReport.Sample.AspnetCore/wwwroot/lib/bootstrap/LICENSE new file mode 100644 index 0000000..7a30002 --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/wwwroot/lib/bootstrap/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2011-2016 Twitter, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/src/DoddleReport.Sample.AspnetCore/wwwroot/lib/jquery-validation-unobtrusive/.bower.json b/src/DoddleReport.Sample.AspnetCore/wwwroot/lib/jquery-validation-unobtrusive/.bower.json new file mode 100644 index 0000000..ccf4812 --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/wwwroot/lib/jquery-validation-unobtrusive/.bower.json @@ -0,0 +1,44 @@ +{ + "name": "jquery-validation-unobtrusive", + "version": "3.2.6", + "homepage": "https://github.com/aspnet/jquery-validation-unobtrusive", + "description": "Add-on to jQuery Validation to enable unobtrusive validation options in data-* attributes.", + "main": [ + "jquery.validate.unobtrusive.js" + ], + "ignore": [ + "**/.*", + "*.json", + "*.md", + "*.txt", + "gulpfile.js" + ], + "keywords": [ + "jquery", + "asp.net", + "mvc", + "validation", + "unobtrusive" + ], + "authors": [ + "Microsoft" + ], + "license": "http://www.microsoft.com/web/webpi/eula/net_library_eula_enu.htm", + "repository": { + "type": "git", + "url": "git://github.com/aspnet/jquery-validation-unobtrusive.git" + }, + "dependencies": { + "jquery-validation": ">=1.8", + "jquery": ">=1.8" + }, + "_release": "3.2.6", + "_resolution": { + "type": "version", + "tag": "v3.2.6", + "commit": "13386cd1b5947d8a5d23a12b531ce3960be1eba7" + }, + "_source": "git://github.com/aspnet/jquery-validation-unobtrusive.git", + "_target": "3.2.6", + "_originalSource": "jquery-validation-unobtrusive" +} \ No newline at end of file diff --git a/src/DoddleReport.Sample.AspnetCore/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js b/src/DoddleReport.Sample.AspnetCore/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js new file mode 100644 index 0000000..1b0de12 --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js @@ -0,0 +1,416 @@ +/*! +** Unobtrusive validation support library for jQuery and jQuery Validate +** Copyright (C) Microsoft Corporation. All rights reserved. +*/ + +/*jslint white: true, browser: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: false */ +/*global document: false, jQuery: false */ + +(function ($) { + var $jQval = $.validator, + adapters, + data_validation = "unobtrusiveValidation"; + + function setValidationValues(options, ruleName, value) { + options.rules[ruleName] = value; + if (options.message) { + options.messages[ruleName] = options.message; + } + } + + function splitAndTrim(value) { + return value.replace(/^\s+|\s+$/g, "").split(/\s*,\s*/g); + } + + function escapeAttributeValue(value) { + // As mentioned on http://api.jquery.com/category/selectors/ + return value.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g, "\\$1"); + } + + function getModelPrefix(fieldName) { + return fieldName.substr(0, fieldName.lastIndexOf(".") + 1); + } + + function appendModelPrefix(value, prefix) { + if (value.indexOf("*.") === 0) { + value = value.replace("*.", prefix); + } + return value; + } + + function onError(error, inputElement) { // 'this' is the form element + var container = $(this).find("[data-valmsg-for='" + escapeAttributeValue(inputElement[0].name) + "']"), + replaceAttrValue = container.attr("data-valmsg-replace"), + replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) !== false : null; + + container.removeClass("field-validation-valid").addClass("field-validation-error"); + error.data("unobtrusiveContainer", container); + + if (replace) { + container.empty(); + error.removeClass("input-validation-error").appendTo(container); + } + else { + error.hide(); + } + } + + function onErrors(event, validator) { // 'this' is the form element + var container = $(this).find("[data-valmsg-summary=true]"), + list = container.find("ul"); + + if (list && list.length && validator.errorList.length) { + list.empty(); + container.addClass("validation-summary-errors").removeClass("validation-summary-valid"); + + $.each(validator.errorList, function () { + $("
  • ").html(this.message).appendTo(list); + }); + } + } + + function onSuccess(error) { // 'this' is the form element + var container = error.data("unobtrusiveContainer"); + + if (container) { + var replaceAttrValue = container.attr("data-valmsg-replace"), + replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) : null; + + container.addClass("field-validation-valid").removeClass("field-validation-error"); + error.removeData("unobtrusiveContainer"); + + if (replace) { + container.empty(); + } + } + } + + function onReset(event) { // 'this' is the form element + var $form = $(this), + key = '__jquery_unobtrusive_validation_form_reset'; + if ($form.data(key)) { + return; + } + // Set a flag that indicates we're currently resetting the form. + $form.data(key, true); + try { + $form.data("validator").resetForm(); + } finally { + $form.removeData(key); + } + + $form.find(".validation-summary-errors") + .addClass("validation-summary-valid") + .removeClass("validation-summary-errors"); + $form.find(".field-validation-error") + .addClass("field-validation-valid") + .removeClass("field-validation-error") + .removeData("unobtrusiveContainer") + .find(">*") // If we were using valmsg-replace, get the underlying error + .removeData("unobtrusiveContainer"); + } + + function validationInfo(form) { + var $form = $(form), + result = $form.data(data_validation), + onResetProxy = $.proxy(onReset, form), + defaultOptions = $jQval.unobtrusive.options || {}, + execInContext = function (name, args) { + var func = defaultOptions[name]; + func && $.isFunction(func) && func.apply(form, args); + } + + if (!result) { + result = { + options: { // options structure passed to jQuery Validate's validate() method + errorClass: defaultOptions.errorClass || "input-validation-error", + errorElement: defaultOptions.errorElement || "span", + errorPlacement: function () { + onError.apply(form, arguments); + execInContext("errorPlacement", arguments); + }, + invalidHandler: function () { + onErrors.apply(form, arguments); + execInContext("invalidHandler", arguments); + }, + messages: {}, + rules: {}, + success: function () { + onSuccess.apply(form, arguments); + execInContext("success", arguments); + } + }, + attachValidation: function () { + $form + .off("reset." + data_validation, onResetProxy) + .on("reset." + data_validation, onResetProxy) + .validate(this.options); + }, + validate: function () { // a validation function that is called by unobtrusive Ajax + $form.validate(); + return $form.valid(); + } + }; + $form.data(data_validation, result); + } + + return result; + } + + $jQval.unobtrusive = { + adapters: [], + + parseElement: function (element, skipAttach) { + /// + /// Parses a single HTML element for unobtrusive validation attributes. + /// + /// The HTML element to be parsed. + /// [Optional] true to skip attaching the + /// validation to the form. If parsing just this single element, you should specify true. + /// If parsing several elements, you should specify false, and manually attach the validation + /// to the form when you are finished. The default is false. + var $element = $(element), + form = $element.parents("form")[0], + valInfo, rules, messages; + + if (!form) { // Cannot do client-side validation without a form + return; + } + + valInfo = validationInfo(form); + valInfo.options.rules[element.name] = rules = {}; + valInfo.options.messages[element.name] = messages = {}; + + $.each(this.adapters, function () { + var prefix = "data-val-" + this.name, + message = $element.attr(prefix), + paramValues = {}; + + if (message !== undefined) { // Compare against undefined, because an empty message is legal (and falsy) + prefix += "-"; + + $.each(this.params, function () { + paramValues[this] = $element.attr(prefix + this); + }); + + this.adapt({ + element: element, + form: form, + message: message, + params: paramValues, + rules: rules, + messages: messages + }); + } + }); + + $.extend(rules, { "__dummy__": true }); + + if (!skipAttach) { + valInfo.attachValidation(); + } + }, + + parse: function (selector) { + /// + /// Parses all the HTML elements in the specified selector. It looks for input elements decorated + /// with the [data-val=true] attribute value and enables validation according to the data-val-* + /// attribute values. + /// + /// Any valid jQuery selector. + + // $forms includes all forms in selector's DOM hierarchy (parent, children and self) that have at least one + // element with data-val=true + var $selector = $(selector), + $forms = $selector.parents() + .addBack() + .filter("form") + .add($selector.find("form")) + .has("[data-val=true]"); + + $selector.find("[data-val=true]").each(function () { + $jQval.unobtrusive.parseElement(this, true); + }); + + $forms.each(function () { + var info = validationInfo(this); + if (info) { + info.attachValidation(); + } + }); + } + }; + + adapters = $jQval.unobtrusive.adapters; + + adapters.add = function (adapterName, params, fn) { + /// Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation. + /// The name of the adapter to be added. This matches the name used + /// in the data-val-nnnn HTML attribute (where nnnn is the adapter name). + /// [Optional] An array of parameter names (strings) that will + /// be extracted from the data-val-nnnn-mmmm HTML attributes (where nnnn is the adapter name, and + /// mmmm is the parameter name). + /// The function to call, which adapts the values from the HTML + /// attributes into jQuery Validate rules and/or messages. + /// + if (!fn) { // Called with no params, just a function + fn = params; + params = []; + } + this.push({ name: adapterName, params: params, adapt: fn }); + return this; + }; + + adapters.addBool = function (adapterName, ruleName) { + /// Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where + /// the jQuery Validate validation rule has no parameter values. + /// The name of the adapter to be added. This matches the name used + /// in the data-val-nnnn HTML attribute (where nnnn is the adapter name). + /// [Optional] The name of the jQuery Validate rule. If not provided, the value + /// of adapterName will be used instead. + /// + return this.add(adapterName, function (options) { + setValidationValues(options, ruleName || adapterName, true); + }); + }; + + adapters.addMinMax = function (adapterName, minRuleName, maxRuleName, minMaxRuleName, minAttribute, maxAttribute) { + /// Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where + /// the jQuery Validate validation has three potential rules (one for min-only, one for max-only, and + /// one for min-and-max). The HTML parameters are expected to be named -min and -max. + /// The name of the adapter to be added. This matches the name used + /// in the data-val-nnnn HTML attribute (where nnnn is the adapter name). + /// The name of the jQuery Validate rule to be used when you only + /// have a minimum value. + /// The name of the jQuery Validate rule to be used when you only + /// have a maximum value. + /// The name of the jQuery Validate rule to be used when you + /// have both a minimum and maximum value. + /// [Optional] The name of the HTML attribute that + /// contains the minimum value. The default is "min". + /// [Optional] The name of the HTML attribute that + /// contains the maximum value. The default is "max". + /// + return this.add(adapterName, [minAttribute || "min", maxAttribute || "max"], function (options) { + var min = options.params.min, + max = options.params.max; + + if (min && max) { + setValidationValues(options, minMaxRuleName, [min, max]); + } + else if (min) { + setValidationValues(options, minRuleName, min); + } + else if (max) { + setValidationValues(options, maxRuleName, max); + } + }); + }; + + adapters.addSingleVal = function (adapterName, attribute, ruleName) { + /// Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where + /// the jQuery Validate validation rule has a single value. + /// The name of the adapter to be added. This matches the name used + /// in the data-val-nnnn HTML attribute(where nnnn is the adapter name). + /// [Optional] The name of the HTML attribute that contains the value. + /// The default is "val". + /// [Optional] The name of the jQuery Validate rule. If not provided, the value + /// of adapterName will be used instead. + /// + return this.add(adapterName, [attribute || "val"], function (options) { + setValidationValues(options, ruleName || adapterName, options.params[attribute]); + }); + }; + + $jQval.addMethod("__dummy__", function (value, element, params) { + return true; + }); + + $jQval.addMethod("regex", function (value, element, params) { + var match; + if (this.optional(element)) { + return true; + } + + match = new RegExp(params).exec(value); + return (match && (match.index === 0) && (match[0].length === value.length)); + }); + + $jQval.addMethod("nonalphamin", function (value, element, nonalphamin) { + var match; + if (nonalphamin) { + match = value.match(/\W/g); + match = match && match.length >= nonalphamin; + } + return match; + }); + + if ($jQval.methods.extension) { + adapters.addSingleVal("accept", "mimtype"); + adapters.addSingleVal("extension", "extension"); + } else { + // for backward compatibility, when the 'extension' validation method does not exist, such as with versions + // of JQuery Validation plugin prior to 1.10, we should use the 'accept' method for + // validating the extension, and ignore mime-type validations as they are not supported. + adapters.addSingleVal("extension", "extension", "accept"); + } + + adapters.addSingleVal("regex", "pattern"); + adapters.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url"); + adapters.addMinMax("length", "minlength", "maxlength", "rangelength").addMinMax("range", "min", "max", "range"); + adapters.addMinMax("minlength", "minlength").addMinMax("maxlength", "minlength", "maxlength"); + adapters.add("equalto", ["other"], function (options) { + var prefix = getModelPrefix(options.element.name), + other = options.params.other, + fullOtherName = appendModelPrefix(other, prefix), + element = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(fullOtherName) + "']")[0]; + + setValidationValues(options, "equalTo", element); + }); + adapters.add("required", function (options) { + // jQuery Validate equates "required" with "mandatory" for checkbox elements + if (options.element.tagName.toUpperCase() !== "INPUT" || options.element.type.toUpperCase() !== "CHECKBOX") { + setValidationValues(options, "required", true); + } + }); + adapters.add("remote", ["url", "type", "additionalfields"], function (options) { + var value = { + url: options.params.url, + type: options.params.type || "GET", + data: {} + }, + prefix = getModelPrefix(options.element.name); + + $.each(splitAndTrim(options.params.additionalfields || options.element.name), function (i, fieldName) { + var paramName = appendModelPrefix(fieldName, prefix); + value.data[paramName] = function () { + var field = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(paramName) + "']"); + // For checkboxes and radio buttons, only pick up values from checked fields. + if (field.is(":checkbox")) { + return field.filter(":checked").val() || field.filter(":hidden").val() || ''; + } + else if (field.is(":radio")) { + return field.filter(":checked").val() || ''; + } + return field.val(); + }; + }); + + setValidationValues(options, "remote", value); + }); + adapters.add("password", ["min", "nonalphamin", "regex"], function (options) { + if (options.params.min) { + setValidationValues(options, "minlength", options.params.min); + } + if (options.params.nonalphamin) { + setValidationValues(options, "nonalphamin", options.params.nonalphamin); + } + if (options.params.regex) { + setValidationValues(options, "regex", options.params.regex); + } + }); + + $(function () { + $jQval.unobtrusive.parse(document); + }); +}(jQuery)); \ No newline at end of file diff --git a/src/DoddleReport.Sample.AspnetCore/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js b/src/DoddleReport.Sample.AspnetCore/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js new file mode 100644 index 0000000..be9a38a --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js @@ -0,0 +1,5 @@ +/* +** Unobtrusive validation support library for jQuery and jQuery Validate +** Copyright (C) Microsoft Corporation. All rights reserved. +*/ +!function(a){function e(a,e,n){a.rules[e]=n,a.message&&(a.messages[e]=a.message)}function n(a){return a.replace(/^\s+|\s+$/g,"").split(/\s*,\s*/g)}function t(a){return a.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g,"\\$1")}function r(a){return a.substr(0,a.lastIndexOf(".")+1)}function i(a,e){return 0===a.indexOf("*.")&&(a=a.replace("*.",e)),a}function o(e,n){var r=a(this).find("[data-valmsg-for='"+t(n[0].name)+"']"),i=r.attr("data-valmsg-replace"),o=i?a.parseJSON(i)!==!1:null;r.removeClass("field-validation-valid").addClass("field-validation-error"),e.data("unobtrusiveContainer",r),o?(r.empty(),e.removeClass("input-validation-error").appendTo(r)):e.hide()}function d(e,n){var t=a(this).find("[data-valmsg-summary=true]"),r=t.find("ul");r&&r.length&&n.errorList.length&&(r.empty(),t.addClass("validation-summary-errors").removeClass("validation-summary-valid"),a.each(n.errorList,function(){a("
  • ").html(this.message).appendTo(r)}))}function s(e){var n=e.data("unobtrusiveContainer");if(n){var t=n.attr("data-valmsg-replace"),r=t?a.parseJSON(t):null;n.addClass("field-validation-valid").removeClass("field-validation-error"),e.removeData("unobtrusiveContainer"),r&&n.empty()}}function l(e){var n=a(this),t="__jquery_unobtrusive_validation_form_reset";if(!n.data(t)){n.data(t,!0);try{n.data("validator").resetForm()}finally{n.removeData(t)}n.find(".validation-summary-errors").addClass("validation-summary-valid").removeClass("validation-summary-errors"),n.find(".field-validation-error").addClass("field-validation-valid").removeClass("field-validation-error").removeData("unobtrusiveContainer").find(">*").removeData("unobtrusiveContainer")}}function m(e){var n=a(e),t=n.data(v),r=a.proxy(l,e),i=p.unobtrusive.options||{},m=function(n,t){var r=i[n];r&&a.isFunction(r)&&r.apply(e,t)};return t||(t={options:{errorClass:i.errorClass||"input-validation-error",errorElement:i.errorElement||"span",errorPlacement:function(){o.apply(e,arguments),m("errorPlacement",arguments)},invalidHandler:function(){d.apply(e,arguments),m("invalidHandler",arguments)},messages:{},rules:{},success:function(){s.apply(e,arguments),m("success",arguments)}},attachValidation:function(){n.off("reset."+v,r).on("reset."+v,r).validate(this.options)},validate:function(){return n.validate(),n.valid()}},n.data(v,t)),t}var u,p=a.validator,v="unobtrusiveValidation";p.unobtrusive={adapters:[],parseElement:function(e,n){var t,r,i,o=a(e),d=o.parents("form")[0];d&&(t=m(d),t.options.rules[e.name]=r={},t.options.messages[e.name]=i={},a.each(this.adapters,function(){var n="data-val-"+this.name,t=o.attr(n),s={};void 0!==t&&(n+="-",a.each(this.params,function(){s[this]=o.attr(n+this)}),this.adapt({element:e,form:d,message:t,params:s,rules:r,messages:i}))}),a.extend(r,{__dummy__:!0}),n||t.attachValidation())},parse:function(e){var n=a(e),t=n.parents().addBack().filter("form").add(n.find("form")).has("[data-val=true]");n.find("[data-val=true]").each(function(){p.unobtrusive.parseElement(this,!0)}),t.each(function(){var a=m(this);a&&a.attachValidation()})}},u=p.unobtrusive.adapters,u.add=function(a,e,n){return n||(n=e,e=[]),this.push({name:a,params:e,adapt:n}),this},u.addBool=function(a,n){return this.add(a,function(t){e(t,n||a,!0)})},u.addMinMax=function(a,n,t,r,i,o){return this.add(a,[i||"min",o||"max"],function(a){var i=a.params.min,o=a.params.max;i&&o?e(a,r,[i,o]):i?e(a,n,i):o&&e(a,t,o)})},u.addSingleVal=function(a,n,t){return this.add(a,[n||"val"],function(r){e(r,t||a,r.params[n])})},p.addMethod("__dummy__",function(a,e,n){return!0}),p.addMethod("regex",function(a,e,n){var t;return this.optional(e)?!0:(t=new RegExp(n).exec(a),t&&0===t.index&&t[0].length===a.length)}),p.addMethod("nonalphamin",function(a,e,n){var t;return n&&(t=a.match(/\W/g),t=t&&t.length>=n),t}),p.methods.extension?(u.addSingleVal("accept","mimtype"),u.addSingleVal("extension","extension")):u.addSingleVal("extension","extension","accept"),u.addSingleVal("regex","pattern"),u.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url"),u.addMinMax("length","minlength","maxlength","rangelength").addMinMax("range","min","max","range"),u.addMinMax("minlength","minlength").addMinMax("maxlength","minlength","maxlength"),u.add("equalto",["other"],function(n){var o=r(n.element.name),d=n.params.other,s=i(d,o),l=a(n.form).find(":input").filter("[name='"+t(s)+"']")[0];e(n,"equalTo",l)}),u.add("required",function(a){("INPUT"!==a.element.tagName.toUpperCase()||"CHECKBOX"!==a.element.type.toUpperCase())&&e(a,"required",!0)}),u.add("remote",["url","type","additionalfields"],function(o){var d={url:o.params.url,type:o.params.type||"GET",data:{}},s=r(o.element.name);a.each(n(o.params.additionalfields||o.element.name),function(e,n){var r=i(n,s);d.data[r]=function(){var e=a(o.form).find(":input").filter("[name='"+t(r)+"']");return e.is(":checkbox")?e.filter(":checked").val()||e.filter(":hidden").val()||"":e.is(":radio")?e.filter(":checked").val()||"":e.val()}}),e(o,"remote",d)}),u.add("password",["min","nonalphamin","regex"],function(a){a.params.min&&e(a,"minlength",a.params.min),a.params.nonalphamin&&e(a,"nonalphamin",a.params.nonalphamin),a.params.regex&&e(a,"regex",a.params.regex)}),a(function(){p.unobtrusive.parse(document)})}(jQuery); \ No newline at end of file diff --git a/src/DoddleReport.Sample.AspnetCore/wwwroot/lib/jquery-validation/.bower.json b/src/DoddleReport.Sample.AspnetCore/wwwroot/lib/jquery-validation/.bower.json new file mode 100644 index 0000000..cab34a4 --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/wwwroot/lib/jquery-validation/.bower.json @@ -0,0 +1,40 @@ +{ + "name": "jquery-validation", + "homepage": "http://jqueryvalidation.org/", + "repository": { + "type": "git", + "url": "git://github.com/jzaefferer/jquery-validation.git" + }, + "authors": [ + "Jörn Zaefferer " + ], + "description": "Form validation made easy", + "main": "dist/jquery.validate.js", + "keywords": [ + "forms", + "validation", + "validate" + ], + "license": "MIT", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "demo", + "lib" + ], + "dependencies": { + "jquery": ">= 1.7.2" + }, + "version": "1.14.0", + "_release": "1.14.0", + "_resolution": { + "type": "version", + "tag": "1.14.0", + "commit": "c1343fb9823392aa9acbe1c3ffd337b8c92fed48" + }, + "_source": "git://github.com/jzaefferer/jquery-validation.git", + "_target": ">=1.8", + "_originalSource": "jquery-validation" +} \ No newline at end of file diff --git a/src/DoddleReport.Sample.AspnetCore/wwwroot/lib/jquery-validation/LICENSE.md b/src/DoddleReport.Sample.AspnetCore/wwwroot/lib/jquery-validation/LICENSE.md new file mode 100644 index 0000000..dc377cc --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/wwwroot/lib/jquery-validation/LICENSE.md @@ -0,0 +1,22 @@ +The MIT License (MIT) +===================== + +Copyright Jörn Zaefferer + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/src/DoddleReport.Sample.AspnetCore/wwwroot/lib/jquery/.bower.json b/src/DoddleReport.Sample.AspnetCore/wwwroot/lib/jquery/.bower.json new file mode 100644 index 0000000..419488b --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/wwwroot/lib/jquery/.bower.json @@ -0,0 +1,25 @@ +{ + "name": "jquery", + "main": "dist/jquery.js", + "license": "MIT", + "ignore": [ + "package.json" + ], + "keywords": [ + "jquery", + "javascript", + "browser", + "library" + ], + "homepage": "https://github.com/jquery/jquery-dist", + "version": "2.2.0", + "_release": "2.2.0", + "_resolution": { + "type": "version", + "tag": "2.2.0", + "commit": "6fc01e29bdad0964f62ef56d01297039cdcadbe5" + }, + "_source": "git://github.com/jquery/jquery-dist.git", + "_target": "2.2.0", + "_originalSource": "jquery" +} \ No newline at end of file diff --git a/src/DoddleReport.Sample.AspnetCore/wwwroot/lib/jquery/LICENSE.txt b/src/DoddleReport.Sample.AspnetCore/wwwroot/lib/jquery/LICENSE.txt new file mode 100644 index 0000000..5312a4c --- /dev/null +++ b/src/DoddleReport.Sample.AspnetCore/wwwroot/lib/jquery/LICENSE.txt @@ -0,0 +1,36 @@ +Copyright jQuery Foundation and other contributors, https://jquery.org/ + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/jquery/jquery + +The following license applies to all parts of this software except as +documented below: + +==== + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +All files located in the node_modules and external directories are +externally maintained libraries used by this software which have their +own licenses; we recommend you read them, as their terms may differ from +the terms above. diff --git a/src/DoddleReport.Sample.Web/DoddleReport.Sample.Web.csproj b/src/DoddleReport.Sample.Web/DoddleReport.Sample.Web.csproj index 846e1f9..6990ec4 100644 --- a/src/DoddleReport.Sample.Web/DoddleReport.Sample.Web.csproj +++ b/src/DoddleReport.Sample.Web/DoddleReport.Sample.Web.csproj @@ -168,22 +168,6 @@ - - {355CAFF3-F806-4194-BE54-2F7640463CED} - DoddleReport.AbcPdf - - - {347D0716-0297-4866-9FD5-5E019B51C408} - DoddleReport.iTextSharp - - - {0646C575-0EA6-4331-809C-10DC000929F3} - DoddleReport.OpenXml - - - {A02EF71C-C655-4D93-9CAF-15E527AA4FE0} - DoddleReport.Web - {F08B2994-4D05-423E-A8FE-7D1E8A63472B} DoddleReport diff --git a/src/DoddleReport.Sample.WinForms/DoddleReport.Sample.WinForms.csproj b/src/DoddleReport.Sample.WinForms/DoddleReport.Sample.WinForms.csproj index 842d735..c78cc48 100644 --- a/src/DoddleReport.Sample.WinForms/DoddleReport.Sample.WinForms.csproj +++ b/src/DoddleReport.Sample.WinForms/DoddleReport.Sample.WinForms.csproj @@ -1,105 +1,97 @@ - - - - Debug - x86 - 8.0.30703 - 2.0 - {12A17D7F-C168-4086-8D6A-DFE311E9EE90} - WinExe - Properties - DoddleReport.Sample.WinForms - DoddleReport.Sample.WinForms - v4.0 - Client - 512 - - - x86 - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - x86 - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - Models\DoddleProductRepository.cs - - - Form - - - Form1.cs - - - - - Form1.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - True - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - {355CAFF3-F806-4194-BE54-2F7640463CED} - DoddleReport.AbcPdf - - - {0646C575-0EA6-4331-809C-10DC000929F3} - DoddleReport.OpenXml - - - {F08B2994-4D05-423E-A8FE-7D1E8A63472B} - DoddleReport - - - - + + + + Debug + x86 + 8.0.30703 + 2.0 + {12A17D7F-C168-4086-8D6A-DFE311E9EE90} + WinExe + Properties + DoddleReport.Sample.WinForms + DoddleReport.Sample.WinForms + v4.0 + Client + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + Models\DoddleProductRepository.cs + + + Form + + + Form1.cs + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + {F08B2994-4D05-423E-A8FE-7D1E8A63472B} + DoddleReport + + + + \ No newline at end of file diff --git a/src/DoddleReport.Web/DoddleReport.Web.csproj b/src/DoddleReport.Web/DoddleReport.Web.csproj index 93bc80c..ae8964f 100644 --- a/src/DoddleReport.Web/DoddleReport.Web.csproj +++ b/src/DoddleReport.Web/DoddleReport.Web.csproj @@ -1,108 +1,17 @@ - - + + - Debug - AnyCPU - 8.0.30703 - 2.0 - {A02EF71C-C655-4D93-9CAF-15E527AA4FE0} - Library - Properties - DoddleReport.Web - DoddleReport.Web - v4.0 - 512 - + netstandard2.0 - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\DoddleReport.Web.XML - - - false - - - - - - - - ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - True - - - - - - - - ..\packages\Microsoft.AspNet.WebPages.1.0.20105.408\lib\net40\System.Web.Helpers.dll - True - - - ..\packages\Microsoft.AspNet.Mvc.3.0.50813.1\lib\net40\System.Web.Mvc.dll - True - - - ..\packages\Microsoft.AspNet.Razor.1.0.20105.408\lib\net40\System.Web.Razor.dll - True - - - - ..\packages\Microsoft.AspNet.WebPages.1.0.20105.408\lib\net40\System.Web.WebPages.dll - True - - - ..\packages\Microsoft.AspNet.WebPages.1.0.20105.408\lib\net40\System.Web.WebPages.Deployment.dll - True - - - ..\packages\Microsoft.AspNet.WebPages.1.0.20105.408\lib\net40\System.Web.WebPages.Razor.dll - True - - - - - - - - - - - - - - + - - + + - - {F08B2994-4D05-423E-A8FE-7D1E8A63472B} - DoddleReport - + + ..\..\..\..\..\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.mvc.core\2.0.1\lib\netstandard2.0\Microsoft.AspNetCore.Mvc.Core.dll + - - - \ No newline at end of file + + diff --git a/src/DoddleReport.Web/DoddleReport.Web.csproj.DotSettings b/src/DoddleReport.Web/DoddleReport.Web.csproj.DotSettings deleted file mode 100644 index 5d56eba..0000000 --- a/src/DoddleReport.Web/DoddleReport.Web.csproj.DotSettings +++ /dev/null @@ -1,2 +0,0 @@ - - True \ No newline at end of file diff --git a/src/DoddleReport.Web/DoddleReport.Web.csproj.ReSharper b/src/DoddleReport.Web/DoddleReport.Web.csproj.ReSharper deleted file mode 100644 index 5b86ce7..0000000 --- a/src/DoddleReport.Web/DoddleReport.Web.csproj.ReSharper +++ /dev/null @@ -1,5 +0,0 @@ - - - A02EF71C-C655-4D93-9CAF-15E527AA4FE0/d:Helpers - - \ No newline at end of file diff --git a/src/DoddleReport.Web/DoddleReport.Web.nuspec b/src/DoddleReport.Web/DoddleReport.Web.nuspec deleted file mode 100644 index 2621e73..0000000 --- a/src/DoddleReport.Web/DoddleReport.Web.nuspec +++ /dev/null @@ -1,17 +0,0 @@ - - - - $id$ - $version$ - $id$ - $description$ - $author$ - $author$ - https://github.com/matthidinger/DoddleReport - false - doddle.report doddle.reporting doddle reporting pdf excel csv - - - - - \ No newline at end of file diff --git a/src/DoddleReport.Web/Properties/AssemblyInfo.cs b/src/DoddleReport.Web/Properties/AssemblyInfo.cs deleted file mode 100644 index 78d88fb..0000000 --- a/src/DoddleReport.Web/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("DoddleReport.Web")] -[assembly: AssemblyDescription("Adds Web Reporting support to DoddleReport. MVC apps can use the new ActionResult called ReportResult. WebForms apps can use the WebReport IHttpHandler (.ashx)")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Matt Hidinger")] -[assembly: AssemblyProduct("DoddleReport.Web")] -[assembly: AssemblyCopyright("Copyright © 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("267e71f0-ec26-40e6-a924-b1f84c9ec2cc")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.5.2.0")] diff --git a/src/DoddleReport.Web/ReportResult.cs b/src/DoddleReport.Web/ReportResult.cs index c2adb95..cd06518 100644 --- a/src/DoddleReport.Web/ReportResult.cs +++ b/src/DoddleReport.Web/ReportResult.cs @@ -1,9 +1,8 @@ using System; using System.Web; -using System.Web.Mvc; using System.IO; - using DoddleReport.Configuration; +using Microsoft.AspNetCore.Mvc; namespace DoddleReport.Web { diff --git a/src/DoddleReport.Web/packages.config b/src/DoddleReport.Web/packages.config deleted file mode 100644 index 3f184f9..0000000 --- a/src/DoddleReport.Web/packages.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/DoddleReport.iTextSharp/DoddleReport.iTextSharp.csproj b/src/DoddleReport.iTextSharp/DoddleReport.iTextSharp.csproj index 03a21e5..04faf61 100644 --- a/src/DoddleReport.iTextSharp/DoddleReport.iTextSharp.csproj +++ b/src/DoddleReport.iTextSharp/DoddleReport.iTextSharp.csproj @@ -1,81 +1,21 @@ - - + + + - Debug - AnyCPU - 8.0.30703 - 2.0 - {347D0716-0297-4866-9FD5-5E019B51C408} - Library - Properties - DoddleReport.iTextSharp - DoddleReport.iTextSharp - v4.0 - 512 - - ..\ + netstandard2.0 + 2.0 + Adds iTextSharp PDF support to DoddleReport. iTextSharp is an open source PDF component that is free of charge. Please see the iTextSharp license for details + doddle.report doddle.reporting doddle reporting pdf itextsharp + https://github.com/matthidinger/DoddleReport + Matt Hidinger - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\DoddleReport.iTextSharp.XML - - - false - - - - - - - - ..\packages\iTextSharp.5.5.9\lib\itextsharp.dll - True - - - - - - - - - - - - - + - - - Designer - - + + - - {F08B2994-4D05-423E-A8FE-7D1E8A63472B} - DoddleReport - + - - - \ No newline at end of file + + diff --git a/src/DoddleReport.iTextSharp/DoddleReport.iTextSharp.nuspec b/src/DoddleReport.iTextSharp/DoddleReport.iTextSharp.nuspec deleted file mode 100644 index b559159..0000000 --- a/src/DoddleReport.iTextSharp/DoddleReport.iTextSharp.nuspec +++ /dev/null @@ -1,21 +0,0 @@ - - - - $id$ - $version$ - $id$ - $description$ - $author$ - $author$ - https://github.com/matthidinger/DoddleReport - false - doddle.report doddle.reporting doddle reporting pdf itextsharp - - - - - - - - - \ No newline at end of file diff --git a/src/DoddleReport.iTextSharp/Properties/AssemblyInfo.cs b/src/DoddleReport.iTextSharp/Properties/AssemblyInfo.cs deleted file mode 100644 index 8f195a0..0000000 --- a/src/DoddleReport.iTextSharp/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("DoddleReport.iTextSharp")] -[assembly: AssemblyDescription("Adds iTextSharp PDF support to DoddleReport. iTextSharp is an open source PDF component that is free of charge. Please see the iTextSharp license for details")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Matt Hidinger")] -[assembly: AssemblyProduct("DoddleReport.iTextSharp")] -[assembly: AssemblyCopyright("Copyright © 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("910f1d5e-34db-4a0f-a8b2-529fbfbf231c")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.5.2.0")] diff --git a/src/DoddleReport.iTextSharp/packages.config b/src/DoddleReport.iTextSharp/packages.config deleted file mode 100644 index 172ff0c..0000000 --- a/src/DoddleReport.iTextSharp/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/DoddleReport.sln b/src/DoddleReport.sln index 58dcb81..f4a7b8c 100644 --- a/src/DoddleReport.sln +++ b/src/DoddleReport.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25123.0 +# Visual Studio 15 +VisualStudioVersion = 15.0.27004.2009 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGet", "NuGet", "{0E73989A-FF31-4542-88F9-DAC6F9C40FE2}" ProjectSection(SolutionItems) = preProject @@ -11,19 +11,17 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGet", "NuGet", "{0E73989A EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sample Projects", "Sample Projects", "{2E920538-21EC-49E6-BF72-75E82B2E49E2}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DoddleReport", "DoddleReport\DoddleReport.csproj", "{F08B2994-4D05-423E-A8FE-7D1E8A63472B}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{C705E27D-A56E-4039-8C73-1C520335A8BE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DoddleReport.AbcPdf", "DoddleReport.AbcPdf\DoddleReport.AbcPdf.csproj", "{355CAFF3-F806-4194-BE54-2F7640463CED}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DoddleReport", "DoddleReport\DoddleReport.csproj", "{05A5C02F-D751-4A21-80BB-0FDE1188E48B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DoddleReport.OpenXml", "DoddleReport.OpenXml\DoddleReport.OpenXml.csproj", "{0646C575-0EA6-4331-809C-10DC000929F3}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DoddleReport.AbcPdf", "DoddleReport.AbcPdf\DoddleReport.AbcPdf.csproj", "{346A873D-3F0A-4A71-840A-24B1095C6021}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DoddleReport.Sample.Web", "DoddleReport.Sample.Web\DoddleReport.Sample.Web.csproj", "{28FBF83C-A8A3-418B-A32E-3A725BD37A5C}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DoddleReport.iTextSharp", "DoddleReport.iTextSharp\DoddleReport.iTextSharp.csproj", "{A88842E1-113B-4C3F-AF81-B68084118D91}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DoddleReport.Sample.WinForms", "DoddleReport.Sample.WinForms\DoddleReport.Sample.WinForms.csproj", "{12A17D7F-C168-4086-8D6A-DFE311E9EE90}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DoddleReport.OpenXml", "DoddleReport.OpenXml\DoddleReport.OpenXml.csproj", "{B4D4693D-70CC-41DF-9116-8E8EA5DE1D90}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DoddleReport.Web", "DoddleReport.Web\DoddleReport.Web.csproj", "{A02EF71C-C655-4D93-9CAF-15E527AA4FE0}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DoddleReport.iTextSharp", "DoddleReport.iTextSharp\DoddleReport.iTextSharp.csproj", "{347D0716-0297-4866-9FD5-5E019B51C408}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DoddleReport.Sample.AspnetCore", "DoddleReport.Sample.AspnetCore\DoddleReport.Sample.AspnetCore.csproj", "{785F35DF-B9A3-402B-9F18-7707384B0641}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -35,84 +33,75 @@ Global Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F08B2994-4D05-423E-A8FE-7D1E8A63472B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F08B2994-4D05-423E-A8FE-7D1E8A63472B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F08B2994-4D05-423E-A8FE-7D1E8A63472B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {F08B2994-4D05-423E-A8FE-7D1E8A63472B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {F08B2994-4D05-423E-A8FE-7D1E8A63472B}.Debug|x86.ActiveCfg = Debug|Any CPU - {F08B2994-4D05-423E-A8FE-7D1E8A63472B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F08B2994-4D05-423E-A8FE-7D1E8A63472B}.Release|Any CPU.Build.0 = Release|Any CPU - {F08B2994-4D05-423E-A8FE-7D1E8A63472B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {F08B2994-4D05-423E-A8FE-7D1E8A63472B}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {F08B2994-4D05-423E-A8FE-7D1E8A63472B}.Release|x86.ActiveCfg = Release|Any CPU - {355CAFF3-F806-4194-BE54-2F7640463CED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {355CAFF3-F806-4194-BE54-2F7640463CED}.Debug|Any CPU.Build.0 = Debug|Any CPU - {355CAFF3-F806-4194-BE54-2F7640463CED}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {355CAFF3-F806-4194-BE54-2F7640463CED}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {355CAFF3-F806-4194-BE54-2F7640463CED}.Debug|x86.ActiveCfg = Debug|Any CPU - {355CAFF3-F806-4194-BE54-2F7640463CED}.Release|Any CPU.ActiveCfg = Release|Any CPU - {355CAFF3-F806-4194-BE54-2F7640463CED}.Release|Any CPU.Build.0 = Release|Any CPU - {355CAFF3-F806-4194-BE54-2F7640463CED}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {355CAFF3-F806-4194-BE54-2F7640463CED}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {355CAFF3-F806-4194-BE54-2F7640463CED}.Release|x86.ActiveCfg = Release|Any CPU - {0646C575-0EA6-4331-809C-10DC000929F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0646C575-0EA6-4331-809C-10DC000929F3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0646C575-0EA6-4331-809C-10DC000929F3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {0646C575-0EA6-4331-809C-10DC000929F3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {0646C575-0EA6-4331-809C-10DC000929F3}.Debug|x86.ActiveCfg = Debug|Any CPU - {0646C575-0EA6-4331-809C-10DC000929F3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0646C575-0EA6-4331-809C-10DC000929F3}.Release|Any CPU.Build.0 = Release|Any CPU - {0646C575-0EA6-4331-809C-10DC000929F3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {0646C575-0EA6-4331-809C-10DC000929F3}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {0646C575-0EA6-4331-809C-10DC000929F3}.Release|x86.ActiveCfg = Release|Any CPU - {28FBF83C-A8A3-418B-A32E-3A725BD37A5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {28FBF83C-A8A3-418B-A32E-3A725BD37A5C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {28FBF83C-A8A3-418B-A32E-3A725BD37A5C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {28FBF83C-A8A3-418B-A32E-3A725BD37A5C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {28FBF83C-A8A3-418B-A32E-3A725BD37A5C}.Debug|x86.ActiveCfg = Debug|Any CPU - {28FBF83C-A8A3-418B-A32E-3A725BD37A5C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {28FBF83C-A8A3-418B-A32E-3A725BD37A5C}.Release|Any CPU.Build.0 = Release|Any CPU - {28FBF83C-A8A3-418B-A32E-3A725BD37A5C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {28FBF83C-A8A3-418B-A32E-3A725BD37A5C}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {28FBF83C-A8A3-418B-A32E-3A725BD37A5C}.Release|x86.ActiveCfg = Release|Any CPU - {12A17D7F-C168-4086-8D6A-DFE311E9EE90}.Debug|Any CPU.ActiveCfg = Debug|x86 - {12A17D7F-C168-4086-8D6A-DFE311E9EE90}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {12A17D7F-C168-4086-8D6A-DFE311E9EE90}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {12A17D7F-C168-4086-8D6A-DFE311E9EE90}.Debug|x86.ActiveCfg = Debug|x86 - {12A17D7F-C168-4086-8D6A-DFE311E9EE90}.Debug|x86.Build.0 = Debug|x86 - {12A17D7F-C168-4086-8D6A-DFE311E9EE90}.Release|Any CPU.ActiveCfg = Release|x86 - {12A17D7F-C168-4086-8D6A-DFE311E9EE90}.Release|Any CPU.Build.0 = Release|x86 - {12A17D7F-C168-4086-8D6A-DFE311E9EE90}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {12A17D7F-C168-4086-8D6A-DFE311E9EE90}.Release|Mixed Platforms.Build.0 = Release|x86 - {12A17D7F-C168-4086-8D6A-DFE311E9EE90}.Release|x86.ActiveCfg = Release|x86 - {12A17D7F-C168-4086-8D6A-DFE311E9EE90}.Release|x86.Build.0 = Release|x86 - {A02EF71C-C655-4D93-9CAF-15E527AA4FE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A02EF71C-C655-4D93-9CAF-15E527AA4FE0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A02EF71C-C655-4D93-9CAF-15E527AA4FE0}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {A02EF71C-C655-4D93-9CAF-15E527AA4FE0}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {A02EF71C-C655-4D93-9CAF-15E527AA4FE0}.Debug|x86.ActiveCfg = Debug|Any CPU - {A02EF71C-C655-4D93-9CAF-15E527AA4FE0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A02EF71C-C655-4D93-9CAF-15E527AA4FE0}.Release|Any CPU.Build.0 = Release|Any CPU - {A02EF71C-C655-4D93-9CAF-15E527AA4FE0}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {A02EF71C-C655-4D93-9CAF-15E527AA4FE0}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {A02EF71C-C655-4D93-9CAF-15E527AA4FE0}.Release|x86.ActiveCfg = Release|Any CPU - {347D0716-0297-4866-9FD5-5E019B51C408}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {347D0716-0297-4866-9FD5-5E019B51C408}.Debug|Any CPU.Build.0 = Debug|Any CPU - {347D0716-0297-4866-9FD5-5E019B51C408}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {347D0716-0297-4866-9FD5-5E019B51C408}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {347D0716-0297-4866-9FD5-5E019B51C408}.Debug|x86.ActiveCfg = Debug|Any CPU - {347D0716-0297-4866-9FD5-5E019B51C408}.Release|Any CPU.ActiveCfg = Release|Any CPU - {347D0716-0297-4866-9FD5-5E019B51C408}.Release|Any CPU.Build.0 = Release|Any CPU - {347D0716-0297-4866-9FD5-5E019B51C408}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {347D0716-0297-4866-9FD5-5E019B51C408}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {347D0716-0297-4866-9FD5-5E019B51C408}.Release|x86.ActiveCfg = Release|Any CPU + {05A5C02F-D751-4A21-80BB-0FDE1188E48B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {05A5C02F-D751-4A21-80BB-0FDE1188E48B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {05A5C02F-D751-4A21-80BB-0FDE1188E48B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {05A5C02F-D751-4A21-80BB-0FDE1188E48B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {05A5C02F-D751-4A21-80BB-0FDE1188E48B}.Debug|x86.ActiveCfg = Debug|Any CPU + {05A5C02F-D751-4A21-80BB-0FDE1188E48B}.Debug|x86.Build.0 = Debug|Any CPU + {05A5C02F-D751-4A21-80BB-0FDE1188E48B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {05A5C02F-D751-4A21-80BB-0FDE1188E48B}.Release|Any CPU.Build.0 = Release|Any CPU + {05A5C02F-D751-4A21-80BB-0FDE1188E48B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {05A5C02F-D751-4A21-80BB-0FDE1188E48B}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {05A5C02F-D751-4A21-80BB-0FDE1188E48B}.Release|x86.ActiveCfg = Release|Any CPU + {05A5C02F-D751-4A21-80BB-0FDE1188E48B}.Release|x86.Build.0 = Release|Any CPU + {346A873D-3F0A-4A71-840A-24B1095C6021}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {346A873D-3F0A-4A71-840A-24B1095C6021}.Debug|Any CPU.Build.0 = Debug|Any CPU + {346A873D-3F0A-4A71-840A-24B1095C6021}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {346A873D-3F0A-4A71-840A-24B1095C6021}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {346A873D-3F0A-4A71-840A-24B1095C6021}.Debug|x86.ActiveCfg = Debug|Any CPU + {346A873D-3F0A-4A71-840A-24B1095C6021}.Debug|x86.Build.0 = Debug|Any CPU + {346A873D-3F0A-4A71-840A-24B1095C6021}.Release|Any CPU.ActiveCfg = Release|Any CPU + {346A873D-3F0A-4A71-840A-24B1095C6021}.Release|Any CPU.Build.0 = Release|Any CPU + {346A873D-3F0A-4A71-840A-24B1095C6021}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {346A873D-3F0A-4A71-840A-24B1095C6021}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {346A873D-3F0A-4A71-840A-24B1095C6021}.Release|x86.ActiveCfg = Release|Any CPU + {346A873D-3F0A-4A71-840A-24B1095C6021}.Release|x86.Build.0 = Release|Any CPU + {A88842E1-113B-4C3F-AF81-B68084118D91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A88842E1-113B-4C3F-AF81-B68084118D91}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A88842E1-113B-4C3F-AF81-B68084118D91}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {A88842E1-113B-4C3F-AF81-B68084118D91}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {A88842E1-113B-4C3F-AF81-B68084118D91}.Debug|x86.ActiveCfg = Debug|Any CPU + {A88842E1-113B-4C3F-AF81-B68084118D91}.Debug|x86.Build.0 = Debug|Any CPU + {A88842E1-113B-4C3F-AF81-B68084118D91}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A88842E1-113B-4C3F-AF81-B68084118D91}.Release|Any CPU.Build.0 = Release|Any CPU + {A88842E1-113B-4C3F-AF81-B68084118D91}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {A88842E1-113B-4C3F-AF81-B68084118D91}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {A88842E1-113B-4C3F-AF81-B68084118D91}.Release|x86.ActiveCfg = Release|Any CPU + {A88842E1-113B-4C3F-AF81-B68084118D91}.Release|x86.Build.0 = Release|Any CPU + {B4D4693D-70CC-41DF-9116-8E8EA5DE1D90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B4D4693D-70CC-41DF-9116-8E8EA5DE1D90}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B4D4693D-70CC-41DF-9116-8E8EA5DE1D90}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {B4D4693D-70CC-41DF-9116-8E8EA5DE1D90}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {B4D4693D-70CC-41DF-9116-8E8EA5DE1D90}.Debug|x86.ActiveCfg = Debug|Any CPU + {B4D4693D-70CC-41DF-9116-8E8EA5DE1D90}.Debug|x86.Build.0 = Debug|Any CPU + {B4D4693D-70CC-41DF-9116-8E8EA5DE1D90}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B4D4693D-70CC-41DF-9116-8E8EA5DE1D90}.Release|Any CPU.Build.0 = Release|Any CPU + {B4D4693D-70CC-41DF-9116-8E8EA5DE1D90}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {B4D4693D-70CC-41DF-9116-8E8EA5DE1D90}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {B4D4693D-70CC-41DF-9116-8E8EA5DE1D90}.Release|x86.ActiveCfg = Release|Any CPU + {B4D4693D-70CC-41DF-9116-8E8EA5DE1D90}.Release|x86.Build.0 = Release|Any CPU + {785F35DF-B9A3-402B-9F18-7707384B0641}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {785F35DF-B9A3-402B-9F18-7707384B0641}.Debug|Any CPU.Build.0 = Debug|Any CPU + {785F35DF-B9A3-402B-9F18-7707384B0641}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {785F35DF-B9A3-402B-9F18-7707384B0641}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {785F35DF-B9A3-402B-9F18-7707384B0641}.Debug|x86.ActiveCfg = Debug|Any CPU + {785F35DF-B9A3-402B-9F18-7707384B0641}.Debug|x86.Build.0 = Debug|Any CPU + {785F35DF-B9A3-402B-9F18-7707384B0641}.Release|Any CPU.ActiveCfg = Release|Any CPU + {785F35DF-B9A3-402B-9F18-7707384B0641}.Release|Any CPU.Build.0 = Release|Any CPU + {785F35DF-B9A3-402B-9F18-7707384B0641}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {785F35DF-B9A3-402B-9F18-7707384B0641}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {785F35DF-B9A3-402B-9F18-7707384B0641}.Release|x86.ActiveCfg = Release|Any CPU + {785F35DF-B9A3-402B-9F18-7707384B0641}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {28FBF83C-A8A3-418B-A32E-3A725BD37A5C} = {2E920538-21EC-49E6-BF72-75E82B2E49E2} - {12A17D7F-C168-4086-8D6A-DFE311E9EE90} = {2E920538-21EC-49E6-BF72-75E82B2E49E2} + {785F35DF-B9A3-402B-9F18-7707384B0641} = {2E920538-21EC-49E6-BF72-75E82B2E49E2} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {39B505E4-A073-4ECD-AC98-C5CB8776F2C5} EndGlobalSection GlobalSection(TestCaseManagementSettings) = postSolution CategoryFile = DoddleReport.vsmdi diff --git a/src/DoddleReport/Configuration/Config.cs b/src/DoddleReport/Configuration/Config.cs index d1cc2a9..cbf17b5 100644 --- a/src/DoddleReport/Configuration/Config.cs +++ b/src/DoddleReport/Configuration/Config.cs @@ -1,17 +1,16 @@ -using System.Configuration; - -namespace DoddleReport.Configuration -{ - public static class Config - { - public static DoddleReportSection Report - { - get - { - var section = ConfigurationManager.GetSection("doddleReport") as DoddleReportSection; - return section ?? new DoddleReportSection(); - } - } - - } +namespace DoddleReport.Configuration +{ + public static class Config + { + public static DoddleReportSection Report + { + get + { + // TODO: blows up on netstandard + //var section = ConfigurationManager.GetSection("doddleReport") as DoddleReportSection; + //return section ?? new DoddleReportSection(); + return new DoddleReportSection(); + } + } + } } \ No newline at end of file diff --git a/src/DoddleReport/Configuration/DoddleReportSection.cs b/src/DoddleReport/Configuration/DoddleReportSection.cs index 606767b..ad210a3 100644 --- a/src/DoddleReport/Configuration/DoddleReportSection.cs +++ b/src/DoddleReport/Configuration/DoddleReportSection.cs @@ -1,49 +1,49 @@ -using System.Configuration; - -namespace DoddleReport.Configuration -{ - public sealed class DoddleReportSection : ConfigurationSection - { - [ConfigurationProperty("writers", IsRequired = true)] - public WriterElementCollection Writers - { - get { return (WriterElementCollection)this["writers"]; } - set { this["writers"] = value; } - } - - [ConfigurationProperty("styles")] - public StyleElementCollection Styles - { - get { return (StyleElementCollection)this["styles"]; } - set { this["styles"] = value; } - } - - [ConfigurationProperty("defaultWriter", DefaultValue = "Html")] - public string DefaultWriter - { - get { return (string)base["defaultWriter"]; } - set { base["defaultWriter"] = value; } - } - - [ConfigurationProperty("dataRowStyle", DefaultValue = "DataRowStyle")] - public string DataRowStyleName - { - get { return (string) this["dataRowStyle"]; } - set { this["dataRowStyle"] = value; } - } - - [ConfigurationProperty("headerRowStyle", DefaultValue = "HeaderRowStyle")] - public string HeaderRowStyleName - { - get { return (string) this["headerRowStyle"]; } - set { this["headerRowStyle"] = value; } - } - - [ConfigurationProperty("footerRowStyle", DefaultValue = "FooterRowStyle")] - public string FooterRowStyleName - { - get { return (string) this["footerRowStyle"]; } - set { this["footerRowStyle"] = value; } - } - } +using System.Configuration; + +namespace DoddleReport.Configuration +{ + public sealed class DoddleReportSection : ConfigurationSection + { + [ConfigurationProperty("writers", IsRequired = true)] + public WriterElementCollection Writers + { + get { return (WriterElementCollection)this["writers"]; } + set { this["writers"] = value; } + } + + [ConfigurationProperty("styles")] + public StyleElementCollection Styles + { + get { return (StyleElementCollection)this["styles"]; } + set { this["styles"] = value; } + } + + [ConfigurationProperty("defaultWriter", DefaultValue = "Html")] + public string DefaultWriter + { + get { return (string)base["defaultWriter"]; } + set { base["defaultWriter"] = value; } + } + + [ConfigurationProperty("dataRowStyle", DefaultValue = "DataRowStyle")] + public string DataRowStyleName + { + get { return (string)this["dataRowStyle"]; } + set { this["dataRowStyle"] = value; } + } + + [ConfigurationProperty("headerRowStyle", DefaultValue = "HeaderRowStyle")] + public string HeaderRowStyleName + { + get { return (string)this["headerRowStyle"]; } + set { this["headerRowStyle"] = value; } + } + + [ConfigurationProperty("footerRowStyle", DefaultValue = "FooterRowStyle")] + public string FooterRowStyleName + { + get { return (string)this["footerRowStyle"]; } + set { this["footerRowStyle"] = value; } + } + } } \ No newline at end of file diff --git a/src/DoddleReport/Configuration/StyleElement.cs b/src/DoddleReport/Configuration/StyleElement.cs index 65d0c7e..445dcae 100644 --- a/src/DoddleReport/Configuration/StyleElement.cs +++ b/src/DoddleReport/Configuration/StyleElement.cs @@ -1,101 +1,106 @@ -using System.Configuration; -using System.Drawing; - -namespace DoddleReport.Configuration -{ - public sealed class StyleElement : ConfigurationElement - { - [ConfigurationProperty("name", IsRequired = true)] - public string Name - { - get { return (string) this["name"]; } - set { this["name"] = value; } - } - - [ConfigurationProperty("bold", DefaultValue = false)] - public bool Bold - { - get { return (bool) this["bold"]; } - set { this["bold"] = value; } - } - - [ConfigurationProperty("underline", DefaultValue = false)] - public bool Underline - { - get { return (bool)this["underline"]; } - set { this["underline"] = value; } - } - - [ConfigurationProperty("italic", DefaultValue = false)] - public bool Italic - { - get { return (bool)this["italic"]; } - set { this["italic"] = value; } - } - - [IntegerValidator(MinValue=6, MaxValue=72)] - [ConfigurationProperty("fontSize", DefaultValue = 9)] - public int FontSize - { - get { return (int) this["fontSize"]; } - set { this["fontSize"] = value; } - } - - [IntegerValidator(MinValue = -90, MaxValue = 90)] - [ConfigurationProperty("textRotation", DefaultValue = 0)] - public int TextRotation - { - get { return (int)this["textRotation"]; } - set { this["textRotation"] = value; } - } - - [ConfigurationProperty("backColor", DefaultValue = "White")] - public string BackColorString - { - get { return (string) this["backColor"]; } - set { this["backColor"] = value; } - } - - [ConfigurationProperty("foreColor", DefaultValue = "Black")] - public string ForeColorString - { - get { return (string) this["foreColor"]; } - set { this["foreColor"] = value; } - } - - public Color BackColor - { - get - { - var c = new ColorConverter(); - return (Color)c.ConvertFrom(BackColorString); - } - set { this["backColor"] = value.ToString(); } - } - - public Color ForeColor - { - get - { - var c = new ColorConverter(); - return (Color)c.ConvertFrom(ForeColorString); - } - set { this["foreColor"] = value.ToString(); } - } - - // TODO: Add Alignment enums - - internal void ApplyStyle(ReportStyle reportStyle) - { - reportStyle.Bold = Bold; - reportStyle.Underline = Underline; - reportStyle.Italic = Italic; - - reportStyle.BackColor = BackColor; - reportStyle.ForeColor = ForeColor; - - reportStyle.FontSize = FontSize; - reportStyle.TextRotation = TextRotation; - } - } +using System.Configuration; +using System.Drawing; + +namespace DoddleReport.Configuration +{ + public sealed class StyleElement : ConfigurationElement + { + [ConfigurationProperty("name", IsRequired = true)] + public string Name + { + get { return (string)this["name"]; } + set { this["name"] = value; } + } + + [ConfigurationProperty("bold", DefaultValue = false)] + public bool Bold + { + get { return (bool)this["bold"]; } + set { this["bold"] = value; } + } + + [ConfigurationProperty("underline", DefaultValue = false)] + public bool Underline + { + get { return (bool)this["underline"]; } + set { this["underline"] = value; } + } + + [ConfigurationProperty("italic", DefaultValue = false)] + public bool Italic + { + get { return (bool)this["italic"]; } + set { this["italic"] = value; } + } + + [IntegerValidator(MinValue = 6, MaxValue = 72)] + [ConfigurationProperty("fontSize", DefaultValue = 9)] + public int FontSize + { + get { return (int)this["fontSize"]; } + set { this["fontSize"] = value; } + } + + [IntegerValidator(MinValue = -90, MaxValue = 90)] + [ConfigurationProperty("textRotation", DefaultValue = 0)] + public int TextRotation + { + get { return (int)this["textRotation"]; } + set { this["textRotation"] = value; } + } + + [ConfigurationProperty("backColor", DefaultValue = "White")] + public string BackColorString + { + get { return (string)this["backColor"]; } + set { this["backColor"] = value; } + } + + [ConfigurationProperty("foreColor", DefaultValue = "Black")] + public string ForeColorString + { + get { return (string)this["foreColor"]; } + set { this["foreColor"] = value; } + } + + public Color BackColor + { + get + { + //var c = new ColorConverter(); + //return (Color)c.ConvertFrom(BackColorString); + return Color.White; + } + set { this["backColor"] = value.ToString(); } + } + + public Color ForeColor + { + get + { + // TODO: fix colors + //var c = new ColorConverter(); + //return (Color)c.ConvertFrom(ForeColorString); + return Color.Black; + } + set { this["foreColor"] = value.ToString(); } + } + + // TODO: Add Alignment enums + + internal void ApplyStyle(ReportStyle reportStyle) + { + reportStyle.Bold = Bold; + reportStyle.Underline = Underline; + reportStyle.Italic = Italic; + + reportStyle.BackColor = BackColor; + reportStyle.ForeColor = ForeColor; + + reportStyle.FontSize = FontSize; + reportStyle.TextRotation = TextRotation; + } + } + + } \ No newline at end of file diff --git a/src/DoddleReport/Configuration/StyleElementCollection.cs b/src/DoddleReport/Configuration/StyleElementCollection.cs index 26e11cc..89020b2 100644 --- a/src/DoddleReport/Configuration/StyleElementCollection.cs +++ b/src/DoddleReport/Configuration/StyleElementCollection.cs @@ -1,51 +1,51 @@ -using System.Configuration; - -namespace DoddleReport.Configuration -{ - [ConfigurationCollection(typeof(StyleElement), CollectionType = ConfigurationElementCollectionType.BasicMap, AddItemName="style")] - public class StyleElementCollection : ConfigurationElementCollection - { - protected override ConfigurationElement CreateNewElement() - { - return new StyleElement(); - } - - protected override object GetElementKey(ConfigurationElement element) - { - return ((StyleElement)element).Name; - } - - public StyleElement this[int index] - { - get - { - return (StyleElement)BaseGet(index); - } - set - { - if (BaseGet(index) != null) - { - BaseRemoveAt(index); - } - BaseAdd(index, value); - } - } - - public new StyleElement this[string name] - { - get - { - return (StyleElement)BaseGet(name) ?? new StyleElement(); - } - } - - public StyleElement this[ReportRowType rowType] - { - get - { - return this[rowType.ToString()]; - } - } - - } +using System.Configuration; + +namespace DoddleReport.Configuration +{ + [ConfigurationCollection(typeof(StyleElement), CollectionType = ConfigurationElementCollectionType.BasicMap, AddItemName = "style")] + public class StyleElementCollection : ConfigurationElementCollection + { + protected override ConfigurationElement CreateNewElement() + { + return new StyleElement(); + } + + protected override object GetElementKey(ConfigurationElement element) + { + return ((StyleElement)element).Name; + } + + public StyleElement this[int index] + { + get + { + return (StyleElement)BaseGet(index); + } + set + { + if (BaseGet(index) != null) + { + BaseRemoveAt(index); + } + BaseAdd(index, value); + } + } + + public new StyleElement this[string name] + { + get + { + return (StyleElement)BaseGet(name) ?? new StyleElement(); + } + } + + public StyleElement this[ReportRowType rowType] + { + get + { + return this[rowType.ToString()]; + } + } + + } } \ No newline at end of file diff --git a/src/DoddleReport/Configuration/WriterElement.cs b/src/DoddleReport/Configuration/WriterElement.cs index 2a65a55..8fb92d2 100644 --- a/src/DoddleReport/Configuration/WriterElement.cs +++ b/src/DoddleReport/Configuration/WriterElement.cs @@ -1,71 +1,71 @@ -using System; -using System.Configuration; - -namespace DoddleReport.Configuration -{ - public class WriterElement : ConfigurationElement - { - [ConfigurationProperty("format", IsRequired = true)] - public string Format - { - get { return (string)this["format"]; } - set { this["format"] = value; } - } - - public Type Type - { - get - { - return Type.GetType(TypeName); - } - - } - - [ConfigurationProperty("type", IsRequired = true)] - public string TypeName - { - get - { - return (string)base["type"]; - } - set - { - base["type"] = value; - } - } - - [ConfigurationProperty("contentType", DefaultValue = "text/html")] - public string ContentType - { - get { return (string) this["contentType"]; } - set { this["contentType"] = value; } - } - - [ConfigurationProperty("offerDownload", DefaultValue = false)] - public bool OfferDownload - { - get { return (bool) this["offerDownload"]; } - set { this["offerDownload"] = value; } - } - - [ConfigurationProperty("fileExtension", IsRequired = true)] - public string FileExtension - { - get { return (string) this["fileExtension"]; } - set { this["fileExtension"] = value; } - } - - public IReportWriter LoadWriter() - { - try - { - var writer = Activator.CreateInstance(Type) as IReportWriter; - return writer; - } - catch (Exception ex) - { - throw new InvalidOperationException(string.Format("Unable to load the ReportWriter format '{0}' because the type '{1}' could not be created", Format, TypeName), ex); - } - } - } +using System; +using System.Configuration; + +namespace DoddleReport.Configuration +{ + public class WriterElement : ConfigurationElement + { + [ConfigurationProperty("format", IsRequired = true)] + public string Format + { + get { return (string)this["format"]; } + set { this["format"] = value; } + } + + public Type Type + { + get + { + return Type.GetType(TypeName); + } + + } + + [ConfigurationProperty("type", IsRequired = true)] + public string TypeName + { + get + { + return (string)base["type"]; + } + set + { + base["type"] = value; + } + } + + [ConfigurationProperty("contentType", DefaultValue = "text/html")] + public string ContentType + { + get { return (string)this["contentType"]; } + set { this["contentType"] = value; } + } + + [ConfigurationProperty("offerDownload", DefaultValue = false)] + public bool OfferDownload + { + get { return (bool)this["offerDownload"]; } + set { this["offerDownload"] = value; } + } + + [ConfigurationProperty("fileExtension", IsRequired = true)] + public string FileExtension + { + get { return (string)this["fileExtension"]; } + set { this["fileExtension"] = value; } + } + + public IReportWriter LoadWriter() + { + try + { + var writer = Activator.CreateInstance(Type) as IReportWriter; + return writer; + } + catch (Exception ex) + { + throw new InvalidOperationException(string.Format("Unable to load the ReportWriter format '{0}' because the type '{1}' could not be created", Format, TypeName), ex); + } + } + } } \ No newline at end of file diff --git a/src/DoddleReport/Configuration/WriterElementCollection.cs b/src/DoddleReport/Configuration/WriterElementCollection.cs index b250357..c366ef3 100644 --- a/src/DoddleReport/Configuration/WriterElementCollection.cs +++ b/src/DoddleReport/Configuration/WriterElementCollection.cs @@ -1,111 +1,111 @@ -using System.Configuration; -using System; -using System.Linq; - -namespace DoddleReport.Configuration -{ - [ConfigurationCollection(typeof(WriterElement), CollectionType = ConfigurationElementCollectionType.AddRemoveClearMap)] - public class WriterElementCollection : ConfigurationElementCollection - { - public WriterElementCollection() - { - AddDefaults(); - } - - public void AddDefaults() - { - var htmlElement = new WriterElement - { - Format = "Html", - TypeName = "DoddleReport.Writers.HtmlReportWriter, DoddleReport", - ContentType = "text/html", - FileExtension = ".htm" - }; - - var excelElement = new WriterElement - { - Format = "Excel", - TypeName = "DoddleReport.Writers.ExcelReportWriter, DoddleReport", - ContentType = "application/vnd.ms-excel", - FileExtension = ".xls" - }; - - var txtElement = new WriterElement - { - Format = "Delimited", - TypeName = "DoddleReport.Writers.DelimitedTextReportWriter, DoddleReport", - ContentType = "text/plain", - FileExtension = ".txt", - OfferDownload = true - }; - - - BaseAdd(htmlElement); - BaseAdd(txtElement); - BaseAdd(excelElement); - } - - protected override ConfigurationElement CreateNewElement() - { - return new WriterElement(); - } - - protected override object GetElementKey(ConfigurationElement element) - { - return ((WriterElement)element).Format; - } - - public WriterElement GetWriterConfigurationByFormat(string format) - { - var key = - BaseGetAllKeys().OfType().FirstOrDefault( - k => k.Equals(format, StringComparison.OrdinalIgnoreCase)); - - if(key == null) - throw new ArgumentException(string.Format("Unable to locate a ReportWriter Configuration with the format '{0}'. Has this format been registered in web.config?", format)); - - return ((WriterElement)BaseGet(key)); - } - - public WriterElement GetWriterConfigurationForFileExtension(string extension) - { - return - BaseGetAllKeys() - .Cast() - .Where(key => - GetWriterConfigurationByFormat(key).FileExtension.Equals(extension, - StringComparison.InvariantCultureIgnoreCase)) - .Select(GetWriterConfigurationByFormat) - .FirstOrDefault(); - } - - - public IReportWriter GetWriterForFileExtension(string extension) - { - try - { - var writer = Activator.CreateInstance(GetWriterConfigurationForFileExtension(extension).Type) as IReportWriter; - return writer; - } - catch - { - throw new InvalidOperationException(string.Format("Unable to locate report writer by the name of '{0}'")); - } - } - - public IReportWriter GetWriterByName(string name) - { - try - { - var writer = Activator.CreateInstance(GetWriterConfigurationByFormat(name).Type) as IReportWriter; - return writer; - } - catch - { - throw new InvalidOperationException(string.Format("Unable to locate report writer by the name of '{0}'")); - } - } - - - } +using System; +using System.Configuration; +using System.Linq; + +namespace DoddleReport.Configuration +{ + [ConfigurationCollection(typeof(WriterElement), CollectionType = ConfigurationElementCollectionType.AddRemoveClearMap)] + public class WriterElementCollection : ConfigurationElementCollection + { + public WriterElementCollection() + { + AddDefaults(); + } + + public void AddDefaults() + { + var htmlElement = new WriterElement + { + Format = "Html", + TypeName = "DoddleReport.Writers.HtmlReportWriter, DoddleReport", + ContentType = "text/html", + FileExtension = ".htm" + }; + + var excelElement = new WriterElement + { + Format = "Excel", + TypeName = "DoddleReport.Writers.ExcelReportWriter, DoddleReport", + ContentType = "application/vnd.ms-excel", + FileExtension = ".xls" + }; + + var txtElement = new WriterElement + { + Format = "Delimited", + TypeName = "DoddleReport.Writers.DelimitedTextReportWriter, DoddleReport", + ContentType = "text/plain", + FileExtension = ".txt", + OfferDownload = true + }; + + + BaseAdd(htmlElement); + BaseAdd(txtElement); + BaseAdd(excelElement); + } + + protected override ConfigurationElement CreateNewElement() + { + return new WriterElement(); + } + + protected override object GetElementKey(ConfigurationElement element) + { + return ((WriterElement)element).Format; + } + + public WriterElement GetWriterConfigurationByFormat(string format) + { + var key = + BaseGetAllKeys().OfType().FirstOrDefault( + k => k.Equals(format, StringComparison.OrdinalIgnoreCase)); + + if (key == null) + throw new ArgumentException(string.Format("Unable to locate a ReportWriter Configuration with the format '{0}'. Has this format been registered in web.config?", format)); + + return ((WriterElement)BaseGet(key)); + } + + public WriterElement GetWriterConfigurationForFileExtension(string extension) + { + return + BaseGetAllKeys() + .Cast() + .Where(key => + GetWriterConfigurationByFormat(key).FileExtension.Equals(extension, + StringComparison.InvariantCultureIgnoreCase)) + .Select(GetWriterConfigurationByFormat) + .FirstOrDefault(); + } + + + public IReportWriter GetWriterForFileExtension(string extension) + { + try + { + var writer = Activator.CreateInstance(GetWriterConfigurationForFileExtension(extension).Type) as IReportWriter; + return writer; + } + catch + { + throw new InvalidOperationException(string.Format("Unable to locate report writer by the name of '{0}'")); + } + } + + public IReportWriter GetWriterByName(string name) + { + try + { + var writer = Activator.CreateInstance(GetWriterConfigurationByFormat(name).Type) as IReportWriter; + return writer; + } + catch + { + throw new InvalidOperationException(string.Format("Unable to locate report writer by the name of '{0}'")); + } + } + + + } } \ No newline at end of file diff --git a/src/DoddleReport/DoddleReport.csproj b/src/DoddleReport/DoddleReport.csproj index a4b111e..5ca7dfd 100644 --- a/src/DoddleReport/DoddleReport.csproj +++ b/src/DoddleReport/DoddleReport.csproj @@ -1,152 +1,43 @@ - - + + - Debug - AnyCPU - 9.0.30729 - 2.0 - {F08B2994-4D05-423E-A8FE-7D1E8A63472B} - Library - Properties - DoddleReport - DoddleReport - v4.0 - 512 - - - - - - - - - false - - - - - 3.5 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - + netstandard2.0;net4.5.2 + DoddleReport adds tabular reporting over any LINQ Query, IEnumerable, DataTable or SharePoint List, exportable to HTML, PDF, Excel, CSV or your own custom type. + + See DoddleReport.Web for great Web reporting support, and the other DoddleReport packages for even more Report Writers + Matt Hidinger + https://github.com/matthidinger/DoddleReport + doddle.report doddle.reporting doddle reporting pdf excel csv itextsharp abcpdf + false + false + false - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - bin\Release\DoddleReport.XML - - - - - - - - 3.5 + + + + + + 4.4.0 + + + + + + + + + + + + + ..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.1\System.Configuration.dll - + - - - - - - - - - - - Designer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - + + ..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.Drawing.dll + + + - - - - - - - - \ No newline at end of file + diff --git a/src/DoddleReport/DoddleReport.csproj.DotSettings b/src/DoddleReport/DoddleReport.csproj.DotSettings deleted file mode 100644 index 5d56eba..0000000 --- a/src/DoddleReport/DoddleReport.csproj.DotSettings +++ /dev/null @@ -1,2 +0,0 @@ - - True \ No newline at end of file diff --git a/src/DoddleReport/DoddleReport.csproj.ReSharper b/src/DoddleReport/DoddleReport.csproj.ReSharper deleted file mode 100644 index 0d0fcb1..0000000 --- a/src/DoddleReport/DoddleReport.csproj.ReSharper +++ /dev/null @@ -1,5 +0,0 @@ - - - F08B2994-4D05-423E-A8FE-7D1E8A63472B/d:Helpers - - \ No newline at end of file diff --git a/src/DoddleReport/Dynamic/DynamicReportSource.cs b/src/DoddleReport/Dynamic/DynamicReportSource.cs index f5c3203..bb90586 100644 --- a/src/DoddleReport/Dynamic/DynamicReportSource.cs +++ b/src/DoddleReport/Dynamic/DynamicReportSource.cs @@ -1,10 +1,12 @@ -using System.Collections; +#if !NO_DYNAMIC +using System.Collections; using System.Collections.Generic; using System.Dynamic; using System.Linq; namespace DoddleReport { + public static class DynamicReportBuilder { public static IReportSource ToReportSource(this IEnumerable source) @@ -56,4 +58,5 @@ public object GetFieldValue(object dataItem, string fieldName) return di[fieldName]; } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/src/DoddleReport/Helpers/HtmlFormatHelper.cs b/src/DoddleReport/Helpers/HtmlFormatHelper.cs index cf5df8e..cd0ae56 100644 --- a/src/DoddleReport/Helpers/HtmlFormatHelper.cs +++ b/src/DoddleReport/Helpers/HtmlFormatHelper.cs @@ -1,5 +1,4 @@ using System; -using System.Drawing; using System.Text; namespace DoddleReport @@ -14,15 +13,16 @@ public static string ToCss(this ReportStyle style) css.Append(style.Underline ? "text-decoration: underline;" : "text-decoration: none;"); css.Append(style.Italic ? "font-style: italic;" : "font-style: none;"); - if (style.BackColor != Color.White) - { - css.AppendFormat("background-color: {0};", ColorTranslator.ToHtml(style.BackColor)); - } + // TODO: Fix color + //if (style.BackColor != Color.White) + //{ + // css.AppendFormat("background-color: {0};", ColorTranslator.ToHtml(style.BackColor)); + //} - if (style.ForeColor != Color.Black) - { - css.AppendFormat("color: {0};", ColorTranslator.ToHtml(style.ForeColor)); - } + //if (style.ForeColor != Color.Black) + //{ + // css.AppendFormat("color: {0};", ColorTranslator.ToHtml(style.ForeColor)); + //} if (style.FontSize != 8) { diff --git a/src/DoddleReport/Helpers/ReflectionExtensions.cs b/src/DoddleReport/Helpers/ReflectionExtensions.cs index 1393838..f7f932f 100644 --- a/src/DoddleReport/Helpers/ReflectionExtensions.cs +++ b/src/DoddleReport/Helpers/ReflectionExtensions.cs @@ -1,18 +1,54 @@ using System; +using System.Collections.Generic; using System.Linq; using System.Reflection; namespace DoddleReport { - public static class ReflectionExtensions + internal static class ReflectionExtensions { + public static bool _IsEnum(this Type type) + { +#if NETSTANDARD1_5 + return type.GetTypeInfo().IsClass; +#else + return type.IsEnum; +#endif + } + + public static bool _IsGenericType(this Type type) + { +#if NETSTANDARD1_5 + return type.GetTypeInfo().IsGenericType; +#else + return type.IsGenericType; +#endif + } + + public static IEnumerable GetProperties(this Type itemType) + { +#if NETSTANDARD1_5 + return itemType?.GetTypeInfo().GetProperties(BindingFlags.Public | BindingFlags.Instance); +#else + return itemType?.GetProperties(BindingFlags.Public | BindingFlags.Instance); +#endif + } + public static T GetProperty(this object item, string property) { +#if NETSTANDARD1_5 + var pi = item.GetType().GetTypeInfo().GetProperty(property); + if (pi != null) + { + return (T)pi.GetValue(item, null); + } +#else var pi = item.GetType().GetProperty(property); - if(pi != null) + if (pi != null) { return (T)pi.GetValue(item, null); } +#endif return default(T); } @@ -20,7 +56,11 @@ public static T GetProperty(this object item, string property) public static TAttribute GetAttribute(this MemberInfo member) where TAttribute : Attribute { +#if NETSTANDARD1_5 + return member.GetCustomAttributes(inherit: false).FirstOrDefault(); +#else return member.GetCustomAttributes(typeof(TAttribute), false).Cast().FirstOrDefault(); +#endif } /// @@ -51,15 +91,33 @@ public static bool IsNumericType(this Type type) case TypeCode.UInt64: return true; case TypeCode.Object: +#if NETSTANDARD1_5 + if (type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>)) + { + return IsNumericType(Nullable.GetUnderlyingType(type)); + } +#else if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>)) { return IsNumericType(Nullable.GetUnderlyingType(type)); } +#endif return false; } return false; } + + public static Type GetGenericDataType(this Type type) + { +#if NETSTANDARD1_5 + return type.GetTypeInfo().IsGenericType ? type.GetTypeInfo().GetGenericArguments().Single() : type; ; +#else + return type.IsGenericType ? type.GetGenericArguments().Single() : type; +#endif + } } + + } diff --git a/src/DoddleReport/Helpers/StringExtensions.cs b/src/DoddleReport/Helpers/StringExtensions.cs index 73cf848..08160b5 100644 --- a/src/DoddleReport/Helpers/StringExtensions.cs +++ b/src/DoddleReport/Helpers/StringExtensions.cs @@ -1,111 +1,113 @@ -using System; -using System.Collections.Specialized; - -namespace DoddleReport -{ - public static class StringExtensions - { - /// - /// Parse a string into an enumeration - /// - /// The Enumeration type to cast to - /// - /// - public static TEnum ParseEnum(this string source) - { - Type t = typeof(TEnum); - - if (!t.IsEnum) - throw new ArgumentException("TEnum must be a valid Enumeration", "TEnum"); - - return (TEnum)Enum.Parse(t, source); - } - - public static string TrimBefore(this string source, string match) - { - return source.Substring(source.IndexOf(match) + match.Length); - } - - public static string TrimAfter(this string source, string match) - { - return source.Substring(source.IndexOf(match) + match.Length); - } - - public static int NumberOfLines(this string source) - { - if (string.IsNullOrEmpty(source)) - return 0; - - int count = 1; - int start = 0; - while ((start = source.IndexOf(Environment.NewLine, start)) != -1) - { - count++; - start++; - } - return count; - } - - /// - /// Parses a camel cased or pascal cased string and returns a new - /// string with spaces between the words in the string. - /// - /// - /// The string "PascalCasing" will return an array with two - /// elements, "Pascal" and "Casing". - /// - /// - /// - public static string SplitUpperCaseToString(this string source) - { - return string.Join(" ", SplitUpperCase(source)); - } - - - /// - /// Parses a camel cased or pascal cased string and returns an array - /// of the words within the string. - /// - /// - /// The string "PascalCasing" will return an array with two - /// elements, "Pascal" and "Casing". - /// - /// - /// - public static string[] SplitUpperCase(this string source) - { - if (source == null) - return new string[] { }; //Return empty array. - - if (source.Length == 0) - return new string[] { "" }; - - StringCollection words = new StringCollection(); - int wordStartIndex = 0; - - char[] letters = source.ToCharArray(); - - // Skip the first letter. we don't care what case it is. - for (int i = 1; i < letters.Length; i++) - { - if (char.IsUpper(letters[i])) - { - if (i + 1 < letters.Length && !char.IsUpper(letters[i + 1])) - { - //Grab everything before the current index. - words.Add(new String(letters, wordStartIndex, i - wordStartIndex)); - wordStartIndex = i; - } - } - } - - //We need to have the last word. - words.Add(new String(letters, wordStartIndex, letters.Length - wordStartIndex)); - - //Copy to a string array. - string[] wordArray = new string[words.Count]; - words.CopyTo(wordArray, 0); - return wordArray; - } - } -} +using System; +using System.Collections.Generic; +using System.Reflection; + + +namespace DoddleReport +{ + public static class StringExtensions + { + /// + /// Parse a string into an enumeration + /// + /// The Enumeration type to cast to + /// + /// + public static TEnum ParseEnum(this string source) + { + var t = typeof(TEnum); + + if (!t._IsEnum()) + throw new ArgumentException("TEnum must be a valid Enumeration", "TEnum"); + + return (TEnum)Enum.Parse(t, source); + } + + public static string TrimBefore(this string source, string match) + { + return source.Substring(source.IndexOf(match) + match.Length); + } + + public static string TrimAfter(this string source, string match) + { + return source.Substring(source.IndexOf(match) + match.Length); + } + + public static int NumberOfLines(this string source) + { + if (string.IsNullOrEmpty(source)) + return 0; + + int count = 1; + int start = 0; + while ((start = source.IndexOf(Environment.NewLine, start)) != -1) + { + count++; + start++; + } + return count; + } + + /// + /// Parses a camel cased or pascal cased string and returns a new + /// string with spaces between the words in the string. + /// + /// + /// The string "PascalCasing" will return an array with two + /// elements, "Pascal" and "Casing". + /// + /// + /// + public static string SplitUpperCaseToString(this string source) + { + return string.Join(" ", SplitUpperCase(source)); + } + + + /// + /// Parses a camel cased or pascal cased string and returns an array + /// of the words within the string. + /// + /// + /// The string "PascalCasing" will return an array with two + /// elements, "Pascal" and "Casing". + /// + /// + /// + public static string[] SplitUpperCase(this string source) + { + if (source == null) + return new string[] { }; //Return empty array. + + if (source.Length == 0) + return new string[] { "" }; + + var words = new List(); + int wordStartIndex = 0; + + char[] letters = source.ToCharArray(); + + // Skip the first letter. we don't care what case it is. + for (int i = 1; i < letters.Length; i++) + { + if (char.IsUpper(letters[i])) + { + if (i + 1 < letters.Length && !char.IsUpper(letters[i + 1])) + { + //Grab everything before the current index. + words.Add(new String(letters, wordStartIndex, i - wordStartIndex)); + wordStartIndex = i; + } + } + } + + //We need to have the last word. + words.Add(new String(letters, wordStartIndex, letters.Length - wordStartIndex)); + + //Copy to a string array. + string[] wordArray = new string[words.Count]; + words.CopyTo(wordArray, 0); + return wordArray; + } + } +} diff --git a/src/DoddleReport/HorizontalAlignment.cs b/src/DoddleReport/HorizontalAlignment.cs index 10b4891..81b0545 100644 --- a/src/DoddleReport/HorizontalAlignment.cs +++ b/src/DoddleReport/HorizontalAlignment.cs @@ -1,9 +1,9 @@ -namespace DoddleReport -{ - public enum HorizontalAlignment - { - Left, - Right, - Center - } +namespace DoddleReport +{ + public enum HorizontalAlignment + { + Left, + Right, + Center + } } \ No newline at end of file diff --git a/src/DoddleReport/IReportSource.cs b/src/DoddleReport/IReportSource.cs index 50518ad..75b5d9b 100644 --- a/src/DoddleReport/IReportSource.cs +++ b/src/DoddleReport/IReportSource.cs @@ -1,27 +1,27 @@ -using System.Collections; - -namespace DoddleReport -{ - public interface IReportSource - { - /// - /// The fields - /// - /// - ReportFieldCollection GetFields(); - - /// - /// The data items that will be rendered to the report as rows - /// - /// - IEnumerable GetItems(); - - /// - /// Extract the field data from a dataItem - /// - /// - /// - /// - object GetFieldValue(object dataItem, string fieldName); - } -} +using System.Collections; + +namespace DoddleReport +{ + public interface IReportSource + { + /// + /// The fields + /// + /// + ReportFieldCollection GetFields(); + + /// + /// The data items that will be rendered to the report as rows + /// + /// + IEnumerable GetItems(); + + /// + /// Extract the field data from a dataItem + /// + /// + /// + /// + object GetFieldValue(object dataItem, string fieldName); + } +} diff --git a/src/DoddleReport/IReportWriter.cs b/src/DoddleReport/IReportWriter.cs index 3b3651d..4110f2c 100644 --- a/src/DoddleReport/IReportWriter.cs +++ b/src/DoddleReport/IReportWriter.cs @@ -1,10 +1,10 @@ -using System.IO; - -namespace DoddleReport -{ - public interface IReportWriter - { - void WriteReport(Report report, Stream destination); - void AppendReport(Report source, Report destination); - } +using System.IO; + +namespace DoddleReport +{ + public interface IReportWriter + { + void WriteReport(Report report, Stream destination); + void AppendReport(Report source, Report destination); + } } \ No newline at end of file diff --git a/src/DoddleReport/Properties/AssemblyInfo.cs b/src/DoddleReport/Properties/AssemblyInfo.cs index 370bfcc..b283740 100644 --- a/src/DoddleReport/Properties/AssemblyInfo.cs +++ b/src/DoddleReport/Properties/AssemblyInfo.cs @@ -1,34 +1,19 @@ using System.Reflection; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("DoddleReport")] -[assembly: AssemblyDescription("DoddleReport adds tabular reporting over any LINQ Query, IEnumerable, DataTable or SharePoint List, exportable to HTML, PDF, Excel, CSV or your own custom type.\r\n\r\nSee DoddleReport.Web for great Web reporting support, and the other DoddleReport packages for even more Report Writers")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Matt Hidinger")] -[assembly: AssemblyProduct("DoddleReport")] -[assembly: AssemblyCopyright("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("DoddleReport.Core")] [assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("f73558a6-e535-4736-a3d4-d6b6e6ddb095")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.5.2.0")] +[assembly: Guid("05a5c02f-d751-4a21-80bb-0fde1188e48b")] diff --git a/src/DoddleReport/RenderHintsCollection.cs b/src/DoddleReport/RenderHintsCollection.cs index 101477c..b6b9b33 100644 --- a/src/DoddleReport/RenderHintsCollection.cs +++ b/src/DoddleReport/RenderHintsCollection.cs @@ -1,136 +1,136 @@ -using System.Collections.Generic; -using System.Drawing; - -namespace DoddleReport -{ - /// - /// Render hints are passed to each report writer to alter their rendering behavior. Not all render hints are supported in every writer - /// - public class RenderHintsCollection - { - private readonly Dictionary _internal = new Dictionary(); - - public static SizeF DefaultMargins = new SizeF(20f, 20f); - public static SizeF DefaultPageSize = new SizeF(612f, 792f); //default to letter size in points 8.5*72, 11*72 - - public RenderHintsCollection() - { - BooleanCheckboxes = false; - BooleansAsYesNo = false; - Margins = DefaultMargins; - PageSize = DefaultPageSize; - } - - public bool ContainsKey(string hint) - { - return _internal.ContainsKey(hint); - } - - /// - /// Rendering Margins. Specified in Pixels, but may be interpreted different based on the IReportWriter - /// - public SizeF Margins - { - get { return (SizeF)this["Margins"]; } - set { this["Margins"] = value; } - } - - /// - /// Page Size of the document. Use .Width and .Height to specify the Page Size. - /// For PDFs, the unit of measure is in points (72 points = 1 inch), but may be interpreted differently based on the IReportWriter. - /// Example: to set 8.5in x 11in PageSize: report.RenderHints.PageSize = new SizeF(8.5f * 72f, 11f * 72f); - /// - public SizeF PageSize - { - get{ return (SizeF)this["PageSize"];} - set { this["PageSize"] = value; } - } - - /// - /// Boolean fields will render as Yes/No instead of true/false on the reports - /// - public bool BooleansAsYesNo - { - get { return (bool)this["BooleansAsYesNo"]; } - set { this["BooleansAsYesNo"] = value; } - } - - /// - /// Boolean fields will render as Checkboxes in certain report writers - /// - public bool BooleanCheckboxes - { - get { return (bool) this["BooleanCheckboxes"]; } - set { this["BooleanCheckboxes"] = value; } - } - - /// - /// Page numbers will be rendered onto the footer in certain report writers - /// - public bool IncludePageNumbers - { - get { return this["IncludePageNumbers"] as bool? ?? true; } - set { this["IncludePageNumbers"] = value; } - } - - /// - /// Toggle the orientation if the report writer supports it - /// - public ReportOrientation Orientation - { - get - { - return this["Orientation"] as ReportOrientation? ?? ReportOrientation.Portrait; - } - set - { - this["Orientation"] = value; - } - } - - /// - /// Indicates if Freeze Panes is enabled based on current settings of FreezeRows and FreezeColumns - /// - public bool FreezePanes - { - get { return FreezeRows + FreezeColumns > 0; } - } - - /// - /// Freeze rows - /// - public int FreezeRows - { - get { return this["FreezeRows"] as int? ?? 0; } - set { this["FreezeRows"] = value; } - } - - /// - /// Freeze columns - /// - public int FreezeColumns - { - get { return this["FreezeColumns"] as int? ?? 0; } - set { this["FreezeColumns"] = value; } - } - - /// - /// Use this to pass arbitrary render hints to a specific report writer - /// - /// The name of the render hint. The Report Writer must be looking for this hint by name to have any affect - public object this[string hint] - { - get - { - if (!_internal.ContainsKey(hint)) - return null; - - return _internal[hint]; - } - set - { - _internal[hint] = value; - } - } - } +using System.Collections.Generic; +using System.Drawing; + +namespace DoddleReport +{ + /// + /// Render hints are passed to each report writer to alter their rendering behavior. Not all render hints are supported in every writer + /// + public class RenderHintsCollection + { + private readonly Dictionary _internal = new Dictionary(); + + public static SizeF DefaultMargins = new SizeF(20f, 20f); + public static SizeF DefaultPageSize = new SizeF(612f, 792f); //default to letter size in points 8.5*72, 11*72 + + public RenderHintsCollection() + { + BooleanCheckboxes = false; + BooleansAsYesNo = false; + Margins = DefaultMargins; + PageSize = DefaultPageSize; + } + + public bool ContainsKey(string hint) + { + return _internal.ContainsKey(hint); + } + + /// + /// Rendering Margins. Specified in Pixels, but may be interpreted different based on the IReportWriter + /// + public SizeF Margins + { + get { return (SizeF)this["Margins"]; } + set { this["Margins"] = value; } + } + + /// + /// Page Size of the document. Use .Width and .Height to specify the Page Size. + /// For PDFs, the unit of measure is in points (72 points = 1 inch), but may be interpreted differently based on the IReportWriter. + /// Example: to set 8.5in x 11in PageSize: report.RenderHints.PageSize = new SizeF(8.5f * 72f, 11f * 72f); + /// + public SizeF PageSize + { + get{ return (SizeF)this["PageSize"];} + set { this["PageSize"] = value; } + } + + /// + /// Boolean fields will render as Yes/No instead of true/false on the reports + /// + public bool BooleansAsYesNo + { + get { return (bool)this["BooleansAsYesNo"]; } + set { this["BooleansAsYesNo"] = value; } + } + + /// + /// Boolean fields will render as Checkboxes in certain report writers + /// + public bool BooleanCheckboxes + { + get { return (bool) this["BooleanCheckboxes"]; } + set { this["BooleanCheckboxes"] = value; } + } + + /// + /// Page numbers will be rendered onto the footer in certain report writers + /// + public bool IncludePageNumbers + { + get { return this["IncludePageNumbers"] as bool? ?? true; } + set { this["IncludePageNumbers"] = value; } + } + + /// + /// Toggle the orientation if the report writer supports it + /// + public ReportOrientation Orientation + { + get + { + return this["Orientation"] as ReportOrientation? ?? ReportOrientation.Portrait; + } + set + { + this["Orientation"] = value; + } + } + + /// + /// Indicates if Freeze Panes is enabled based on current settings of FreezeRows and FreezeColumns + /// + public bool FreezePanes + { + get { return FreezeRows + FreezeColumns > 0; } + } + + /// + /// Freeze rows + /// + public int FreezeRows + { + get { return this["FreezeRows"] as int? ?? 0; } + set { this["FreezeRows"] = value; } + } + + /// + /// Freeze columns + /// + public int FreezeColumns + { + get { return this["FreezeColumns"] as int? ?? 0; } + set { this["FreezeColumns"] = value; } + } + + /// + /// Use this to pass arbitrary render hints to a specific report writer + /// + /// The name of the render hint. The Report Writer must be looking for this hint by name to have any affect + public object this[string hint] + { + get + { + if (!_internal.ContainsKey(hint)) + return null; + + return _internal[hint]; + } + set + { + _internal[hint] = value; + } + } + } } \ No newline at end of file diff --git a/src/DoddleReport/Report.cs b/src/DoddleReport/Report.cs index faa62ca..78fa5ce 100644 --- a/src/DoddleReport/Report.cs +++ b/src/DoddleReport/Report.cs @@ -1,220 +1,220 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; - -namespace DoddleReport -{ - /// - /// A report consists of the ReportSource, TextFields, RenderHints that are used by an IReportWriter to render the report - /// - public class Report - { - private readonly ReportTextFieldCollection _textFields = new ReportTextFieldCollection(); - private readonly RenderHintsCollection _renderHints = new RenderHintsCollection(); - private readonly Dictionary _totals = new Dictionary(); - private readonly Dictionary _lambdas = new Dictionary(); - - public Report() : this(null, null) - { - } - - /// - /// Create a new report by using a specific report source - /// - /// The data for the report - public Report(IReportSource source) : this(source, null) - { - - } - - /// - /// Create a new report by using a specific report source and report writer - /// - /// The data for the report - /// The type of writer used to render the report - public Report(IReportSource source, IReportWriter writer) - { - if (source != null) - { - _source = source; - DataFields = source.GetFields() ?? new ReportFieldCollection(); - } - - Writer = writer; - } - - private IReportSource _source; - - /// - /// The data for the report - /// - public IReportSource Source - { - get - { - return _source; - } - set - { - _source = value; - DataFields = _source.GetFields(); - } - } - - /// - /// The writer that should be used to render the report. - /// - public IReportWriter Writer { get; set; } - - /// - /// The columns of data returned from the report source. They may be customized by using the indexer of this property. - /// - public ReportFieldCollection DataFields { get; set; } - - /// - /// This event is fired before a row is rendered, allowing some customization of the data - /// - public event EventHandler RenderingRow; - - /// - /// Text fields are passed to the report writers to render the data as they see fit - /// - public ReportTextFieldCollection TextFields - { - get { return _textFields; } - } - - /// - /// Render hints are passed to each report writer to alter their rendering behavior. Not all render hints are supported in every writer - /// - public RenderHintsCollection RenderHints - { - get { return _renderHints; } - } - - protected virtual void OnRowRendering(ReportRowEventArgs e) - { - var handler = RenderingRow; - if (handler != null) - { - handler(this, e); - } - } - - - public virtual ReportRowCollection GetRows() - { - var rows = new ReportRowCollection(this); - rows.RowAdding += RenderingRow; - - var headerRow = new ReportRow(this, ReportRowType.HeaderRow, null); - rows.Add(headerRow); - - foreach (var dataItem in Source.GetItems()) - { - var row = new ReportRow(this, ReportRowType.DataRow, dataItem); - AddTotalsIfRowSupports(row); - rows.Add(row); - } - - AddFooterRow(rows); - - return rows; - } - - /// - /// Write the report to a stream using the specified report writer - /// - /// - public void WriteReport(Stream destination) - { - if (Source == null) - throw new InvalidOperationException("You must assign a valid Source before Writing the report"); - - if (Writer == null) - throw new InvalidOperationException("You must assign a valid Writer before Writing the report"); - - //AddTotalsIfRowSupports(dataRow, row); - - Writer.WriteReport(this, destination); - } - - /// - /// Append a report to another. This only works for certain report writers and both reports must be using the same report writer. - /// - /// - public void AppendReport(Report report) - { - report.Writer = Writer; - report.Writer.AppendReport(this, report); - } - - private void AddFooterRow(ReportRowCollection rows) - { - if (_totals.Count == 0) return; - - var footerRow = new ReportRow(this, ReportRowType.FooterRow, null); - foreach (var total in _totals) - { - footerRow[total.Key] = string.Format(total.Key.DataFormatString, total.Value); - } - - foreach (var field in DataFields.Where(field => !string.IsNullOrEmpty(field.FooterText))) - { - footerRow[field.Name] = field.FooterText; - } - - rows.Add(footerRow); - } - - private void AddTotalsIfRowSupports(ReportRow row) - { - foreach (var field in row.Fields) - { - if (field.ShowTotals && field.DataType.IsNumericType()) - { - var numericType = field.DataType.IsGenericType ? field.DataType.GetGenericArguments().Single() : field.DataType; - var addFieldTotalMethod = typeof(Report).GetMethod("AddFieldTotal", BindingFlags.Instance | BindingFlags.NonPublic).MakeGenericMethod(numericType); - object value = row[field]; - if (value as string == string.Empty) - { - value = null; - } - - addFieldTotalMethod.Invoke(this, new object[] { field, value }); - } - } - } - - private void AddFieldTotal(RowField field, Nullable value) where T : struct - { - var numericValue = value != null ? value.Value : default(T); - if (_totals.ContainsKey(field)) - { - Func lambda; - if (!_lambdas.ContainsKey(typeof(T))) - { - var firstParam = Expression.Parameter(typeof(T), "x"); - var secondParam = Expression.Parameter(typeof(T), "y"); - lambda = Expression.Lambda>(Expression.Convert(Expression.Add(firstParam, secondParam), typeof(T)), firstParam, secondParam).Compile(); - _lambdas.Add(typeof(T), lambda); - } - else - { - lambda = (Func)_lambdas[typeof(T)]; - } - - var currentValue = (T)_totals[field]; - object result = (object)lambda(currentValue, numericValue); - _totals[field] = result; - } - else - { - _totals[field] = numericValue; - } - } - } +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; + +namespace DoddleReport +{ + /// + /// A report consists of the ReportSource, TextFields, RenderHints that are used by an IReportWriter to render the report + /// + public class Report + { + private readonly ReportTextFieldCollection _textFields = new ReportTextFieldCollection(); + private readonly RenderHintsCollection _renderHints = new RenderHintsCollection(); + private readonly Dictionary _totals = new Dictionary(); + private readonly Dictionary _lambdas = new Dictionary(); + + public Report() : this(null, null) + { + } + + /// + /// Create a new report by using a specific report source + /// + /// The data for the report + public Report(IReportSource source) : this(source, null) + { + + } + + /// + /// Create a new report by using a specific report source and report writer + /// + /// The data for the report + /// The type of writer used to render the report + public Report(IReportSource source, IReportWriter writer) + { + if (source != null) + { + _source = source; + DataFields = source.GetFields() ?? new ReportFieldCollection(); + } + + Writer = writer; + } + + private IReportSource _source; + + /// + /// The data for the report + /// + public IReportSource Source + { + get + { + return _source; + } + set + { + _source = value; + DataFields = _source.GetFields(); + } + } + + /// + /// The writer that should be used to render the report. + /// + public IReportWriter Writer { get; set; } + + /// + /// The columns of data returned from the report source. They may be customized by using the indexer of this property. + /// + public ReportFieldCollection DataFields { get; set; } + + /// + /// This event is fired before a row is rendered, allowing some customization of the data + /// + public event EventHandler RenderingRow; + + /// + /// Text fields are passed to the report writers to render the data as they see fit + /// + public ReportTextFieldCollection TextFields + { + get { return _textFields; } + } + + /// + /// Render hints are passed to each report writer to alter their rendering behavior. Not all render hints are supported in every writer + /// + public RenderHintsCollection RenderHints + { + get { return _renderHints; } + } + + protected virtual void OnRowRendering(ReportRowEventArgs e) + { + var handler = RenderingRow; + if (handler != null) + { + handler(this, e); + } + } + + + public virtual ReportRowCollection GetRows() + { + var rows = new ReportRowCollection(this); + rows.RowAdding += RenderingRow; + + var headerRow = new ReportRow(this, ReportRowType.HeaderRow, null); + rows.Add(headerRow); + + foreach (var dataItem in Source.GetItems()) + { + var row = new ReportRow(this, ReportRowType.DataRow, dataItem); + AddTotalsIfRowSupports(row); + rows.Add(row); + } + + AddFooterRow(rows); + + return rows; + } + + /// + /// Write the report to a stream using the specified report writer + /// + /// + public void WriteReport(Stream destination) + { + if (Source == null) + throw new InvalidOperationException("You must assign a valid Source before Writing the report"); + + if (Writer == null) + throw new InvalidOperationException("You must assign a valid Writer before Writing the report"); + + //AddTotalsIfRowSupports(dataRow, row); + + Writer.WriteReport(this, destination); + } + + /// + /// Append a report to another. This only works for certain report writers and both reports must be using the same report writer. + /// + /// + public void AppendReport(Report report) + { + report.Writer = Writer; + report.Writer.AppendReport(this, report); + } + + private void AddFooterRow(ReportRowCollection rows) + { + if (_totals.Count == 0) return; + + var footerRow = new ReportRow(this, ReportRowType.FooterRow, null); + foreach (var total in _totals) + { + footerRow[total.Key] = string.Format(total.Key.DataFormatString, total.Value); + } + + foreach (var field in DataFields.Where(field => !string.IsNullOrEmpty(field.FooterText))) + { + footerRow[field.Name] = field.FooterText; + } + + rows.Add(footerRow); + } + + private void AddTotalsIfRowSupports(ReportRow row) + { + foreach (var field in row.Fields) + { + if (field.ShowTotals && field.DataType.IsNumericType()) + { + var numericType = field.DataType.GetGenericDataType(); + var addFieldTotalMethod = typeof(Report).GetMethod("AddFieldTotal", BindingFlags.Instance | BindingFlags.NonPublic).MakeGenericMethod(numericType); + object value = row[field]; + if (value as string == string.Empty) + { + value = null; + } + + addFieldTotalMethod.Invoke(this, new object[] { field, value }); + } + } + } + + private void AddFieldTotal(RowField field, Nullable value) where T : struct + { + var numericValue = value != null ? value.Value : default(T); + if (_totals.ContainsKey(field)) + { + Func lambda; + if (!_lambdas.ContainsKey(typeof(T))) + { + var firstParam = Expression.Parameter(typeof(T), "x"); + var secondParam = Expression.Parameter(typeof(T), "y"); + lambda = Expression.Lambda>(Expression.Convert(Expression.Add(firstParam, secondParam), typeof(T)), firstParam, secondParam).Compile(); + _lambdas.Add(typeof(T), lambda); + } + else + { + lambda = (Func)_lambdas[typeof(T)]; + } + + var currentValue = (T)_totals[field]; + object result = (object)lambda(currentValue, numericValue); + _totals[field] = result; + } + else + { + _totals[field] = numericValue; + } + } + } } \ No newline at end of file diff --git a/src/DoddleReport/ReportBuilder.cs b/src/DoddleReport/ReportBuilder.cs index b86aa4d..fdaa7ef 100644 --- a/src/DoddleReport/ReportBuilder.cs +++ b/src/DoddleReport/ReportBuilder.cs @@ -12,15 +12,11 @@ public static IReportSource ToReportSource(this IEnumerable source) return new EnumerableReportSource(source); } - public static IReportSource ToReportSource(this DataTable table) - { - return new DataTableReportSource(table); - } - public static Report ToReport(this IReportSource source, string format) { - var writer = Config.Report.Writers.GetWriterByName(format); - return new Report(source, writer); + // TODO: Get a Writer + //var writer = Config.Report.Writers.GetWriterByName(format); + return new Report(source, null); } public static Report ToReport(this IEnumerable source, string format) diff --git a/src/DoddleReport/ReportSources/DataTableReportSource.cs b/src/DoddleReport/ReportSources/DataTableReportSource.cs index edb9084..ffec811 100644 --- a/src/DoddleReport/ReportSources/DataTableReportSource.cs +++ b/src/DoddleReport/ReportSources/DataTableReportSource.cs @@ -35,4 +35,4 @@ public object GetFieldValue(object dataItem, string fieldName) return row[fieldName]; } } -} +} \ No newline at end of file diff --git a/src/DoddleReport/ReportSources/EnumerableReportSource.cs b/src/DoddleReport/ReportSources/EnumerableReportSource.cs index 84862f3..786c2e8 100644 --- a/src/DoddleReport/ReportSources/EnumerableReportSource.cs +++ b/src/DoddleReport/ReportSources/EnumerableReportSource.cs @@ -4,6 +4,7 @@ using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Linq; + using System.Reflection; namespace DoddleReport.ReportSources @@ -18,21 +19,13 @@ public class EnumerableReportSource : IReportSource public IEnumerable Source { get; set; } - private static IEnumerable GetProperties(Type itemType) - { - if (itemType == null) - return null; - - return itemType.GetProperties(BindingFlags.Public | BindingFlags.Instance); - } - private Type GetItemType() { // If the list implements IEnumerable get the type from the generic // declaration so that we don't query the a query that could take // some time to connect var itemType = (from i in Source.GetType().GetInterfaces() - where i.IsGenericType && + where i._IsGenericType() && i.GetGenericTypeDefinition() == typeof(IEnumerable<>) select i.GetGenericArguments().Single()).SingleOrDefault(); @@ -57,7 +50,7 @@ public ReportFieldCollection GetFields() { var fields = new ReportFieldCollection(); var itemType = GetItemType(); - var properties = GetProperties(itemType); + var properties = itemType.GetProperties(); if (properties == null) return fields; @@ -103,17 +96,18 @@ public object GetFieldValue(object dataItem, string fieldName) /// The order number for the field. private static int SetReportFieldProperties(Type itemType, PropertyInfo propInfo, ReportField reportField) { - var metadataTypeAttribute = itemType.GetAttribute(); + // TODO: Light up MetadataTypeAttribute + //var metadataTypeAttribute = itemType.GetTypeInfo().GetAttribute(); MemberInfo memberInfo; - if (metadataTypeAttribute != null) - { - memberInfo = itemType.GetProperty(propInfo.Name, BindingFlags.Public | BindingFlags.Instance) ?? - (MemberInfo) itemType.GetField(propInfo.Name, BindingFlags.Public | BindingFlags.Instance); - } - else - { + //if (metadataTypeAttribute != null) + //{ + // memberInfo = itemType.GetProperty(propInfo.Name, BindingFlags.Public | BindingFlags.Instance) ?? + // (MemberInfo) itemType.GetField(propInfo.Name, BindingFlags.Public | BindingFlags.Instance); + //} + //else + //{ memberInfo = propInfo; - } + //} if (memberInfo != null) { @@ -124,12 +118,12 @@ private static int SetReportFieldProperties(Type itemType, PropertyInfo propInfo reportField.FormatAs(o => o != null ? string.Format(displayFormatAttribute.DataFormatString, o) : displayFormatAttribute.NullDisplayText); } - - var displayNameAttribute = memberInfo.GetAttribute(); - if (displayNameAttribute != null) - { - reportField.HeaderText = displayNameAttribute.DisplayName; - } + // TODO: Wire up DisplayNameAttribute + //var displayNameAttribute = memberInfo.GetAttribute(); + //if (displayNameAttribute != null) + //{ + // reportField.HeaderText = displayNameAttribute.DisplayName; + //} #if !NET35 var displayAttribute = memberInfo.GetAttribute(); diff --git a/src/DoddleReport/SharePoint/SPListReportSource.cs b/src/DoddleReport/SharePoint/SPListReportSource.cs deleted file mode 100644 index 8de4f3e..0000000 --- a/src/DoddleReport/SharePoint/SPListReportSource.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System.Collections; -using System.Collections.Generic; - -namespace DoddleReport.SharePoint -{ - public class SPListReportSource : IReportSource - { - public SPList List { get; set; } - public SPQuery Query { get; set; } - protected List CustomFields { get; set; } - - public SPListReportSource(string listName) - { - List = SharePointUtility.CurrentWeb.Lists[listName]; - CustomFields = ListUtility.GetCustomFields(List); - } - - public ReportFieldCollection GetFields() - { - var fields = new ReportFieldCollection(); - foreach (SPField field in CustomFields) - { - fields.Add(field.Title, field.FieldValueType); - } - return fields; - } - - public IEnumerable GetItems() - { - SPListItemCollection items; - - if (Query != null) - { - items = List.GetItems(Query); - } - else - { - items = List.Items; - } - - return items; - } - - public object GetFieldValue(object dataItem, string fieldName) - { - if (dataItem == null) - return string.Empty; - - SPListItem listItem = dataItem as SPListItem; - - if ((listItem == null) || (!listItem.Fields.ContainsField(fieldName))) - return string.Empty; - - return listItem.GetFormattedValue(fieldName); - } - } -} diff --git a/test/DoddleReport.Core.Tests/Class1.cs b/test/DoddleReport.Core.Tests/Class1.cs new file mode 100644 index 0000000..00cfd47 --- /dev/null +++ b/test/DoddleReport.Core.Tests/Class1.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace DoddleReport.Core.Tests +{ + // This project can output the Class library as a NuGet Package. + // To enable this option, right-click on the project and select the Properties menu item. In the Build tab select "Produce outputs on build". + public class Class1 + { + public Class1() + { + } + } +} diff --git a/test/DoddleReport.Core.Tests/DoddleReport.Core.Tests.csproj b/test/DoddleReport.Core.Tests/DoddleReport.Core.Tests.csproj new file mode 100644 index 0000000..9491ecf --- /dev/null +++ b/test/DoddleReport.Core.Tests/DoddleReport.Core.Tests.csproj @@ -0,0 +1,25 @@ + + + + netcoreapp1.0 + DoddleReport.Core.Tests + DoddleReport.Core.Tests + true + $(PackageTargetFallback);dnxcore50;portable-net45+win8 + 1.0.4 + false + false + false + + + + + + + + + + + + + diff --git a/test/DoddleReport.Core.Tests/Properties/AssemblyInfo.cs b/test/DoddleReport.Core.Tests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..9e6ec67 --- /dev/null +++ b/test/DoddleReport.Core.Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,19 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("DoddleReport.Core.Tests")] +[assembly: AssemblyTrademark("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("1bb2ed1b-4ae0-46ea-b8fb-c8c984d01326")]