CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Java

  How to call JasperReports from JSP page..

Print topic Send  topic

Author Message
atanu_panda2000

Posts: 5
Posted: 12/28/2006, 6:22 AM

Hi

I have a little knowledge on how to work with Jasper Reporting engine. I am using mysql data base. From Jasper engine I can fetch data. I have also started JBOSS application server. Where I can run java and jsp files easily. But while trying to call jasper report from any .java file or from any .jsp file I am getting problem. I have also search internet a lot. But didn’t get any proper solution .
If you please help me to solve this problem I will be very glad.
Also please tell me how to “import net.sf.jasperreports.*” as it is showing error that package net.sf.jasperreports does not exist.
Atanu panda
Thank you
View profile  Send private message
matheus

Posts: 386
Posted: 12/28/2006, 8:01 AM

Where is CodeCharge Studio in your post?
_________________
Matheus Trevizan

Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br
View profile  Send private message
atanu_panda2000

Posts: 5
Posted: 12/29/2006, 12:39 AM

sir
If you please tell me the complete procedure with code and also software to be install I will be very much thankful to you.
will I send my code what I have written in my programm?
Also please send me links on this purpose.
Thanks
View profile  Send private message
LH_13

Posts: 30
Posted: 12/29/2006, 2:52 AM

I'm sorry, but this is not pure java forum.
It forum about and around the CodeChargeStudio.
And knowlege of people here mainly obiut CCS Java Pattern. Not pure java.
So i think better way to look for answer somewhere else.

Jasper Reporting is pure java enigine.
You can read more hrer http://jasperforge.org.
Or on other forums.
_________________
Sorry my english!
View profile  Send private message
atanu_panda2000

Posts: 5
Posted: 01/12/2007, 4:24 AM

Hi
I am trying to call a jrxml file into a java file . The program gets compiled . But while running I getting this error.
code is

import net.sf.jasperreports.view.JasperViewer;
import net.sf.jasperreports.engine.xml.JRXmlLoader;
import net.sf.jasperreports.engine.xml.*;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.design.JasperDesign;
import net.sf.jasperreports.engine.JasperReport;
import java.io.OutputStream;
import java.sql.*;
import java.util.HashMap;
import java.util.Map;
import net.sf.jasperreports.engine.JREmptyDataSource;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperExportManager;
import java.io.*;
import java.lang.String;
import java.lang.*;
import java.lang.Object;
import java.lang.Throwable;
import java.lang.Exception;
import net.sf.jasperreports.engine.design.JRAbstractClassCompiler;
import net.sf.jasperreports.engine.design.JRAbstractCompiler;
import net.sf.jasperreports.engine.design.JRDefaultCompiler;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.design.JRClassCompiler.*;
import net.sf.jasperreports.engine.design.JRCompiler.*;
import net.sf.jasperreports.engine.design.JRMultiClassCompiler.*;
import net.sf.jasperreports.engine.JasperManager;
import net.sf.jasperreports.engine.design.*;
import net.sf.jasperreports.engine.*;
import java.io.FileNotFoundException;
public class HelloWorld {

public HelloWorld() {
}
public static void main(String[] args) {
String reportSource ="C:\\Documents and Settings\\ss\\workspace\\HelloWorld\\src\\HelloReportWorld.xml";
String reportDest = "C:\\Documents and Settings\\ss\\workspace\\HelloWorld\\src\\HelloReportWorld.html";
Map params = new HashMap();
try
{
JasperDesign jasperDesign=JRXmlLoader.load(reportSource);
//JasperManager.loadXmlDesign("HelloReportWorld.xml");
JasperReport jasperReport =
JasperCompileManager.compileReport(jasperDesign);

JasperPrint jasperPrint =
JasperFillManager.fillReport(
jasperReport, params, new JREmptyDataSource());

JasperExportManager.exportReportToHtmlFile(
jasperPrint, reportDest);

JasperViewer.viewReport(jasperPrint);
}
catch (JRException ex)
{
ex.printStackTrace();
}


}

}



the error I am getting is that

net.sf.jasperreports.engine.JRException: Language "null" not supported by this report compiler.
Expecting "java" instead.
at net.sf.jasperreports.engine.design.JRAbstractClassCompiler.checkLanguage(JRAbstractClassCompiler.java:97)
at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:138)
at net.sf.jasperreports.engine.design.JRDefaultCompiler.compileReport(JRDefaultCompiler.java:105)
at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:211)
at HelloWorld.main(HelloWorld.java:46)


any one please tell me what should I do.
View profile  Send private message
matheus

Posts: 386
Posted: 01/12/2007, 4:51 AM

Can you read English?

This is NOT a pure java forum.
_________________
Matheus Trevizan

Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br
View profile  Send private message
atanu_panda2000

Posts: 5
Posted: 01/12/2007, 10:29 PM

I don't have the idea that it's not a java forum. If you disturbed by me then sorry otherwise I have nothing to do . Can u tell me the name of pure java forum.
View profile  Send private message
atanu_panda2000

Posts: 5
Posted: 01/12/2007, 10:31 PM

Mr. matheus do u think I don't know english.
View profile  Send private message
LH_13

Posts: 30
Posted: 01/15/2007, 12:53 AM

Mr. atanu_panda2000 do you know what is google?
Try you type "java jasper forum" (wihtout qouts)
or
"java jasper net.sf.jasperreports.engine.JRException: Language "null" not supported by this report compiler." (without qouts too)?
Pleack note, in my earlier post i write home page of jasper.
I think it's enough.

_________________
Sorry my english!
View profile  Send private message
suniladp

Posts: 1
Posted: 03/09/2007, 3:01 AM

:-) :-)
hi 2 every one this is sunil and jasper report genaration is very easy and when ur getting errors then just add libriaries to the project that it i had also got the same errors and added jar files so every one plz try tht
View profile  Send private message
mfa

Posts: 3
Posted: 05/29/2007, 3:31 AM

hi master
sir i use sun java studio creater
i install ireport and designed the fahim.jrxml file the run and test that give right result show report in jrxmpl preview

sir guid me how i call my ireport file in sun java stdio crater
i also add jasperreports-1.3.3.jar in project lib

i use this code but that give me error

Connection conn = null ;
// the following should be in a try-catch...
javax.naming.Context ctx = new javax.naming.InitialContext() ;
DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/Travel") ;
conn = ds.getConnection() ;


JasperReport jasperReport = JasperCompileManager.compileReport("f:\ireport\fahim.jrxml","G",conn);
JasperPrint jasperPrint = JasperFillManager.fillReport("f:\ireport\fahim.jrxml",new HashMap(),conn)

it file i designed in ireport fahim.jrxml

sir my question is how i call fahim.jrxml file directly in studio creater

why i use xml code in studio creater

please give me idea and step

thank

aamir
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.