yurish Posted April 8, 2008 Share Posted April 8, 2008 I'm generating reports with runReportToPdfStream method. When i'm debugging, everything is ok, but when i'm just executing my code, i can't get my report(The page cannot be displayed). I discovered, that this thing happens, when my report is very small(4 kB ). Any suggestions, what that might be? With large reports everything ok. Looks like code in streaming is executing before report runs. Code:jasperDesign = JRXmlLoader.load(jrxmlDir+jrxml);JasperCompileManager.compileReportToFile(jasperDesign,fileName);InputStream fileStream =new DataInputStream(new FileInputStream(fileName)); JasperRunManager.runReportToPdfStream(fileStream, servletOutputStream, map, dataSource);servletOutputStream.flush(); servletOutputStream.close(); fileStream.close(); File file = new File(fileName); file.delete(); variable filename is .jasper file. Help? :blush: :unsure: :unsure: Link to comment Share on other sites More sharing options...
yurish Posted April 8, 2008 Author Share Posted April 8, 2008 Forgot to mention, no exception is there. Using 1.4 java, jasperreports 1.2.8 and struts framework. Link to comment Share on other sites More sharing options...
yurish Posted April 8, 2008 Author Share Posted April 8, 2008 Tried to close filestream before i'm closing outputstream. Seem's logically. And works fine. Don't know how it would be in future. But now works. Thanks anyway. =] ;) Link to comment Share on other sites More sharing options...
yurish Posted April 11, 2008 Author Share Posted April 11, 2008 Problem still on air. Any suggestions? Link to comment Share on other sites More sharing options...
yurish Posted April 11, 2008 Author Share Posted April 11, 2008 It is strange, but when i added Thread.sleep(1000); in to my code after runReportToPdfStream, everything works. Why do i need to give system some time, when i have very small reports? Link to comment Share on other sites More sharing options...
lucianc Posted April 14, 2008 Share Posted April 14, 2008 Which browser are you using? Does the same thing happen if you write a small (static) PDF file to the response, instead of exporting a report? Regards,Lucian Link to comment Share on other sites More sharing options...
yurish Posted April 15, 2008 Author Share Posted April 15, 2008 Thank's for reply, Lucian! I'm using IE6, but in firefox2 there is the same problem. While writing small static PDF in response, problem doesn't exist. Link to comment Share on other sites More sharing options...
lucianc Posted April 16, 2008 Share Posted April 16, 2008 Is there a way we could reproduce this? I'm afraid determining the cause of this behaviour is impossible given the currently available information. Regards,Lucian Link to comment Share on other sites More sharing options...
yurish Posted April 18, 2008 Author Share Posted April 18, 2008 I don't know how to reproduce this. Now i set Code:Thread.sleep(1000) to my code. Everything is fine. Mb some king of bug, cause i'm not using the last version of JasperReports. Now it is fine. Conf of our application is: Java 1.4.2Struts Framework 1.1Jasperreports 1.2.8iReport 1.2.8IE6 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now