Announcement

Collapse
No announcement yet.

Nice lookin' reports

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

  • #31
    I have finally got it working, for some reason the the file name is not passing so I have entered it in the php file.

    Thanks for all the help.

    Comment


    • #32
      Glad you got it working.
      Regarding the file name, there is an error in your PHP method.

      Change the line: $_SESSION['report']['xml_file']=$xml_file;
      To: $_SESSION['report']['xml_file']="../reports/".$xml_file;

      jsb
      Last edited by jsbinca; 12-03-2013, 10:05 AM.

      Comment


      • #33
        Hi Jsb, thanks again for help.
        Unfortunately I'm still struggling with IReport but I had to suspend my testing becouse I'm stucked in another problem.
        I'm trying to use sc_mail_send and BBC. I have to send mail to people without showing the other receivers of my mail.
        This is the line code.
        sc_mail_send([glo_mail_smtp_server], [glo_mail_smtp_user], [glo_mail_smtp_pass], $mail_from , 'info@name.it', {subject}, $message, "H", $email_to , $type_copy , [glo_mail_smtp_port],[glo_mail_smtp_ssl]);
        I switched the "To" e-mail variable to "Copies" and on "To" I used a fixed string like info@name.it . $type_copy is "BBC".
        Using two receiver 1 and 2 this is what happens.
        On receiver 1 I see exactly what expected : To -> info@name.it and Bbc -> Receiver 1 mail
        On receiver 2 I see only to and nothing else: To -> info@name.it

        Does it make sense ?? Thanks

        Comment


        • #34
          @giovannino: PLEASE report other problems in a new thread ...

          @aducom: please move this post to a new thread.
          Best regards: - Reinhard -

          I use ScriptCase 8 Enterprise Edition, Version 8.(latest)

          Comment


          • #35
            YES !!! Sorry !!

            Comment


            • #36
              fatal error with ireports sc_redir !!!!

              Hi ,

              First of all , thanks for your good job concerning Ireports intergration !!!
              I have installed and try to integrated a reports but I receive a error message write below, what do I wrong ????
              I think it's with sc_redir command but, I cannot find what is wrong !!!

              Thanks in advance for your help
              Can


              Fatal error: Call to undefined method grid_XXXXX_apl::nmgp_redireciona_form() in
              ........wwwroot\scriptcase\app\MyProject\grid_XXXX X\grid_XXXXX.php on line 1938


              =====================================
              BUTTON CODE
              =====================================
              $pdf_query="SELECT
              ...........";

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

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

              =======================================
              grid_XXXXX.php CODE
              =======================================
              .........

              if (isset($this->sc_temp_pdf_query)) {$_SESSION['pdf_query'] = $this->sc_temp_pdf_query;}
              if (isset($this->sc_temp_xml_file)) {$_SESSION['xml_file'] = $this->sc_temp_xml_file;}
              if (!isset($this->Campos_Mens_erro) || empty($this->Campos_Mens_erro))
              {
              //////////////////////////////////////// line 1938 /////////////////////

              $this->nmgp_redireciona_form("../ireports/ireports.php", $this->nm_location, "","_self", 440, 630, "ret_self");

              //////////////////////////////////////// //////////////////////////////
              };
              if (isset($this->sc_temp_pdf_query)) {$_SESSION['pdf_query'] = $this->sc_temp_pdf_query;}
              if (isset($this->sc_temp_xml_file)) {$_SESSION['xml_file'] = $this->sc_temp_xml_file;}

              .........

              =======================================
              APP DIRECTORY TREE and filename
              =======================================

              ....wwwroot\scriptcase\app\MyProject\ireports


              in ireports directory :

              \class
              ireports.php
              report1.jrxml
              ....

              Comment


              • #37
                $_SESSION['report']['xml_file'] is empty ?

                Hi,
                I'm back..... ;-( .
                I've just re-taken on hand the reporting story...
                On following lines I listed what I did and, on the bottom, the error I got after clicking on form button.
                With the eco "VALUE XML FILE IS" it seems that $_SESSION['report']['xml_file'] would be empty.
                ... I hope to see a report asap
                Many thanks



                function print_pdf
                ************************
                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'=>'');
                }

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

                sc_redir(../z_ireport_class/index.php,"","_blank");

                Button Settings: jasperbutton
                **************************
                $pdf_query = 'SELECT * FROM gartes'; //sql statement from iReport
                $xml_file='gartes.jrxml'; //filename of report created with iReport
                sc_set_global($pdf_query);
                sc_set_global($xml_file);

                print_pdf($pdf_query,$xml_file);


                index.php
                *************************
                <?php
                session_start();

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

                echo "VALUE XML FILE IS " . $_SESSION['report']['xml_file'];

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

                $PHPJasperXML = new PHPJasperXML();

                $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
                ?>


                ERROR SHOWN AFTER CLICKING BUTTON
                ********************************
                VALUE XML FILE IS
                Notice: Undefined index: ../z_ireport_class/xml_file in C:\Program Files (x86)\Scriptcase\v71\wwwroot\scriptcase\app\c4tm\z _ireport_class\index.php on line 9 Warning: simplexml_load_file(): I/O warning : failed to load external entity "" in C:\Program Files (x86)\Scriptcase\v71\wwwroot\scriptcase\app\c4tm\z _ireport_class\index.php on line 9 TCPDF ERROR: Some data has already been output, can't send PDF file
                Last edited by giovannino; 12-28-2013, 06:46 AM.

                Comment


                • #38
                  Just an idea.
                  You didn't declare an argument/parameter for your print_pdf() function, did you?

                  function rpint_pdf($xml_file)
                  {
                  ...
                  }

                  jsb

                  Comment


                  • #39
                    A little bit better but still not result

                    Hi JSB,

                    I did a short video to show what's my problem now.

                    http://www.youtube.com/watch?v=gDkvs8GXtF4

                    It seems all correct but still I can get any output.
                    I've tried also to use $P{pdf_query} but it do not works. The only way to produce the report from iReport is to use $P!{pdf_query} with esclamation mark.
                    I did also a test using $_SESSION['report']['xml_file']="../z_ireport_class/".$xml_file; but nothing change too.


                    On the SC side I concentrated all the code into button code only
                    PHP 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 * FROM gartes';
                    $xml_file='gartes.jrxml';

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

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

                    and index.php file
                    **********************
                    <?php
                    session_start();

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

                    echo " VALUE XML FILE IS --> " . $_SESSION['report']['xml_file'] . '<BR>'
                    . " VALUE OF QUERY IS -> " . $_SESSION['report']['pdf_query'].'<BR>'
                    . " VALUE OF USER IS ---> " . $_SESSION['report']['user'].'<BR>'
                    . " VALUE OF PASSW IS -> " . $_SESSION['report']['pass'].'<BR>'
                    . " VALUE OF DB IS ------> " . $_SESSION['report']['db'].'<BR>'
                    ;

                    $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("I"); //page output method I:standard output Download file
                    ?>
                    Last edited by giovannino; 12-29-2013, 08:24 AM.

                    Comment


                    • #40
                      Hi,
                      please remove the exclamation mark (!) from your parameter statement. IT IS ONLY USEFUL WITHIN iREPORT!
                      It is for prompting you for the value of the parameter when you run it in ireport. TCPDF has absolutely no idea what it is good for.
                      Also remove your echo-statement, it prevents tcpdf from generating any output. You now know that your data are OK.
                      Otherwise your stuff looks good. I just created a form with your code and it works as it is supposed to.
                      May be change $PHPJasperXML->outpage("I") to $PHPJasperXML->outpage("D") to see if it generates a download.
                      I have to admit, I'm running out of ideas. :-)


                      jsb

                      Comment


                      • #41
                        Reply

                        Hi, thanks
                        I removed the "!" and saved the file again. Just a doubt ... Need I to compile it and save also the compiled file gartes.jasper into the z_ireport_class folder ?
                        I deleted echoes lines and I tried both with "I" and "D" .
                        Now I see the select command instead of parameter but always an empty page.

                        Attachment
                        Attached Files

                        Comment


                        • #42
                          No, you don't need the .jasper file.
                          But... What version of the phpjasperxml class are you using?
                          I just downloaded the newest version, slapt it on the server and voila... empty page!
                          I don't have the time to dig into it right now, but you should try to get an older version.
                          The 0.8c is working for sure. :-)

                          jsb

                          Comment


                          • #43
                            Yes I'm using the last one 0.9c .
                            I'm quite satisfied that the problem is there . At list we are facing the same mistake.


                            I've searched for that version but I can't find it. Have a link or please send me a zip file to giovanni.chiozza@libero.it
                            Last edited by giovannino; 12-29-2013, 03:03 PM.

                            Comment


                            • #44
                              SC pdf reporting make use fpdf to generate its pdf reports but the interface SC created does not know how to handle complex reports.

                              fpdf command is very straight forward and easy to use and it give you full control. Goto http://www.fpdf.org it will explain the commands and how to use it.

                              however, to use it you will need to add the fpdf library into SC. the library is found in SC installation NetMake -> v7 -> wwwroot -> scriptcase -> prod - third -> fpdf

                              Comment


                              • #45
                                Thanks very much and lot of complimentes to Jsb that has fixed all my problems !!!!
                                After long pregnancy...........today the first SC-IReport was borned !!! WOOOOOOOOWWWWW !!

                                Comment

                                Working...
                                X