ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

QUESTION about reports in CI

November 08, 2009 9:49pm

Subscribe [10]
  • #1 / Nov 08, 2009 9:49pm

    kikz4life

    77 posts

    Hi to all CI community :D

    anyone here used reports for CI? like Crystal reports or Jasper Reports., or has anyone tried to integrate CI with this things? Or does CI frameworks supports this?

    Thanks
    -Dean

  • #2 / Nov 08, 2009 11:32pm

    Ben Edmunds

    812 posts

    Hey Dean,

    A company I used to worked for used Crystal Reports so I have a little experience.  Crystal Reports can be integrated with MySQL with a little bit of hacking but I really wouldn’t recommend it.

    There are a couple charting libraries that have been integrated with CI.  I’ve personally used pChart and it would be easy to integrate with CI.


    Is there a reason you prefer to use crystal/jasper reports?  Maybe you’d be better off charting with php?

  • #3 / Nov 09, 2009 1:35am

    kikz4life

    77 posts

    hi there Ben,

    thanks for taking an interest about my post. about pChart., i want the graph to be a real time data. The value of the graph will vary from the database.. And for the reports i think charts is not suitable. I mean if i want to print all users who filed ticket in October to December, don’t think charts handle this kind of things..

    btw, im using a chart in my dashboards but not the real data in my db.

    What do you suggest?

    Thanks again,
    -Dean

  • #4 / Nov 09, 2009 3:51am

    InsiteFX

    6819 posts

    You can do a search in the forums here I think Derek had a thread on using pdf for creating reports.

    Enjoy
    InsiteFX

  • #5 / Nov 09, 2009 10:06am

    Ben Edmunds

    812 posts

    Dean,

    You can definitely use charts to display the data from your database.

    When you say real-time, do you mean just up-to-date or do you mean dynamically changing before your eyes?

    For an example, with a charting solution you would pull whatever data you want to chart from your database and then loop through the results and add the points to the chart.

    Insite’s PDF solution would also be a good idea.

  • #6 / Nov 09, 2009 12:21pm

    James Bolongan

    18 posts

    I guess it’s hard to intergrate Crystal reports or Jasper Reports in this framework since this is a PHP(pure scripting) compared to .NET and JAVA.

    There are so many ways on how make reports in CI. About graphing you can use the Jpgraph or the Panaci Chart where data can vary from the database.

    Just click this link for your reference:

    1. Jpgraph

    2. Panaci

    And just feel free to post in this forums if you have any problems on how to used this charting libray or regarding about the data from database to make your graph real time.

    Example code:

    <?php
    
    class Chart extends Controller {
    
        function Chart()
        {
            parent::Controller();
            $this->load->helper('url');
            $this->load->plugin('jpgraph');    
        }
        
        function index()
        {
            $data['title'] = "Using JpGraph from CodeIgniter 1.5";        
            $data['heading'] = "Example 0 in JpGraph 2.1.4";        
                
            // Setup Chart 
            //$ydata = array(11,3,8,12,5,1,9,13,5,7); // this should come from the model        
            
            // Setup Chart real time data
        $j = 0;
        $string = "";
        $query = $this->db->query("select value from graph");
        foreach($query->result_array() as $row){
           $id[$j] = $row['value'].",";
           $string = $string.$id[$j];
           $j++;
        }
        $ydata = explode(",",$string);
    
    
            $graph = linechart($ydata, 'This is a Line Chart');  // add more parameters to plugin function as required        
            // File locations
            // Could possibly add to config file if necessary
            $graph_temp_directory = 'temp';  // in the webroot (add directory to .htaccess exclude)
            $graph_file_name = 'test.png';    
            
            $graph_file_location = $graph_temp_directory . '/' . $graph_file_name;
                    
            $graph->Stroke('./'.$graph_file_location);  // create the graph and write to file
            
            $data['graph'] = $graph_file_location;
            
            $this->load->view('chart_view', $data);
        }
    }
    ?>
  • #7 / Nov 09, 2009 2:56pm

    kevinprince

    122 posts

    Yes you can use Crystal Reports or Jasperreports the “small” problem is that your will need to use them directly over ODBC to your database.

    A few other options would include using filemaker if on a mac or navicat on windows.

  • #8 / Nov 09, 2009 9:55pm

    kikz4life

    77 posts

    thanks for all the suggestion..

    how about printing the reports tallied by the (any)graph or from the chosen transaction date only by the user?. Is this the time i will use dompdf? Still haven’t read this yet but its like an html output(not sure). Then the format of that reports would not be dynamic?

    Last question, with all the graph suggested to me which to do you think is the best, i mean user friendly(easy to understand and integrate)?

  • #9 / Nov 10, 2009 2:11am

    InsiteFX

    6819 posts

    PHP.Net has some examples on using Crystal Reports with PHP 5.1.6

    Crystal Reports Examples

    Enjoy
    InsiteFX

  • #10 / Nov 10, 2009 10:28am

    Ben Edmunds

    812 posts

    There are many great charting and reporting solutions available.  Your decision will really depend on your needs.

    Flash charts are more interactive but printing can be a problem.
    Javascript changes are more dynamic but also more complicated.
    PHP charts are generally easier to work with but more restrictive.


    You don’t have to convert to PDF for printing, really only if you want downloadable reports.


    I know there are a ton of charting solutions so it can be kinda daunting picking one so maybe we can help you narrow it down, what exactly do you need?

  • #11 / Nov 13, 2009 9:22am

    kikz4life

    77 posts

    hi there,

    i finally found a report tool that i can use with CI. I’ve already deployed it to my pc and been able to create reports. I’m working on how to get it a dynamic. I mean i’ll use parameter for the different types of ext. file(pdf, html, xls.. etc.). I used PhpJavaBridge to connect my php script to java… If i get lucky then and get it working then i’ll integrate it to CI. :D

    tsk2x. work work work…

    thanks for all your help..
    -Dean

  • #12 / Nov 13, 2009 9:28am

    kevinprince

    122 posts

    Sharing any details you have would be good 😉

  • #13 / Nov 22, 2009 10:05pm

    kikz4life

    77 posts

    did it :D. finally able to have a report in php(real time data).. and been able to include it in CI directory. I’m able to have a report in differnt format (i.e hmtl, pdf, xls, doc, etc..). Just making some modification before i can share it with the CI community.

    -Dean

  • #14 / Nov 22, 2009 11:16pm

    Ben Edmunds

    812 posts

    Congrats! 

    Make sure to share it once your with your changes.

  • #15 / Nov 25, 2009 4:17pm

    CARP

    181 posts

    did it :D. finally able to have a report in php(real time data).. and been able to include it in CI directory. I’m able to have a report in differnt format (i.e hmtl, pdf, xls, doc, etc..). Just making some modification before i can share it with the CI community.

    -Dean

    Awesome! will be glad to give it a try

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases