Jump to content
JasperReports Library 7.0 is now available ×

Please I am an Idiot HELP


Recommended Posts

By: jasperidiot - jasperidiot

Please I am an Idiot HELP

2006-04-16 20:22

I wrote an applet several months ago to handle the entry of our companies quotes. I am now trying to create reports based on that system. I have created a report using IReport named delivery.jrxml. This report runs fine from IReport but I am having huge trouble loading it from my applet. The applet resides in a jar file located at the base of the website. the .jrxml file is located in the same directory as the jar (I have also tried putting the file in the jar).

Any advice on how to do this would be very helpful.

 

Let me start by stating what I have tried so far.

I have added a button to my form that when pressed run this code:

InputStream is = new FileInputStream(new File("delivery.jrxml"));

JRXmlLoader jlo = new JRXmlLoader(JRXmlDigesterFactory.createDigester());

JasperDesign jd = jlo.loadXML(is);

and I get this error:

java.io.FileNotFoundException: delivery.jrxml (The system cannot find the path specified)

 

I have Also tried InputStream is = new FileInputStream(new File("./delivery.jrxml"));

and

InputStream is = new FileInputStream(new File("/delivery.jrxml"));

Along with others with no avail.

 

I have looked at the applet examples jasperreports-1.2.1-projectjasperreports-1.2.1demosampleswebappapplets

but I don't understand what

<PARAM NAME = "REPORT_URL" VALUE ="../servlets/jasperprint">

is pointing to I could not find that file.

 

But I am ranting I have been working on this for 24 hours straight so I am a little deleterious. If none of this make since please let me know and I will clear it up first thing in the morning.

 

Thanks for any help in advance.

 

 

 

 

 

 

By: Rafael - rafasanmartinez

RE: Please I am an Idiot HELP

2006-04-17 01:17

Theoretically, you have to include your file in the applet jar, so it gets downloaded and present within your final user´s applet java environment.

 

Once there, your applet should be able to access to it by using the following:

 

InputStream theStream = this.getClass().getResourceAsStream("/myPathIntoTheJar/myReport.jrxml");

 

Please let me know if this solution works. I have not tested it.

 

 

https://sourceforge.net/forum/forum.php?thread_id=1480635&forum_id=113530

 

 

 

 

By: jasperidiot - jasperidiot

RE: Please I am an Idiot HELP

2006-04-17 11:59

I can now load the file but I cannot Compile it.

I am getting this error.

net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:

1. The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files

/*

^

1 errors

 

at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:193)

at net.sf.jasperreports.engine.design.JRDefaultCompiler.compileReport(JRDefaultCompiler.java:131)

at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:211)

at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:197)

at Sales.Sales.cmd_deliver_actionPerformed(Sales.java:1724)

at Sales.Sales_cmd_deliver_actionAdapter.actionPerformed(Sales.java:1752)

at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)

at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)

at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)

at javax.swing.DefaultButtonModel.setPressed(Unknown Source)

at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)

at java.awt.Component.processMouseEvent(Unknown Source)

at javax.swing.JComponent.processMouseEvent(Unknown Source)

at java.awt.Component.processEvent(Unknown Source)

at java.awt.Container.processEvent(Unknown Source)

at java.awt.Component.dispatchEventImpl(Unknown Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)

at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)

at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.EventQueue.dispatchEvent(Unknown Source)

at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.run(Unknown Source)

 

The report is very small and simple:

<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">

<jasperReport

name="delivery"

columnCount="1"

printOrder="Vertical"

orientation="Portrait"

pageWidth="595"

pageHeight="842"

columnWidth="535"

columnSpacing="0"

leftMargin="30"

rightMargin="30"

topMargin="20"

bottomMargin="20"

whenNoDataType="NoPages"

isTitleNewPage="false"

isSummaryNewPage="false">

 

<import value="java.util.*" />

<import value="net.sf.jasperreports.engine.*" />

<import value="net.sf.jasperreports.engine.data.*" />

 

<background>

<band height="0" isSplitAllowed="true" >

</band>

</background>

<title>

<band height="40" isSplitAllowed="true" >

 

</band>

</title>

<pageHeader>

<band height="78" isSplitAllowed="true" >

 

</band>

</pageHeader>

<columnHeader>

<band height="20" isSplitAllowed="true" >

 

</band>

</columnHeader>

<detail>

<band height="19" isSplitAllowed="true" >

 

</band>

</detail>

<columnFooter>

<band height="68" isSplitAllowed="true" >

 

</band>

</columnFooter>

<pageFooter>

<band height="27" isSplitAllowed="true" >

 

</band>

</pageFooter>

<summary>

<band height="0" isSplitAllowed="true" >

</band>

</summary>

</jasperReport>

 

 

Thanks for the help so far.

 

 

 

 

By: Rafael - rafasanmartinez

RE: Please I am an Idiot HELP

2006-04-22 03:38

Sorry, I have not experience with setting applets, although it seems like for some reason, your applet is not having the proper access to the JRE libraries in the client side. java.lang.Object belongs to the core of the Java language. I would not be able to be more concrete.

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...