Welcome Guest, Not a member yet? Register   Sign In
QUESTION about reports in CI
#1

[eluser]kikz4life[/eluser]
Hi to all CI community Big Grin

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

[eluser]Ben Edmunds[/eluser]
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

[eluser]kikz4life[/eluser]
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

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

Enjoy
InsiteFX
#5

[eluser]Ben Edmunds[/eluser]
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

[eluser]James Bolongan[/eluser]
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:

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

[eluser]kevinprince[/eluser]
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

[eluser]kikz4life[/eluser]
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

[eluser]InsiteFX[/eluser]
PHP.Net has some examples on using Crystal Reports with PHP 5.1.6

Crystal Reports Examples

Enjoy
InsiteFX
#10

[eluser]Ben Edmunds[/eluser]
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?




Theme © iAndrew 2016 - Forum software by © MyBB