Announcement

Collapse
No announcement yet.

PHPJasperXML regional settings (decimal point)

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • PHPJasperXML regional settings (decimal point)

    Hi all,

    I'm trying to help a customer to use PHPJasperXML. Was discussed this lib in the past http://www.scriptcase.net/forum/show...t=nice+reports

    I have a PHP script, on my SC server, and when called it uses PHPJasperXML to create a PDF report (using TCPDF), but decimal point don't shows as we want (here, decimal point is , instead .)
    But if I create a ReportPDF application (using TCPDF), it changes correctly decimal point.

    The problem I find, is I can't get PHPJasperXML generates PDF with correct decimal point. I thought was something related to regional settings, but If I create in SC a ReportPDF (it uses TCPDF too), decimal points are correct.

    It suppose it will take system regional settings, but each script do different things. What do SC thath don't do PHPJasperXML?

    Regards.

    EDIT:

    It's incredible, in this days, thath PHP don't have a powerfull free/opensource reporting engine like Jasper or something like this.
    Last edited by Giu; 06-02-2015, 01:12 PM.
    /Giuseppe

    Professional Scriptcase Services
    Some Customers opinions

  • #2
    As described in the docs PHPJasperXML does not do any number formatting.
    You have to use the db for this but it's not a big deal.

    Since I use MySQL here is my take on it.

    MySQL >= 5.5: SELECT FORMAT(total, 2, 'de_DE') AS total FROM ...

    MySQL < 5.5: SELECT REPLACE(CAST(total AS CHAR), ',', '.') AS total FROM ...

    jsb

    Comment


    • #3
      SQL is inside report. And executed from iReport works, when called from PHPJasperXML, still using . (dot) as decimal
      /Giuseppe

      Professional Scriptcase Services
      Some Customers opinions

      Comment


      • #4
        You just use iReport to design your report and create the jxml file. Otherwise it has nothing to do with PHPJasperXML.
        The SQL statement (with the changes stated above) must be passed as a parameter into PHPJasperXML.
        Because it's working in iReport doesn't mean anything. Copy the SQL statement from iReport, make the necessary changes to it and pass it
        to PHPJasperXML as described in the samples.

        jsb

        Comment

        Working...
        X