• 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

How to set active sheet in Excel sheet?

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

I have a report which opens up in Excel sheet.

Now i have 3 tabs in the sheet.but by default when excel sheet gets opened,its get opened with first tab default selected.

But my requirement is this that it should get opened with 3rd tab selected.
i.e i basically wants to set the focus to 3rd tab.

I am using java Aplet viewer to show the report.

Prashant
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So you're using some Java component for displaying XLS files? Whichever one that is, doesn't it have an API method you can use to switch between tabs?
 
Prashant Langade
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ulf

Thanks for your reply.

I analysed the code and found that


is the code which displays the output in excel sheet.

so may be i will have to look for some method in response object which can set the focus on the desired tab.

Am i right?

Prashant
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That code streams something from a servlet, so I guess the answer to my question is "no, I do not use a component to display an Excel sheet".
The servlet API doesn't know the first thing about the contents of what it streams; you need to check the API of whichever library you're using to create the file.
 
Prashant Langade
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ulf

Thanks for your reply.

But as per my knowledge,here is my analysis.


the first if block checks if the file name ends with 'PDF then the output(i.e the report contents will be shown in PDF format or else if it is not ending with
the .PDF,then the output will be shown in excel sheet.

so i think i need to do something in else statement only.

What do you think?
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know what the "the report contents" are, but you seem to assume that the servlet emits certain file types according to the content type you set. That is not the case; all that header does is tell the client "this is PDF" or "this is XLS". If the content that then gets streamed is not actually in that format, then there will be problems.

So: What format is the content in? How is it created?
 
Prashant Langade
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ulf

Thanks for your immediate replies.I certainly appreciate .

but you seem to assume that the servlet emits certain file types according to the content type you set



Yes.. it is like that only because when i commented following code



then the report output was directly shown on applet viewer. and it didnt ask for the dialog box (I have attached the dialog box)



File-download-pop-up.JPG
[Thumbnail for File-download-pop-up.JPG]
 
The overall mission is to change the world. When you've done that, then you can read this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic