This project has moved and is read-only. For the latest updates, please go here.
1
Vote

String with numbers and slashes, wrong in Excel

description

Hi

When you have a string, consisting of numbers and slashes, it shows up wrong in Excel when using DoddleReport.OpenXml.ExcelReportWriter (and also DoddleReport.Writers.ExcelReportWriter).

Example, I have a string that tells the Service Window. Possible options are "24/5" and "24/7". They show up fine in PDF, HTML and TXT but not in XLS or XLSL.

In excel they are converted to dates and I can't find a way to tell DoddelReport to keep it as a String.

Image

Code I am using:
        public ReportResult Services()
        {
            var services = db.Services.Where(a => a.Active.Equals(true));
            var report = new Report(services.ToReportSource());

            report.TextFields.Title = "Service Report";
            report.TextFields.SubTitle = "This is a report showing all the services.";
            report.TextFields.Footer = DateTime.Now.Year;
            report.TextFields.Header = string.Format(@"
                Report Generated: {0}
                Total Services: {1}",
                DateTime.Now, services.Count());

            report.RenderHints.BooleanCheckboxes = true;
            report.RenderHints.Orientation = ReportOrientation.Landscape;

            return new ReportResult(report);
        }
All fields in the class 'Service' are Strings.

Am I missing something?

Thanks!

comments

maboivin wrote Nov 7, 2013 at 6:37 PM

I'm experiencing the same behavior with one of my reports. Did you manage to fix it, or did you find a workaround?