matthidinger / doddlereport Goto Github PK
View Code? Open in Web Editor NEWGenerate custom reports (PDF, Excel, etc) from any IEnumerable datasource.
License: MIT License
Generate custom reports (PDF, Excel, etc) from any IEnumerable datasource.
License: MIT License
Is it possible to have quotation marks around the header column value?
How to create multiple sheets based on multiple data sources in the excel report?
For example, I have 10 data sources. How to create 10 worksheets in an excle from these 10 data sources?
No idea what's going on here. I think it could be this file not being in master:
https://github.com/matthidinger/DoddleReport/blob/corefx/global.json
Will try to attach examples later
This is when opening with Google Sheets
Hello
I've used your lib ... it works OK with MVC 4, using web lib only
when changed to PDF using iTextSharp, arabic words not appears at all !!!
would you inspect that ??
return new ReportResult(report, new PdfReportWriter());
---> no arabic words
return new ReportResult(report);
---> works fine
I can't figure out where in the documentation this is set.
When I upgraded my DoddleReport package from 1.4.0 to 1.5.1, a MissingMethodException was raised when creating a ReportResult object to create a PDF file:
Method not found: Void iTextShap.text.pdf.PdfPTable.AddCell(iTextShap.text.pdf.PdfPCell)
Creating HTML and OpenXML files works fine. Downgrading to 1.4.0 solved the problem again. This is my code:
using DoddleReport;
using DoddleReport.Web;
using DoddleReport.Writers;
namespace InPRC.Repositories
{
public class Reports : GenericRepository<InPrcReport>
{
public ReportResult Generate(InPrcReport report, IQueryable<InputCombination> queryPrep)
{
List<InPrcReportRow> myList = queryPrep.[Blablabla].ToList();
var doddle = new Report(myList.ToReportSource());
doddle.TextFields.SubTitle = "InPRC Report";
doddle.TextFields.Title = report.Name;
doddle.TextFields.Footer = [Blablabla];
doddle.TextFields.Header = string.Format([Blablabla],
report.Columns,
DateTime.Now.ToShortDateString(),
report.Start.ToShortDateString(),
report.Description);
foreach (var datafield in doddle.DataFields)
datafield.Hidden = true;
foreach (var column in report.ColumnsCollection)
{
doddle.DataFields[column].Hidden = false;
doddle.DataFields[column].HeaderText = this.GetLocalString(column);
}
foreach (var row in report.RowsCollection)
{
doddle.DataFields[row].Hidden = false;
doddle.DataFields[row].HeaderText = this.GetLocalString(row);
}
string fileName;
switch (report.Format)
{
case "Excel":
doddle.Writer = new DoddleReport.OpenXml.ExcelReportWriter();
fileName = report.Name + ".xlsx";
break;
case "PDF":
doddle.Writer = new DoddleReport.iTextSharp.PdfReportWriter();
fileName = report.Name + ".pdf";
break;
default:
doddle.Writer = new HtmlReportWriter();
fileName = report.Name + ".htm";
break;
}
return new ReportResult(doddle) { FileName = fileName };
}
}
}
CodeProject URLs do not work/do not exist/return file not found error pages.
Is it possible to wrap the text in excel report using Openxml writer?
There was a breaking change in ClosedXML 0.91.0
Instead of ClosedXML.Excel.IXLCell.SetDataType(XLCellValue)
you now need to use ClosedXML.Excel.IXLCell.SetDataType(XLDataType)
Because of this DoddleReport.OpenXml.ExcelReportWriter.WriteReport doesn't work.
I would like code to work more like this:
public class ProductReport : Report<Product>
{
ProductReport()
{
DataField(x => x.UnitPrice) // this automatically infers it is a number,
// and automatically applies DataStyle.HorizontalAlignment = HorizontalAlignment.Right
.WithHeader(x => x.Text.Replace("Unit",string.Empty)) // remove "Unit" from "UnitPrice"
.WithData(x => {
x.AsMoney(); // automatically applies horizontalalignment.right and DataFormatString = "{0:C"}
x.Style.HorizontalAlignment = HorizontalAlignment.Right; // again, less typing
})
.BuildIt(); // converts Expression tree to Report instance variables
}
}
What is the DataFormatString value for actual value ? I mean I want to see the column value as it is entered on the source. By default the category is "General" but it displays long value as Scientific and it does not display the value as it is entered.
Need your help. Thanks
Update examples to use nameof(Class.FieldName)
instead of hard-coded strings:
See my code review here:
d68c344#r30912841
Fix:
report.DataFields[nameof(Product.Price)].DataFormatString = "{0:c}";
report.DataFields[nameof(LastPurchase)].DataFormatString = "{0:d}";
Hi there,
I need change Tittle and Subtitle style to " Horizontal Align Left". How can I do this?
Tks
I want headers that look like this:
A B C D E
.-------------------------------------------------------------------------------.
1 | | From | 2018-09-01 | Projects | All |
2 | Time frame | To | 2018-09-30 | People | All |
--------------------------------------------------------------------------------
3 | Generated | 2018-10-15 19:27:02 | Grouped by | |
'---------------'------------------------------------------'--------------'-----'
I thought the below code would add columns with spaces but is doesnt. Is there a way to accomplish this? The column is always "TeamName".
var item = new ExpandoObject() as IDictionary<string, Object>;
item.Add("Team Name","Elite");
This is blocked by #13 , since ClosedXML 0.68.1 doesn't support save well.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.