#310 report.php with all changes

open
nobody
None
1
2012-11-24
2012-11-22
Anonymous
No

Hello,

can someone e-mailed the current report.php with any changes?

In version 1.4.9 there are line breaks in the csv export.

Thank you

Stefan

Discussion

  • Campbell Morrison

    Can you give some more details? Are the line breaks in the header row or the data?

    Campbell

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2012-11-23

    Hi Campbell,

    the problem is in the data. If the description of a new line is entered, then I have in Excel 2003 when importing csv files also a line break, and the columns are clearly displayed with each other.

    Here's an example, see pdf-file. The yellow cells contain a line break and then move up one line. Thus, the messages are written in red all wrong.

    The line in turquoise are the column names and the orange cell is correct.

    I hope you recognize the problem. in the report.csv i don t need ja line break.

    What better place to filter out the line breaks in the string from the description?

    greeting
    Stefan

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2012-11-24

    I solved the problem for me as follows:

    I added the following line:
    $string = str_replace(array("\r\n","\n\r", "\n", "\r"), ' ', $string);

    see source code


    function escape($string)
    {
    global $output_format;

    switch ($output_format)
    {
    case OUTPUT_HTML:
    $string = mrbs_nl2br(htmlspecialchars($string));
    break;
    case OUTPUT_CSV:
    // $string = analyzer ($string);
    // var_dump(analyzer ($string));
    $string = str_replace('"', '""', $string);
    ----> $string = str_replace(array("\r\n","\n\r", "\n", "\r"), ' ', $string); // NEW replace line break

      // echo "$string <br>";
      break;
    default:  // do nothing
      break;
    

    }

    return $string;
    }

     


Anonymous

Cancel  Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks