Announcement

Collapse
No announcement yet.

Nice lookin' reports

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

  • #46
    I'm using version 0.9c, it's WORK..... very nice....,

    Comment


    • #47
      i have same proble

      Warning: simplexml_load_file(): I/O warning : failed to load external entity "/scriptcase/app/AddAcc/report/prova.jrxml" in C:\Program Files (x86)\NetMake\v71\wwwroot\scriptcase\app\AddAcc\re port\sample1.php on line 14 TCPDF ERROR: Some data has already been output, can't send PDF file


      which is the solution??

      thnsk
      Last edited by marcov; 03-24-2014, 11:42 AM.

      Comment


      • #48
        Hi Marcov,
        I do not remember exactly . For your help I paste here the index.php content and the button code that call the report

        <?php
        session_start();

        include_once('class/tcpdf/tcpdf.php');
        include_once('class/PHPJasperXML.inc.php');

        $xml = simplexml_load_file($_SESSION['report']['xml_file']); //variable for jrxml file
        //$xml = simplexml_load_file("../z_ireport_class/gartes.jrxml");

        $PHPJasperXML = new PHPJasperXML();

        //$PHPJasperXML->debugsql=true;

        $PHPJasperXML->arrayParameter=array('pdf_query'=>$_SESSION['report']['pdf_query']); //variable for sql statement
        $PHPJasperXML->xml_dismantle($xml);

        $PHPJasperXML->transferDBtoArray($_SESSION['report']['host'],
        $_SESSION['report']['user'],
        $_SESSION['report']['pass'],
        $_SESSION['report']['db']);
        $PHPJasperXML->outpage("I"); //page output method I:standard output Download file
        ?>

        ==============================

        if(!isset($_SESSION['report']))
        {
        $_SESSION['report']=array('host'=>[sc_glo_servidor],'user'=>[sc_glo_usuario],'pass'=>sc_decode([sc_glo_senha]),
        'db'=>[sc_glo_banco],'pdf_query'=>'','xml_file'=>'');
        }

        $pdf_query = 'SELECT * FROM gartes';
        $xml_file='gartes.jrxml';

        //$_SESSION['report']['xml_file']=$xml_file;
        $_SESSION['report']['xml_file']="../z_ireport_class/".$xml_file;

        $_SESSION['report']['pdf_query']=$pdf_query;


        sc_redir(../z_ireport_class/index.php);

        Comment


        • #49
          sono italiano lo sei anche tu?

          ho sempre lo stesso errore

          Warning: simplexml_load_file(): I/O warning : failed to load external entity "/scriptcase/app/AddAcc/report/prova.jrxml" in C:\Program Files (x86)\NetMake\v71\wwwroot\scriptcase\app\AddAcc\re port\sample1.php on line 10 TCPDF ERROR: Some data has already been output, can't send PDF file

          Comment


          • #50
            very good examples. Already in productions but...
            How about Subreports with phpjasperxml?
            Anyone had success with that?
            I'm getting crazy
            Giorgio Bravi
            Dolphin Software & Thinkware
            www.dolphin.it

            Comment


            • #51
              Hi,
              With the Phpjasperxml library, It seems many properties of elements in an ireport design cannot be apply when i export to pdf file. Eg: I set the 'vertical alignment' text property of my static text is 'middle' and preview it from ireport, it ok. But when i export to pdf nothing happen, the position of my static text not change.

              That's just one of the problems I encountered when outputting to PDF.
              Add one more eg: I define a new style in ireport to make alternate row background colors like this:

              <style name="Zebra" mode="Transparent">
              <conditionalStyle>
              <conditionExpression><![CDATA[$V{REPORT_COUNT}%2 == 0]]></conditionExpression>
              <style backcolor="#CAC5BB" fontName="DejaVu Sans"/>
              </conditionalStyle>
              </style>

              and then use this style for my report elements like this:

              <reportElement uuid="494661d9-f71e-461d-a23b-dbc22610c0cc" style="Zebra" mode="Opaque" x="58" y="0" width="223" height="25"/>

              It work on ireport preview but not on my pdf output.

              Can you suggest me a way to solve this problem? Thank you!

              Comment


              • #52
                Hi giovannino ,

                I try to intregate your solution, but I have always a blank result screen(debugsql=false) or sql query displayed (debugsql=true) !!!
                I detail all my codes, maybe you will have an idea for what's happen !!

                NOT: sql query displayed is not the query in sc but the query in ireports document ???

                Thanks in advance
                Nac



                Button code in sc :
                -------------------
                $pdf_query="SELECT
                bnotes.`BNCLEUNIK` AS bnotes_BNCLEUNIK,
                bnotes.`MONTANT` AS bnotes_MONTANT,
                bnotes.`CASH` AS bnotes_CASH,
                bnotes.`NROOM` AS bnotes_NROOM,
                bnotes.`NUMERO` AS bnotes_NUMERO,
                bnotes.`GUESTNAME` AS bnotes_GUESTNAME,
                bnotes.`DATEFIN` AS bnotes_DATEFIN,
                bnotes.`DATEDEB` AS bnotes_DATEDEB
                FROM
                `bnotes` bnotes
                WHERE
                bncleunik='".{bncleunik}."'";

                $xml_file="facvv.jrxml";
                sc_set_global($pdf_query);
                sc_set_global($xml_file);

                $_SESSION['report']['xml_file']=$xml_file;

                $_SESSION['report']['pdf_query']=$pdf_query;

                sc_redir(../ireports/index.php);


                INDEX.PHP codes in ireports directory :
                ---------------------------------------
                <?php
                session_start();

                include_once('class/tcpdf/tcpdf.php');
                include_once('class/PHPJasperXML.inc.php');

                $xml = simplexml_load_file($_SESSION['report']['xml_file']); //variable for jrxml file

                $PHPJasperXML = new PHPJasperXML();

                $PHPJasperXML->debugsql=true;

                $PHPJasperXML->arrayParameter=array('pdf_query'=>$_SESSION['report']['pdf_query']); //variable for sql statement
                $PHPJasperXML->xml_dismantle($xml);

                $PHPJasperXML->transferDBtoArray($_SESSION['report']['host'],
                $_SESSION['report']['user'],
                $_SESSION['report']['pass'],
                $_SESSION['report']['db']);
                $PHPJasperXML->outpage("D"); //page output method I:standard output Download file

                ?>

                DIRECTORIES CONTENTS:
                ---------------------------

                in my project directory, I have :

                ireports directory
                class sub-directory (containing PHPJasperXML-master class sub-directory)
                index.php
                facvv.jrxml
                Last edited by nacyil; 04-27-2014, 07:31 AM.

                Comment


                • #53
                  Hi,
                  please change your button code to:

                  if(!isset($_SESSION['report']))
                  {
                  $_SESSION['report']=array('host'=>[sc_glo_servidor],'user'=>[sc_glo_usuario],'pass'=>sc_decode([sc_glo_senha]),
                  'db'=>[sc_glo_banco],'pdf_query'=>'','xml_file'=>'');
                  }

                  $pdf_query="SELECT
                  bnotes.`BNCLEUNIK` AS bnotes_BNCLEUNIK,
                  bnotes.`MONTANT` AS bnotes_MONTANT,
                  bnotes.`CASH` AS bnotes_CASH,
                  bnotes.`NROOM` AS bnotes_NROOM,
                  bnotes.`NUMERO` AS bnotes_NUMERO,
                  bnotes.`GUESTNAME` AS bnotes_GUESTNAME,
                  bnotes.`DATEFIN` AS bnotes_DATEFIN,
                  bnotes.`DATEDEB` AS bnotes_DATEDEB
                  FROM
                  `bnotes` bnotes
                  WHERE
                  bncleunik='".{bncleunik}."'";

                  $xml_file="../ireports/facvv.jrxml";

                  $_SESSION['report']['xml_file']=$xml_file;

                  $_SESSION['report']['pdf_query']=$pdf_query;

                  sc_redir(../ireports/index.php);

                  That should do it.
                  jsb

                  Comment


                  • #54
                    Hi jsb,

                    Thanks for answering but nothing changed !!!! I've put an echo for global variables, they all contains right value.
                    I also put an echo in index.php, you see it on the attached pdf

                    I'm using version 0.9b

                    Thanks
                    Nac

                    this the code :

                    if(!isset($_SESSION['report']))
                    {
                    $_SESSION['report']=array('host'=>[sc_glo_servidor],'user'=>[sc_glo_usuario],'pass'=>sc_decode([sc_glo_senha]),
                    'db'=>[sc_glo_banco],'pdf_query'=>'','xml_file'=>'');
                    }

                    $pdf_query="SELECT
                    bnotes.`BNCLEUNIK` AS bnotes_BNCLEUNIK,
                    bnotes.`MONTANT` AS bnotes_MONTANT,
                    bnotes.`CASH` AS bnotes_CASH,
                    bnotes.`NROOM` AS bnotes_NROOM,
                    bnotes.`NUMERO` AS bnotes_NUMERO,
                    bnotes.`GUESTNAME` AS bnotes_GUESTNAME,
                    bnotes.`DATEFIN` AS bnotes_DATEFIN,
                    bnotes.`DATEDEB` AS bnotes_DATEDEB
                    FROM
                    `bnotes` bnotes
                    WHERE
                    bncleunik='".{bncleunik}."'";
                    indexscreen.jpg
                    $xml_file="../ireports/facvv.jrxml";

                    $_SESSION['report']['xml_file']=$xml_file;

                    $_SESSION['report']['pdf_query']=$pdf_query;

                    sc_redir(../ireports/index.php);
                    Last edited by nacyil; 04-27-2014, 03:27 PM.

                    Comment


                    • #55
                      Did you change your sql-statement in iReport to $P{pdf_query}?

                      I think version 0.9b might have been a little buggy.
                      Rohmad in post #46 successfully is using vesion 0.9c, so probably a newer version would work.

                      jsb

                      Comment


                      • #56
                        Hi jsb

                        Yes, I forgot $p{query} : thanks.....

                        I downloaded last version 0.9d ( cannot find 0.9c) but same result ??? What can be wrong !!!!

                        I copied "Class" directory containing in PHPjasperXml map, into my "ireports" directory in my project map.

                        Do I need to do something else with PHPjasperxml ??

                        Thanks !!!
                        Nac

                        Comment


                        • #57
                          Your parameter in iReport has to be $P{pdf_query}.
                          The class folder is all you need.
                          Try to create a very basic pdf. Maybe just one field no formatting, just plain text.

                          jsb

                          Comment


                          • #58
                            YEEEEEEEEESSSSSSSSS !!!!!!!!!!!!!!!!!!!!!!

                            In ireport , I created a blank A4 put $P{pdf_query} in query section. Add a field, give the name of a field from my SC query and it's work !!!!!!

                            Now, we'll see what are the limitations ... I 'll write what I found later..
                            Thanks a lot Jsb for this great help !!!

                            Just a question when I deploy my application, I receive an error message : sc_glo_servidor ... variables not found
                            But, when I run it in test , works fine !!
                            Do I need to do somethings special for my those variables ???

                            Best regards
                            Nac

                            Comment


                            • #59
                              Glad you got it working.
                              In Application -> Global Variables set the sc_glo-variables to 'Out'.

                              jsb

                              Comment


                              • #60
                                Hi jsb

                                Thanks, everything works now !!!

                                Here is an little invoice example made with ireport-sc

                                Best regards
                                Nac
                                Attached Files
                                Last edited by nacyil; 05-01-2014, 06:19 PM.

                                Comment

                                Working...
                                X