Announcement

Collapse
No announcement yet.

Nice lookin' reports

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

  • #16
    Still empty page :-(

    I did it but the still same result. White PDF page.
    I've installed on local only Jaspersoft Studio 5.5.0. Need I to install something else ?
    Here they are files I'm using: https://dl.dropboxusercontent.com/u/...Files_Used.zip

    Comment


    • #17
      You don't need the Jaspersoft Studio, all you need is iReport Designer.
      The software has nothing to do with your output, you just need it to create your xml-file.

      Create a simple page, just plain data, no formatting, no colours, no graphics (because there are some limitations, read the help file of the php-class).
      Did you try the samples that come with the class?
      Make sure your report works in iReport, then substitude the SQL command with the parameter, save the report and copy the jrxml-file to the project/server.
      Double check all your path names in the index.php and your form.

      jsb

      Comment


      • #18
        I did all the things in JS 5.5.0 and the report runs smootly there. JasperSoft Studio is the new name of iReport designer and has more or less same feature.
        Try to use my .jrxml file attached on previous link sended on your environment just to test if is good or has compatibility problems. On link there is also the mysql table with two records only.

        Comment


        • #19
          Hi,
          had a look at your stuff. It's your report that causes the problems, most likely the table element or maybe a combination of things.
          As i said before, get your data on a simple page first then start fiddling around. Not every feature of iReport is supported through
          the class so you have to figure out what works and what not. But your environment seems to be ok. I was able to print a document
          with your project and data, i just created a new report.

          Oh... and remove the two lines with the set_global macro within your code of the button. You don't need it, you are using a
          Session variable already.

          jsb
          Last edited by jsbinca; 11-21-2013, 04:32 PM.

          Comment


          • #20
            Hi Jsb,
            I used an old version of IReport 3.6.1 and I redid the super easy report.
            If you have a look to video here http://www.youtube.com/watch?v=EziMpP1VSqM you can see what's happening now.
            It's a little bit better than before but still no result.
            Many thanks
            Giovanni

            Comment


            • #21
              Sorry for the delay,...been away.

              1. Delete the pdf-query parameter from your parameter list.
              2. Delete the exclamation mark (!) in your Query window.

              jsb

              Comment


              • #22
                Hey. I am trying to test this. Looks great. However Im having this issue upon clicking the button I get the following message:

                Notice: Use of undefined constant xml_file - assumed 'xml_file' in C:\Program Files (x86)\NetMake\v7\wwwroot\scriptcase\app\AGSAM\repo rts\cpv.php on line 6 Fail to connect database

                Any help would be much appreciated.

                Comment


                • #23
                  Originally posted by jsbinca View Post
                  replace it with the parameter corresponding to the index.php. (in my case it's "$P{pdf_query}").
                  Can you please clarify this step for me I think I may be missing something. I have copied the sql query and pasted it in the button code. Is anything else required? Do I have to also place something in the index.php file?

                  Comment


                  • #24
                    Ok, here are a few pictures to illustrate (thought it might be beneficial). :-)

                    Image1 shows the iReport Designer with the parameter set in the query window.

                    Image2 is your PHP button code area

                    Image3 is your function to call the index.php.

                    And here is the index.php

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

                    Good luck
                    jsb
                    Attached Files

                    Comment


                    • #25
                      Thanks for the screenshots. I really appreciate it. I'm still working on this. Now I'm getting this error:

                      Warning: simplexml_load_file(): I/O warning : failed to load external entity "" in C:\Program Files (x86)\NetMake\v7\wwwroot\scriptcase\app\AGSAM\repo rts\cpv.php on line 6
                      Last edited by gamer99; 11-29-2013, 04:29 AM.

                      Comment


                      • #26
                        Yes and what do you read at line 6 in that file? We have only a cloudy crystal ball and can't look itself ...
                        Best regards: - Reinhard -

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

                        Comment


                        • #27
                          Originally posted by RHS View Post
                          Yes and what do you read at line 6 in that file? We have only a cloudy crystal ball and can't look itself ...
                          Oops I knew I was forgetting something!

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

                          Comment


                          • #28
                            I had removed this:
                            include_once('class/tcpdf/tcpdf.php');
                            from the php file however after placing it back now I get the following error:
                            Warning: simplexml_load_file(): I/O warning : failed to load external entity "" in C:\Program Files (x86)\NetMake\v7\wwwroot\scriptcase\app\AGSAM\repo rts\cpv.php on line 7 TCPDF ERROR: Some data has already been output, can't send PDF file

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

                            Comment


                            • #29
                              Your $_SESSION['report']['xml_file'] variable seems to be empty. Check the value of it.

                              jsb

                              Comment


                              • #30
                                I'm really new to this. I copied the code as you posted it. Can you please tell me what I have to change. Do I have to replace xml_file with something?

                                Once again I'm really appreciative of the fact that you guys go out of your way to help out!

                                Here is my code, all code is exactly how it is posted below except for the query:

                                PHP FILE located in reports folder in the scriptcase application folder
                                <?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->arrayParameter=array('cpv_query'=>$_SESSION['report']['cpv_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
                                ?>



                                My report called cpv.jrxml is also located in the reports folder. It has the following as the query string
                                ${cpv_query}



                                Button Code
                                $cpv_query="SELECT................................ .... cash_payments.`cpvno`={cpvno}";//sql statement from iReport

                                $xml_file="cpv.jrxml"; //filename of report created with iReport

                                cpv_print($cpv_query,$xml_file);



                                PHP Method called cpv_print to call the the php 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],'cpv_query'=>'','xml_file'=>'');
                                }

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

                                sc_redir(../reports/cpv.php,"","_blank");



                                Thanks for all the help.

                                Comment

                                Working...
                                X