• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to show Excel workbook content in browser on the fly?

 
Gershwin Yesudhas
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ranchers,

Its been a while. Hope everyone and everything is good at your end.
I am currently looking for a best option to show the content of a workbook or an excel in browser on the fly of generating the workbook.
Currently, I am able to save the content as an xlsx file which is actually taking space in the temp folder while creation. This becomes an overhead for the user to delete the temp files manually.

So I am thinking of bringing the content of the generated excel file on the screen and give an option in the screen to download that into file.
In detail - currently,

ServletActionContext.getResponse().setContentType("application/vnd.ms-excel");
ServletActionContext.getResponse().addHeader("content-disposition",
"attachment; filename=" + filename);


Instead of creating a file, I want to the excel items to be shown on the screen on the fly.
Let me know if my question needs more clarity.

Thanks,
Gersh
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would use a content-disposition of "inline" instead of "attachment", but what happens then is still dependent on the browser and the user's settings. It might be displayed (if a plugin is available that can do this), or it might still be saved if the user prefers that.
 
Gershwin Yesudhas
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:You would use a content-disposition of "inline" instead of "attachment", but what happens then is still dependent on the browser and the user's settings. It might be displayed (if a plugin is available that can do this), or it might still be saved if the user prefers that.


Thank You Dittmer.
I did try this "inline" option already but still it does use the filename concept.
right?


Is there a way where we can use the generation of the excel file to be shown directly on the browser.
Please help.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure what you mean by "the filename concept". As I said, there is no guarantee that the file will be displayed in the browser, due to the two reasons I mentioned.
 
Gershwin Yesudhas
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Ulf.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!