Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6674323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:43:53+00:00 2026-05-26T03:43:53+00:00

I am creating reports (with JasperReports ) in a Java based web application. Each

  • 0

I am creating reports (with JasperReports) in a Java based web application. Each report is generated by a Servlet and is streamed back to the user.
I have problems with reports that are sent back as attachments. (Excel reports must be sent back this way because browsers can not open Excel files). Moreover, these Excel reports take too much time to generate, therefore I open them in a new tab. Meanwhile I post an info message in the original tab. (something like “Please do not close the new tab”).

The main problem is that I need to know when a report failed or succeeded. More specifically I need to know if response has been sent back and I need to know whether that response is a report or an error (right now I am sending back two different cookies). If it failed I need to show an error message, otherwise I need to remove the info message.

I have tried to use jQuery.post() to call the servlets but then then the download-dialog does not appear. Therefore I use forms. The server sends back a cookie no matter what. On client side I am waiting for cookies and when I receive one I decide what to do. This approach works BEAUTIFULLY as desicribed in a great post here.
But what approach can I take if cookies are disabled on the client side?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:43:54+00:00Added an answer on May 26, 2026 at 3:43 am

    Well, if somebody is interested in this question, here is how I finally managed to solve it. Instead of using a form to send my request to the Servlet I use the window.open() function. I open it in a new tab. Then I set an interval to check two things.

    • if the new window is closed (newWindow.closed) then I know the report generated successfully
    • if the newWindow.document.readyState is complete it means the report failed (because if the report fails I send back an inline response).

    One advantage (in my case) of this approach (beyond that is works with cookies disabled) is that I can close the new window when an exception occurred.

    NOTE: In IE8 after the window is closed the newWindow.document becomes unreachable (Permission denied). To check this I use typeof newWindow.document != 'unknown'.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a report (in Crystal Reports XI) based on a SQL stored procedure
in my grails application using jasper Reports i am creating report in pdf format,
I have a web server that is dynamically creating various reports in several formats
I have been working on a Java project in which the reports will be
Often I'm creating reports in Visual Studio's Crystal Reports and want to have a
I am attempting to have a ReportHandler service to handle report creation. Reports can
I am creating some reports for an application to be used by various states.
I have developed a web application driven by a mysql database that stores information
I have created some lovely reports using SQL Server Business Intelligence Development creating a
I have to tabs, new and REPORTS. In the REPORTS tab, I'm creating a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.