GithubHelp home page GithubHelp logo

matthidinger / doddlereport Goto Github PK

View Code? Open in Web Editor NEW
129.0 129.0 40.0 18.04 MB

Generate custom reports (PDF, Excel, etc) from any IEnumerable datasource.

License: MIT License

Batchfile 0.42% C# 91.90% CSS 2.38% ASP 2.54% Pascal 2.76%

doddlereport's People

Contributors

matthidinger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

doddlereport's Issues

Arabic language not appears when using iTextSharp

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

MissingMethodException with latest version

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 };
        }
    }
}

Fluent API for working with data types

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
    }
}

Display value as entered

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

Change Title style

Hi there,

I need change Tittle and Subtitle style to " Horizontal Align Left". How can I do this?

Tks

Re-usable Header Templates

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 |     |
    '---------------'------------------------------------------'--------------'-----'


DoddleReport and header column spaces

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");

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.