Vivek Nikam

Greenhorn
+ Follow
since Aug 27, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Vivek Nikam

While using tiles:insertAttribute following error displayed on the console,

Error executing tag: Attribute 'Header' not found.
org.apache.tiles.TilesException: Attribute 'Header' not found.

Jars used :-

antlr-2.7.2.jar
commons-beanutils-1.8.0.jar
commons-collections-3.1.jar
commons-digester-2.0.jar
commons-fileupload-1.2.2.jar
commons-io-2.0.1.jar
commons-lang-2.4.jar
commons-lang3-3.1.jar
commons-logging-1.1.1.jar
freemarker-2.3.19.jar
javassist-3.11.0.GA.jar
ognl-3.0.6.jar
struts2-core-2.3.12.jar
struts2-jquery-plugin-3.5.1.jar
struts2-tiles-plugin-2.3.12.jar
tiles-api-2.0.6.jar
tiles-core-2.0.6.jar
tiles-jsp-2.0.6.jar
velocity-1.6.4.jar
xwork-core-2.3.12.jar

I don't know whether the problem is due of jars or any other problem,
please help me out

I am new to tiles, please


My tiles.xml file:-

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
"http://tiles.apache.org/dtds/tiles-config_2_0.dtd">
<tiles-definitions>
<definition name="Layout" template="../jsp/common/layout.jsp">
<put-attribute name="title" value="Books World" />
<put-attribute name="Header" value="/jsp/common/header.jsp" />
<put-attribute name="Menu" value="/jsp/common/menu.jsp" />
<put-attribute name="Body" value="/jsp/common/welcome.jsp" />
<put-attribute name="Footer" value="/jsp/common/footer.jsp" />
</definition>
<definition name="welcome.page" extends="Layout">
<put-attribute name="title" value="Welcome" />
<put-attribute name="Body" value="/jsp/common/welcome.jsp" />
</definition>
</tiles-definitions>


and tag used in jsp

<tiles:insertAttribute name="Footer"/>
While setting password to PDF, I am getting following error
Exception in thread "Main Thread" java.lang.ClassCastException: java.lang.String
at net.sf.jasperreports.engine.JRAbstractExporter.setInput(JRAbstractExporter.java:858)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:259)
at PDFPassword.main(PDFPassword.java:116)

so can you please help me? Please

I am using Eclipse.

I have included all related jars in path
itextpdf-5.2.0.jar,
commons-collections-3.2.1.jar,
commons-beanutils-1.8.2.jar,
commons-javaflow-20060411.jar,
commons-logging-1.1.jar,
jasperreports-4.5.0.jar,
commons-digester-1.7.jar,
groovy-all-1.7.5.jar,
classes12.jar
iText-2.1.7.jar


JasperDesign jasperDesign = JRXmlLoader.load("Path of jrxml file");
JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
Map parameters = new HashMap();
parameters.put("EMPNO", "7369");
Connection conn = DataBase.getConnection();

JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, conn);
JasperExportManager.exportReportToPdfFile(jasperPrint,"Path for PDF file");

JRPdfExporter exporter = new JRPdfExporter();
exporter.setParameter(JRExporterParameter.INPUT_FILE,"Path for PDF file");
exporter.setParameter(JRPdfExporterParameter.IS_ENCRYPTED, Boolean.TRUE);
exporter.setParameter(JRPdfExporterParameter.IS_128_BIT_KEY, Boolean.TRUE);
exporter.setParameter(JRPdfExporterParameter.USER_PASSWORD, "jasper");
exporter.setParameter(JRPdfExporterParameter.OWNER_PASSWORD, "reports");
exporter.setParameter(JRPdfExporterParameter.PERMISSIONS, new Integer(PdfWriter.ALLOW_COPY | PdfWriter.ALLOW_PRINTING));
exporter.exportReport();

PDF file is generated at Specified Location as mentioned in JasperExportManager.exportReportToPdfFile() but it is not password protected,
when code executed exporter.exportReport(); generates this exception. So password is not set to PDF.
I am getting same error while generating report in Text format using JRTextExporter.
Please help me.
While generating JasperReport in PDF, I am getting following error
"main" java.lang.NoClassDefFoundError: com/lowagie/text/DocumentException
I am new to the report generation, I don't have much of knowledge about it,
so can you please help me? Please

I am using Eclipse.

I have included all related jars in path
itextpdf-5.2.0.jar,
commons-collections-3.2.1.jar,
commons-beanutils-1.8.2.jar,
commons-javaflow-20060411.jar,
commons-logging-1.1.jar,
jasperreports-4.5.0.jar,
commons-digester-1.7.jar,
groovy-all-1.7.5.jar,
classes12.jar



JasperDesign jasperDesign=JRXmlLoader.load("jrxml-file-path");
JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
Map parameters = new HashMap();
parameters.put("EMPNO","1234");
Connection conn = DataBase.getConnection();
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, conn);
JasperExportManager.exportReportToPdfFile(jasperPrint,"pdf-File-path");
Vector is synchronized ArrayList is not
A Vector defaults to doubling the size of its array, while the ArrayList increases its array size by 50 percent.
Apart from this any other difference?
In which situation use ArrayList and in which Vector?
Vector is faster than ArrayList or not?javascript:emoticon
12 years ago