JSP :: Jasper Reports And The Lib Folder Of A Web Project
Apr 20, 2014
I inherited a web application and am trying to build it. I recently installed JasperSoft Studio 5.5.0 final on my developer machine. I also have Eclipse Juno on my developer machine. I was advised by the previous developer to put some of his Jasper .jar files into my web app's lib folder. I did do this and now the localhost will not run, it is generating this error:
org.apache.jasper.JasperException: java.lang.NullPointerException
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:502)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:430)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
I went out to the lib folder and saw these files:
jasperreports-5.1.2
jasperreports-applet-5.1.2
jasperreports-expressions-1.0.0
jasperreports-exprfunction-1.0.0
jasperreports-fonts-5.1.2
jasperreports-javaflow-5.1.2
The version on them would appear incorrect given my version of 5.5. I am new to Jasper Reports. I suppose I could google on the .jar files and get the ones that belong to the 5.5.0 final and put them into the directory to see if Apache Tomcat 6.0.39 likes that better. And then start the server. If it doesn't like them, I guess I could remove them and continue, but I would prefer to have the Jasper Reports up and running.
My second question about the Jasper Reports is how do you tell the IDE where the Reports are located?
View Replies
ADVERTISEMENT
Apr 11, 2015
this is a syntax error within Jasper reports in the printwhenexpression property.I can use the following expression successfully: new Boolean ($F{off_peak_free_minutes}. trim().equals("")==false) - this basically tells Jasper Reports to ignore the column unless it has a value.
Now I'm trying to do the same thing with ZERO but I can't get the syntax right. I've tried: new Boolean($F{off_peak_free_minutes} != 0) but the ZERO comes up with a red underline implying that this is illegal.I've also tried: new Boolean($F{friends_family_minutes}!=Double.valueOf(0)) but the ZERO comes up with the red underline.
I suspect I'm just not specifying the JAVA right. I believe that the $F{friends_family_minutes} variable is a DOUBLE - it prints as 0.00 on the report.
View Replies
View Related
Jul 17, 2014
I'm going through the next problem:
importing a project from Eclipse into NetBeans, I tried importing project, did not work, anyway
I got all the classes good, but I got a folder with images and a TXT file
part of the code:
listaIconsPlayers[0]=(IconsUtils.makeIcon("imagespinspin_blue.png",dimensaoPinGrande,"pin_blue"));
listaIconsPlayers[1]=(IconsUtils.makeIcon("imagespinspin_green.png",dimensaoPinGrande,"pin_green"));
listaIconsPlayers[2]=(IconsUtils.makeIcon("imagespinspin_purple.png",dimensaoPinGrande,"pin_purple"));
listaIconsPlayers[3]=(IconsUtils.makeIcon("imagespinspin_red.png",dimensaoPinGrande,"pin_red"));
listaIconsPlayers[4]=(IconsUtils.makeIcon("imagespinspin_yellow.png",dimensaoPinGrande,"pin_yellow"));
Where do I place my folder Images and how can I configure this so this lines of code go get that images from a folder inside the project..
View Replies
View Related
Oct 30, 2014
I need to copy a file from Windows folder to unix folder using Java
I need a FTP utility.
The file is processed by a Java program and the file has to be written to Unix folder
I have the unix server name and folder name.
how to do it?
View Replies
View Related
Sep 8, 2014
Where can I learn or how can I, being the most efficient way known to do so, create a folder outside my JAR file with the java source code, this then will copy YAML documents from my JAR file to that folder, then I need to read the YAML documents some way. I'm making an addon for a game, I am using an API that allows you to make a config.yml easily, and add and read entries from it, but I've read that I need to make my own methods to be able to create additional YAML documents.
I don't exactly know what to type in google to perhaps find such a page, but I did try to find a tutorial page about this or something and couldn't.
I've partially figured out how to create a folder, but I have a problem, how can I RETURN one directory to make the folder, I don't want to make the folder in the JAR file I want to make it just outside the Jar file in the same folder that the Jar file is at.
View Replies
View Related
Jun 17, 2014
Which application i need to download and set up ?
Means like in php we can install xampp and there for a new app we need to create a folder in htdocs folder...and after that , that folder works like a app.
View Replies
View Related
Jun 25, 2014
I have a problem in generating reports using java code. I created a report using iReport 5.5.0 with MySql Database connection. In iReports, it shows the correct output while previewing it. Then i copied my .jrxml file and pasted it into my netbeans project folder(..sample/web/WEB-INF/sample.jrxml) and then i added the required jar files in my project's library folder. i am generating the report in netbeans using jsp and servlet. THE REPORT IS GENERATING AND SAVED SUCCESSFULLY IN MY DESKTOP. BUT IT DOESN'T GENERATE THE REPORT FOR FIRST RESULT. For Example.., if i generating report based on a particular date. After executing the query, it returns 4 results. So it has to create the reports in 4 pages. But it generates the report for last 3 pages only. It doesn't generate the report for first page. I have attached my .jrxml file servlet file for your reference.
View Replies
View Related
Feb 2, 2014
I've been working on a lesson in logging in Java, formatting in XML. I'm trying to add an appender to e-mail the error log, but can't seem to get it to work. Is there a piece I'm missing? The rest of my appenders are working fine. The error I get is that it cannot create an appender of this type. The console also seems to think that I defined the appender after I call for it, but it is above. Here is what I put together:
<appender name="EMAIL" class="ch.qos.logback.classic.net.SMTPAppender" >
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
[Code] ....
And then call it within the logger:
<appender-ref ref="EMAIL" />
View Replies
View Related
Apr 12, 2014
i downloaded a sample database code of an online payroll system. How can i assemble it to know how it works.
the files include php and mysql files. it is to build an online payroll system
View Replies
View Related
Mar 20, 2015
I am making some Junit Tests that process some files with a parser and the do some other processes. I already have a loop for processing a whole folder at a time. But I want to know how can I do so that for each file it processes I can generate an individual report.
View Replies
View Related
May 8, 2014
I am able to create a Master report using Jasper API. However stuck in designing a sub report using Jasper API and add it into Master report design.
Master Report JRXML
<band height="250" splitType="Stretch">
<subreport>
<reportElement isPrintRepeatedValues="false" x="0" y="0" width="550" height="233" isRemoveLineWhenBlank="true" backcolor="#000000">
</reportElement>
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{time})]]>
</dataSourceExpression>
[Code]...
These Stand alone XML's getting compiled and will generate report.
However i want to create these using Jasper Report API. I have Just started. But stuck without any example available.
JRDesignSubreport jSubreport = new JRDesignSubreport(jasperDesign);
jSubreport.setUsingCache(false);
jSubreport.setRemoveLineWhenBlank(true);
JRDesignExpression subReportDataSourceExpr = new JRDesignExpression();
subReportDataSourceExpr.addResourceChunk("");
//How to set List Data Source?
[Code]...
View Replies
View Related
Jun 26, 2014
I tried many times to return a string from java project to an android project But it keeps sending incorrect values as in 2 as it should be 1 here is an example.
Java Project:
boolean somethingboolean = false;
if(something.equals("1")){
somethingboolean = true;
}
public static String getString(){
if(somethingboolean == true){
[Code]...
Android project:
System.out.println(JavaProject.getString())
and in the android project it prints "FALSE"
So what should i do?
View Replies
View Related
Oct 11, 2014
For one of my project, required to capture the audit history reports of all the activities of the users within the application.
We are using Servlet/JSP in J2EE environment.
For Ex: Whenever user updates some fields, we need to capture the Old value, new value, user id and time stamp. We have single form with more than 200 fields.
Just want to know the best way to do this..any frameworks available for it...or doing at the database side like using triggers..
View Replies
View Related
Oct 24, 2012
I created a jsf page inside my ADF project. Inside I have a button and a text field. If i press button my servlet is activated. It returns a jasper report in pdf format. Now I would like to display my text field value as a jasper report parameter. So this is a part I don't know how to do. How do I get a value of my text field inside servlet? After this I know how to pass it to report.
View Replies
View Related
Jul 4, 2014
I want to print data on invoice receipt size of 20.5 x 14 cm(hard copy). In which I try to put text at some absolute location. I tried iText first. In that I try to set page size by following code. here what is unite used in bracket of rectangle?
Document document = new Document(new Rectangle(552,377));
PdfWriter.getInstance(document, new FileOutputStream("report.pdf"));
document.open();
...
...
...
document.close();
Second I tried Jasper report. In that I set page size to 20.5 x 14 cm. But how can I take value from my java application's textfield and put it in to some absolute location in iReport.As I know jasper report take value from database but how can I take value from java application's textfiled?
I am more familiar with iText. How can I print custom invoice using iText or Jasper Report.I am developing java application using netbeans.
View Replies
View Related
Mar 23, 2014
I am building a room management system in Java (Netbeans) and Ms Access. The jasper report is only showing code (source view) instead of design view. The GUI JFrame and Login JFrame are not displaying records in the database and the buttons are not working. Also the labels and text fields are not neatly arranged. The connection to the database is not displaying records.
Connection to the database. COIRMS.java
package Login;
import java.sql.*;
public class COIRMS {
Connection con;
Statement st;
ResultSet rs;
public COIRMS ()
[Code] ....
View Replies
View Related
Apr 17, 2015
I am creating a very simple webpage where I am using just a little bit of JSP to include partials (header, footer and asides) that are centrally located. One of the constraint that the site owner has put is that, for SEO reason, he wants to keep the url's the way they are. Most of the pages are located in the same folder, except for one which is in a subfolder.
Here is my problem, I have the partials in a folder and at the same level the images. Now, for that page located in the subfolder, when I include the partials, it is not able to locate the images because they are located in a folder one level up. What I could do is create a copy of the image folder in the subfolder or an adapted copy of the partials (referring to the images one level up), but either solution would make for a maintenance nightmare and repeat information on the server.
Here is a visual representation of my file system:
- Top level folder
- Partial_Folder
- header.html
- footer.html
- images
- picture_1.jpg
- Page_1.html
- Page_2.html
- Another_Folder
- Page_3.html
View Replies
View Related
Mar 25, 2014
I am creating a bukkit plugin, but my question has nothing to do with bukkit, just Java. I am trying to load a file that is located in the same folder as the jar file that is being run and I am having no luck. I can't set a manual path because if I move this plugin to a remote server it won't work. So how to get a file from the same folder as the jar.
View Replies
View Related
Aug 29, 2013
I have developed small program which read file from particular folder, i used method "getfilename" to read file name but system raise an error.
how can we read file name instead of completion path of file.
View Replies
View Related
Feb 15, 2015
What is wrong with my code? System.out.println prints the correct name, but it fails when i try to rename the files in a directory.
import java.io.BufferedReader;
import java.io.IOException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.io.*;
import java.io.File;
[code]....
View Replies
View Related
Mar 13, 2014
Within my program I allow users to write their own code to be executed. I then save that code in a .java file and then compile. This gives me a .java file and a .class file within the same package in the src folder. However, the compilation process also creates a .class file in the build folder. When the user edits their code and then re-runs it, the .class file in the build folder does not get updated with the new data, but the .class in the src folder does.
What I want to do is to execute the .class file in the src folder and not the build folder. So far I have the following method, but that somehow refers to the .class file in the build folder:
public void runMethod(String packageFilePath, String className){
try{
URI fileURI = new URI("file:/src/uk/learningAid/UserInputs/");
URL url = fileURI.toURL();
URL[] urls = new URL[]{url};
[code]....
View Replies
View Related
Apr 27, 2014
I am a new to Java and currently doing a study on applets.
I was looking for the demo folder in the jdk but I cannot find it. I was previously using jk7_51 and now using jdk8. and both of them do ot have the folder. I downgraded to jdk6 but i still could not find the foler. I need it since i need to try out the applets that come with the jdk. What I should do?
View Replies
View Related
Feb 9, 2007
i have some jsps under WEB-INF folder and as i know that they cant be access directly. so how can i access those jsps.
View Replies
View Related
Aug 15, 2014
I have observed a strange behavior in my system. whenever i installed jdk1.8.0_11, the issue is that, unknowingly the 'Bin' folder which is underneath 'C:Program FilesJavajdk1.8.0_11' is emptied. When and how it is emptied i wouldn't be knowing. I have to download the entire jdk every time in order to have Bin folder content every time.
I am using my office laptop, Is that the problem? I mean office IT department have any control on this? If so , what can i do to over come this problem?
View Replies
View Related
Apr 25, 2014
I need to access and view files/foldersand if possible i can download from shared folder from other system using java
View Replies
View Related
May 12, 2014
I have JSP application naming myProject ,which has been deployed in webapp folder in tomcat. I want to provide security for myProject folder. I mean, I want to protect it from copying by someone else. Is there any way to do the same. I tried by hiding the folder using one of hiding software, but when I do that, I was not able to access those files in web browser.
View Replies
View Related