• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Opening the excel file multiple times

 
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

In my system , i have excel reports in my server disk . And i am opening the excel files through an action class like /viewReport.do?id=23 .....and thus from the action class i open my excel file .

After opening one excel file , i try to open another excel by clicking that link , then my system often hangs else excel shows an error saying "a report with name viewReport.do is already open " even though both of these files are different on the server

How can i avoid this ??

The reason why i am opening the excel file through an action class is , i need to perform some operations before opening that excel report

Can any one let me know how to go abt this ??
 
Ranch Hand
Posts: 242
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is typical restriction with Excel application. Forget about opening it from the web, you cannot open two excel files with same name (may be different path) at the same time. Don't know why this stupid restriction. I think there is some constant to specify while streaming the Excel data into the OutputStream, to specify a file name. With this, I guess you can void this issue.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try putting this statement in your action before outputting the stream that contains your excel file:

response.setHeader("Content-disposition","attachment; filename=myWorksheet.xls");

Make the file name different for each spreadsheet. I haven't tried this, but it seems logical that it might work.
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
The same problem with popup windows. we cant open two popup windows even they are two different paths in same page.
 
sreenath reddy
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Merill

Even setting that header is of no use .i tried that ....actually i am opening that excel in a frame using viewReport.do?reportId=28 and in the temporary interntfiles folder in windows its saving the file with the same URL and thus opening the other file (takes the same url) is causing the problem

can any let me know if u have any ideas
Regards
Sreenath
 
reply
    Bookmark Topic Watch Topic
  • New Topic