This discussion is archived
9 Replies Latest reply: Dec 10, 2009 1:19 AM by 793415 RSS

How to open Excel File from java help viewer

801455 Newbie
Currently Being Moderated
Hi All,

When i was trying to open an excel file in java help viewer, It is showing some junk characters.
Can any one clarify the following issues:

1. Is it possible to open an excel file form java help viewer. If it is possible then How to open the EXCEL file.
2. Is it possible to open the excel file in the same viewer so that i can view the content of the excel file in the same viwer

I have read the help specification docs also but i didnot found any solution. As of my knowledge, it would be achieved if we can be able to set the content type for the editorkit of the java hel viewer.But i have not found any possible way to get the editorkit.Please help me in this issue.


TIA.
  • 1. Re: How to open Excel File from java help viewer
    793415 Pro
    Currently Being Moderated
    sindhumourya wrote:
    ..When i was trying to open an excel file in java help viewer,..
    JavaHelp was designed to work with file types HTML, text, and RTF (from memory - check the spec. for more details).
    ..It is showing some junk characters.
    Can any one clarify the following issues:

    1. Is it possible to open an excel file form java help viewer. If it is possible then How to open the EXCEL file.
    Sure. You've already proved that. It won't render them correctly, but it can sure open them.
    2. Is it possible to open the excel file in the same viewer so that i can view the content of the excel file in the same viwer

    I have read the help specification docs also but i didnot found any solution. As of my knowledge, it would be achieved if we can be able to set the content type for the editorkit of the java hel viewer.But i have not found any possible way to get the editorkit.Please help me in this issue.
    Convert the XLS to HTML (or RTF, or formatted text). Problem solved.
  • 2. Re: How to open Excel File from java help viewer
    801455 Newbie
    Currently Being Moderated
    Hi AndrewThompson,

    Thanks a lot for your reply.
    I have followed the same procedure but when i am trying to save it as a html file it is showing that one can't use the futures like Shared work book etc.,.
    And also the converted file has ugly look with respect to line separations and table formats when i was opened using the java help viewer (FYI: EXCEL file has two sheets).

    But when we open the EXCEL file in the browser,it has no issues. Can i have the same feature here also?
    If it is possible, then It solves my problem.

    TIA
  • 3. Re: How to open Excel File from java help viewer
    793415 Pro
    Currently Being Moderated
    sindhumourya wrote:
    ..And also the converted file has ugly look with respect to line separations and table formats when i was opened using the java help viewer (FYI: EXCEL file has two sheets).
    FYI Open Office will export multiple sheets in one HTML, with links at the top to jump to each sheet. Perhaps you need to 'upgrade' your software.
    ..But when we open the EXCEL file in the browser,it has no issues.
    Do you mean the OS component known as Internet Explorer? It is not a browser, it is an OS component.
    ..Can i have the same feature here also?
    No browser 'here' is capable of rendering XLS files.
    If it is possible, then It solves my problem.
    If you hack into the code and call Desktop.open("the.xls") it might work, but here it would open an XLS in Open Office, rather than any browser. And also, typically the location of HelpSet resources could not be expressed as File objects, which is what the open() method uses.
  • 4. Re: How to open Excel File from java help viewer
    801455 Newbie
    Currently Being Moderated
    Hi Andrew,

    I have understood this now. i have converted XLS to HTML and displayed using the java help viewer. But here when it was given to display, it has got complete different look, compared to HTML look. Table headers are so large and some coluns are too small. How to solve this issue?

    TIA
  • 5. Re: How to open Excel File from java help viewer
    793415 Pro
    Currently Being Moderated
    sindhumourya wrote:
    ..How to solve this issue?
    Did you try to convert it using Open Office? Note that OO is 'free for the download'. I would not trust an MS product if it was the last software on earth.

    If Open Office fails to convert it to a form usable in JavaHelp, you might try opening the HTML in an editor that allows you to edit the code directly (E.G. not DreamWeaver or FrontPage or any such crap) and remove all the formatting and sizes (specifically cell and column widths). HTML without all that 'exact size' rubbish, generally formats OK in JavaHelp.
  • 6. Re: How to open Excel File from java help viewer
    801455 Newbie
    Currently Being Moderated
    Thanks Andrew,

    I have some doubts regarding Java Help viewer.

    How to set custom content viewer?
    How to get the default or present content viewer?

    I need some brief explanation or samples on this.

    i have searched a lot but i didn't find any relevant information.

    And my code is
               try
               {
                   url = HelpSet.findHelpSet(this.getClass().getClassLoader(), "Help/HelpSet.hs");
                   hs = new HelpSet(null, url);
                   hb = hs.createHelpBroker();
                   hb.setCurrentID("Introduction");
                   menuItem.addActionListener(new CSH.DisplayHelpFromSource(hb));
               }
               catch(Throwable ex)
               {
                   System.out.println("Exception : " + ex.toString());
               }
    Please tell me how to get content viewer using the above code.

    TIA

    Edited by: sindhumourya on Dec 10, 2009 4:19 AM
  • 7. Re: How to open Excel File from java help viewer
    793415 Pro
    Currently Being Moderated
    sindhumourya wrote:
    ..I need some brief explanation or samples on this.
    I need a pony. That is my way of saying, we don't always get what we want, let alone what we need. Beyond seeing in the JavaHelp FAQ and features page just now - that it supports custom components, I would not have known it did. It looks like you might need to delve into the JavaHelp documentation deeper than what I am prepared to do, in order to solve the problem.

    Once you have found out, please make sure to put the answer on the thread, for the benefit of those who are searching later. Oh, and don't forget to add "some brief explanation or samples" of how to do it. ;)
  • 8. Re: How to open Excel File from java help viewer
    801455 Newbie
    Currently Being Moderated
    Hi Andrew,

    I have read the documentation as per your suggestions.
    And also i have gone through some useful discussions like JAVAHELP-INTEREST forums.

    But when i was implementing the help, the following problems occured.

    1.JavaHelp unable to load the style sheets.
    2.Therefore,some indentation problem occured .

    And one more thing is, when i was reading the JAVA_INTEREST discussions, I came to know that
    we can create our own hyperlinks and therefore we can be able to invkoe PDF files from the viewer,
    and also there is a possibility for javascript in javahelp.Also mentioned that we can use setKeyData()
    for our own editorkit and content type.

    Now, From the above information could it be psossible to invoke excel file.
    I was unbale to understand how toimport these into my implementation as per the discussion over there.
    This is the reason why i have posted the sample code.
    And for this only i have asked brief explanation with examples.
    So that i can implement this in the exsiting code.

    Can you please show me the way to solve the above problems including this file invocation probelm..
    Sorry for my wrong description in previous post.



    TIA

    Edited by: sindhumourya on Dec 10, 2009 6:28 AM
  • 9. Re: How to open Excel File from java help viewer
    793415 Pro
    Currently Being Moderated
    sindhumourya wrote:
    Hi Andrew,

    I have read the documentation as per your suggestions.
    And also i have gone through some useful discussions like JAVAHELP-INTEREST forums.

    But when i was implementing the help, the following problems occured.

    1.JavaHelp unable to load the style sheets.
    That is odd. I have previously used JH with HTML that had relative URLs to CSS files and it worked as expected. So long as the stylesheets were on the run-time classpath of the HelpViewer, it works just fine.

    Another thing you should check is to load the HTML in a plain JEditorPane. If a JEditorPane can load the stylesheet(1) but does not render the style, it is simply that Java's CSS model does not support that feature.

    1) One easy way to check if the sylesheets are loaded at all, is to set the BG color to red,or another distinct color.
    2.Therefore,some indentation problem occured .

    And one more thing is, when i was reading the JAVA_INTEREST discussions, I came to know that
    we can create our own hyperlinks and therefore we can be able to invkoe PDF files from the viewer,
    and also there is a possibility for javascript in javahelp.
    I find that very hard to believe, if using the J2SE/JavaHelp components for rendering HTML.

    Do you have a link to that thread?
    ..Also mentioned that we can use setKeyData()
    for our own editorkit and content type.
    So have you downloaded the specs. and all the other help files for JavaHelp and looked for mentions of those things?
    Now, From the above information could it be psossible to invoke excel file.
    I do not believe so. But then, an EXE will fail on this Ubuntu Linux box of mine. Are you only offering to offer help to Windows users? o_O

    If by 'exe' you mean the generic ..PDF viewer or Image viewer, then it depends on whether JH can be made to call out to something like Desktop.open(File). I was not aware it could, but I am not sure. Either way, it is an area of JH I feel unable to make much comment on.
    I was unbale to understand how toimport these into my implementation as per the discussion over there.
    Again, the internet is a big place, care to narrow it down with an URL?
    This is the reason why i have posted the sample code.
    As far as sample code goes, the best form of sample code, is an SSCCE. I did not previously suggest that because the only way I would actully look closely into code is if you provided not only an SSCCE of Java code, but the HelpSet with stylesheets, and an ant style build.xml all wrapped up in a Zip file.
    And for this only i have asked brief explanation with examples.
    I take you back to 'I need a pony'. People who contribute here do so in their spare time. You are lucky to get a reply, let alone help, let alone a deep investigation into the JavaHelp documentation and a self contained example. Please get used to the idea that any help you get is earned, and even then it is lucky if you get replies from people with enough smarts to discover the root cause of the problems provide solutions.
    So that i can implement this in the exsiting code.

    Can you please show me the way to solve the above problems including this file invocation probelm..
    It is not something I've ever tried, and not something that I am even confident can be done. Provide a link to these threads that mention this.
    Sorry for my wrong description in previous post.
    I did not think I have misunderstood anything you wrote previously. But you need to get used to the idea that even on 'your own thread', the world does not exist to serve you.

    If you prepare the Zip archive I suggested, link to those threads, I might look further into it. Otherwise, good luck.