Jump to content

JasperExportManager - Missing XLS?


Recommended Posts

By: Mark Wilson - markwil

JasperExportManager - Missing XLS?

2003-03-17 06:42

Hi,

where are the methods for exporting to XLS?

There´s a JRXlsExporter class so shouldn´t it be implemented in the JasperExportManager?

 

- Mark

 

 

 

 

By: Teodor Danciu - teodord

RE: JasperExportManager - Missing XLS?

2003-03-25 13:56

 

Hi,

 

Not necessarily. All exporters can be used directly,

without calling the export manager.

 

At first, the manager classes where introduced to

offer users quick access to the library functionality.

But with more and more exporters added,

the export manager was not enhanced anymore.

The code inside the manager is not complicated. You can see how to use the XLS exporter in all

the samples provided. It is about instantiating

an exporter, setting the parameters and calling

the export method.

In the future, I'm going to provide more

documentation for the exporter parameters

for everybody to see how they are used.

 

Thank you,

Teodor

 

 

 

 

 

By: rolas - rolas

RE: JasperExportManager - Missing XLS?

2003-08-12 14:00

hi teodoro

how can i show the .xls report on screen?

i have this into a jsp, but it says :

dori.jasper.engine.JRException: No output specified for the exporter:

 

 

 

File reportFile = new File(application.getRealPath("/reports/Anexo6.jasper"));

 

JasperReport jasperReport = (JasperReport)JRLoader.loadObject(reportFile.getPath());

 

Map parameters = new HashMap();

 

parameters.put("BaseDir", reportFile.getParentFile());

 

JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport,new HashMap(),BdConnection.getConnection());

 

JRXlsExporter exporter = new JRXlsExporter();

 

StringBuffer sbuffer = new StringBuffer();

 

Map imagesMap = new HashMap();

session.setAttribute("IMAGES_MAP", imagesMap);

exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);

response.setContentType("application/vnd.ms-excel");

exporter.setParameter(JRExporterParameter.OUTPUT_WRITER, out);

exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.FALSE);

exporter.exportReport();

 

 

 

 

By: Teodor Danciu - teodord

RE: JasperExportManager - Missing XLS?

2003-08-13 00:09

 

Hi,

 

The XLS exporter does not deal with the

OUTPUT_WRITER if supplied. However, it knows how

to deal with an output stream.

 

Replace this line:

 

exporter.setParameter(JRExporterParameter.OUTPUT_WRITER, out);

 

with this one:

 

exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, response.getOutputStream());

 

I hope this helps.

Teodor

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