🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.jdatastore
2 messages
2 total messages Started by Brunet Djura Sun, 12 Feb 2006 16:00
How to connect JasperReport on JBuilder data module with JDataStore database query
#95
Author: Brunet Djura
Date: Sun, 12 Feb 2006 16:00
44 lines
2623 bytes
I'm working on a database application in Borland JBuilder 2006 on Linux 
Fedora Core 4 platform. I choose JDataStore as database, and 
JasperReports for reporting part.

Is there a way to connect JasperReport and JBuilder data module 
JDataStore database connection ?

My JasperReport/JDataStore connection code now looks like this >

try {
             String FILE = 
"/home/brunetdj/my/source/jbuilder/info2006/rpt/pregled.jrxml";
             JasperPrint jasperPrint = new JasperPrint();
             Map inputParameters = new HashMap();

             Connection rpt_db = null;
             try {
 
Class.forName("com.borland.datastore.jdbc.DataStoreDriver");
             } catch (ClassNotFoundException ex) {
             }
             try {
                 rpt_db = 
DriverManager.getConnection("jdbc:borland:dslocal:/home/brunetdj/my/source/jbuilder/info2006/data/podaci.jds", 
"SYSDBA",
                         "masterkey");
             } catch (SQLException ex1) {
             }
             inputParameters.put("sometitle","first report");
             JasperReport jasper_report = 
JasperCompileManager.compileReport(FILE);
             JasperPrint printed_report = 
JasperFillManager.fillReport(jasper_report,
                     inputParameters, rpt_db);
             JasperViewer.viewReport(printed_report,false);
         }

         catch (JRException excecao) {
             System.out.println("Error: " + excecao.getMessage());
         }

Please, help, if any can ...

P.S. Point is to put in rpt_db my JBuilder data module connection.
Re: How to connect JasperReport on JBuilder data module with JDataStoredatabase query
#98
Author: Quinn Wildman
Date: Mon, 13 Feb 2006 21:25
47 lines
2693 bytes
What connectivity options does JasperReport have?

Brunet Djura wrote:
> I'm working on a database application in Borland JBuilder 2006 on Linux 
> Fedora Core 4 platform. I choose JDataStore as database, and 
> JasperReports for reporting part.
> 
> Is there a way to connect JasperReport and JBuilder data module 
> JDataStore database connection ?
> 
> My JasperReport/JDataStore connection code now looks like this >
> 
> try {
>             String FILE = 
> "/home/brunetdj/my/source/jbuilder/info2006/rpt/pregled.jrxml";
>             JasperPrint jasperPrint = new JasperPrint();
>             Map inputParameters = new HashMap();
> 
>             Connection rpt_db = null;
>             try {
> 
> Class.forName("com.borland.datastore.jdbc.DataStoreDriver");
>             } catch (ClassNotFoundException ex) {
>             }
>             try {
>                 rpt_db = 
> DriverManager.getConnection("jdbc:borland:dslocal:/home/brunetdj/my/source/jbuilder/info2006/data/podaci.jds", 
> "SYSDBA",
>                         "masterkey");
>             } catch (SQLException ex1) {
>             }
>             inputParameters.put("sometitle","first report");
>             JasperReport jasper_report = 
> JasperCompileManager.compileReport(FILE);
>             JasperPrint printed_report = 
> JasperFillManager.fillReport(jasper_report,
>                     inputParameters, rpt_db);
>             JasperViewer.viewReport(printed_report,false);
>         }
> 
>         catch (JRException excecao) {
>             System.out.println("Error: " + excecao.getMessage());
>         }
> 
> Please, help, if any can ...
> 
> P.S. Point is to put in rpt_db my JBuilder data module connection.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads