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

String with numbers and slashes, wrong in Excel



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.


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?



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?