Jump to content
Changes to the Jaspersoft community edition download ×

More info About PHPJRConnector


ktrinad

Recommended Posts

By: Maurizio Piccinelli - gherez

More info About PHPJRConnector

2003-02-06 06:59

Hi Giulio! I have seen in the source code of iReport that you put this PHPJRConnector.java.

 

I compile it, and got PHPJRConnector.class but I'm not able to use it inside PHP. :(

 

Do you have any example to give to me?

 

Thanks

 

 

 

 

By: Giulio Toffoli - gt78

RE: More info About PHPJRConnector

2003-02-06 10:36

Sure!

 

You can find the complete example (with the php script to use the class) here:

 

http://sourceforge.net/mailarchive/forum.php?thread_id=1566148&forum_id=7912

 

Good Look

Giulio

 

 

 

 

 

By: eric - greatmaster

how to use a PHPJRConncetor with DATABASE

2003-11-26 01:00

Hi,

i saw the use of PHPJRConnector at

http://sourceforge.net/mailarchive/forum.php?thread_id=1566148&forum_id=7912

 

This example show how to call a jasper Report with PHP. But the data source is an EmptyDataSource.

How can i have a real data source providing datas from database. The ideal would be to have the JRDatasource

created in iReport !!

 

How can i have this JRDataSource?

 

thanks

 

eric

 

 

 

 

 

 

By: eric - greatmaster

RE: More info About PHPJRConnector

2003-11-26 02:44

I tried to use PHPJRConnector with a connection to a database but when i try the php page (localy on 127.0.0.1 ...) then i have several dos Windows and a final message saying me : THE DOCUMENT CONTAINS NO DATA .

 

The code is the following :

 

<CODE>

import dori.jasper.engine.*;

import dori.jasper.view.*;

import it.businesslogic.ireport.connection.*;

 

public class PHPJRConnector

{

 

public static String run(String srcFileName, String dstFileName)

{

try {

dori.jasper.engine.JasperPrint print=null;

dori.jasper.engine.JRExporter exporter=null;

 

/*print = dori.jasper.engine.JasperFillManager.fillReport(

srcFileName,

null,new JREmptyDataSource());

*/

 

JDBCConnection maConnection = new JDBCConnection();

maConnection.setJDBCDriver("com.mysql.jdbc.Driver");

maConnection.setUrl("jdbc:mysql://myServer");

maConnection.setDatabase("myDB");

maConnection.setUsername("myUser");

 

maConnection.setPassword("myPass");

 

print = dori.jasper.engine.JasperFillManager.fillReport(

srcFileName,

null,

maConnection.getConnection());

 

exporter = new

dori.jasper.engine.export.JRPdfExporter();

exporter.setParameter(

JRExporterParameter.OUTPUT_FILE_NAME,dstFileName);

exporter.setParameter(

JRExporterParameter.JASPER_PRINT,print);

exporter.exportReport();

 

return "YES";

} catch (Exception ex)

{

return "ERROR!";

}

}

}

</CODE>

 

WHAT IS WRONG ?

IS THERE A BUG ?

 

 

 

 

By: eric - greatmaster

RE: More info About PHPJRConnector OK!!!!!

2003-11-26 04:03

SORRY it works fine NOW !!!

 

I forgot to put the PATH to mysql DRIVER in APACHE

 

eric

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...