Jump to content
We've recently updated our Privacy Statement, available here ×

see my code that no me error after complied but no


mfa

Recommended Posts

hi master

sir i use this code for create the pdf

 

ExternalContext econtext = getExternalContext();

InputStream stream = econtext.getResourceAsStream(PREFIX);

try {

JRResultSetDataSource mcon = new JRResultSetDataSource(getSessionBean1().getChartofaccRowSet());

JasperPrint jasperPrint = null;

jasperPrint = JasperFillManager.fillReport(stream, null, mcon);

JRExporter exporter = null;

HttpServletResponse response = (HttpServletResponse)econtext.getResponse();

FacesContext fcontext = FacesContext.getCurrentInstance();

exporter = new JRPdfExporter();

exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);

exporter.setParameter(JRExporterParameter.OUTPUT_STREAM,

response.getOutputStream());

exporter.exportReport();

fcontext.responseComplete();

} catch (Exception ex) {

log(" Error Description" , ex);

error("Error counting rows: " + ex.getMessage() );

error("Error counting rows: " + ex ); }

 

sir this code not give any error but also not create /display the pdf

i try to find the where problem occurred i get textfiled and send some value after one by one line

like is this

 

first time try

 

JRResultSetDataSource mcon = new JRResultSetDataSource(getSessionBean1().getChartofaccRowSet());

textField2.setValue(PREFIX);

 

is given me right result and show /WEB-INF/reports/mfa.jasper in textfield2

 

second time

 

jasperPrint = JasperFillManager.fillReport(stream, null, mcon);

textField2.setValue(PREFIX);

 

when i press button second time this time page not give me result in textfield2 and show blank it means

 

only this line have error but what i could not foud out jasperPrint = JasperFillManager.fillReport(stream, null, mcon);

 

use see my code and give me idea or solution of my problem

 

 

thank’s

aamir

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

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