Jump to content
Changes to the Jaspersoft community edition download ×

Sending report directly to Printer (Web app)


2004 IR Help

Recommended Posts

By: Kuldip Shah - kuldipshah

Sending report directly to Printer (Web app)

2006-01-31 17:07

VERY URGENT!!!!!

 

I am sending report directly to printer. Following code works correctly however it prints in wierd fonts. I guess it is using default font from printer.

 

JasperPrint jasperPrint=null;

 

JRDataSource dataSource = new BSTCustomReportVectorDataSource(fieldNames, reportVector);

JasperDesign jasperDesign = JRXmlLoader.load(JRXMLFile);

JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);

jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, dataSource );

boolean displayPrintDialog = false;

printSucceed = JasperPrintManager.printReport(jasperPrint, displayPrintDialog);

 

I want to set Fonts before sending report to printer. How do I do this?

 

 

 

 

By: Kuldip Shah - kuldipshah

RE: Sending report directly to Printer (Web a

2006-01-31 17:30

Now I am using JRExporter to print the report.

 

JasperPrint jasperPrint=null;

 

JRDataSource dataSource = new BSTCustomReportVectorDataSource(fieldNames, reportVector);

JasperDesign jasperDesign = JRXmlLoader.load(JRXMLFile);

JasperReport jasperReport=JasperCompileManager.compileReport(jasperDesign);

jasperPrint = JasperFillManager.fillReport(jasperReport, parameters,dataSource );

 

 

JRExporter exporter = new JRPrintServiceExporter();

exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);

exporter.setParameter(JRExporterParameter.CHARACTER_ENCODING, "UTF-8" );

exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PRINT_DIALOG, new Boolean(true));

exporter.exportReport();

 

Still it prints wrong fonts.

Post edited by: tcloonan, at: 2006/08/26 09:22

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