Uploaded image for project: 'Pentaho Reporting and Pentaho Report Designer'
  1. Pentaho Reporting and Pentaho Report Designer
  2. PRD-4917

End of line of non unix on TextFilePrinterDriver.java

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Severity: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.2.0 GA
    • Component/s: Report Generation
    • Labels:
    • Notice:
      When an issue is open, the "Fix Version/s" field conveys a target, not necessarily a commitment. When an issue is closed, the "Fix Version/s" field conveys the version that the issue was fixed in.

      Description

      I get a weird result of report exported in plain text when viewing on text editor. It shows an additional new line in every line. As I inspect source code deeply, this part of code catch my attention :

      https://github.com/pentaho/pentaho-reporting/blob/feddb89533e977b7550ec37aeaa576afba8ad052/engine/core/source/org/pentaho/reporting/engine/classic/core/modules/output/pageable/plaintext/driver/TextFilePrinterDriver.java#L62-63

      According to that code, end of line for non unix is LF+CR. Is that true?

      To fix my case, I change the code to CR+LF:

      if (unixEndOfLine == false)
      {
        this.endOfLine = new char[]{PrinterDriverCommands.CARRIAGE_RETURN,
            PrinterDriverCommands.LINE_FEED};
        this.endOfPage = new char[]{PrinterDriverCommands.CARRIAGE_RETURN,
            PrinterDriverCommands.LINE_FEED,
            PrinterDriverCommands.FORM_FEED};
      }
      

      Please consider this thought. Thank you

        Attachments

          Activity

            People

            Assignee:
            gdavid Golda Thomas
            Reporter:
            phai Fahri Nurul Hidayat
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: