Skip to Content
avatar image
Former Member

TableUtilities.java for 2004s?

Hi we developed a number of WDJ apps on NW04 using the TableUtilites.java to perform various functions.

Now we are migrating to NW04s and a lot of the methods are deprecated.

Specifically this code:

b = xml_file.toString().getBytes("UTF-8");
IWDCachedWebResource xlfile = WDWebResource.getWebResource(b, WDWebResourceType.XLS);

How do you do this in 04s API ??

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Aug 30, 2008 at 10:38 PM

    Hi

    Try this:

    b = xml_file.toString().getBytes("UTF-8");

    IWDResource cachedExcelResource = null;

    Strinf filename ="name of the file";

    cachedExcelResource=

    WDResourceFactory.createCachedResource(b, filename, WDWebResourceType.XLS);

    Regards,

    Siva

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 31, 2008 at 02:16 AM

    siva thanks for the info...

    here is the complete block....do you know what should go in the getUrl?? it takes and int ??

    
    
    //04 way of doing it
    b = xml_file.toString().getBytes("UTF-8");
    IWDCachedWebResource xlfile = WDWebResource.getWebResource(b, WDWebResourceType.XLS);
    xlfile.setResourceName(wdTableNode.getNodeInfo().getName() + " List");
    linktoFile = xlfile.getURL();
    //04 way of doing it
    
    
    //04s way of doing it...
    b = xml_file.toString().getBytes("UTF-8");
    String filename = wdTableNode.getNodeInfo().getName() + " List";
    IWDResource xlfile = WDResourceFactory.createCachedResource(b, filename, WDWebResourceType.XLS);
    linktoFile = xlfile.getUrl(0);
    //04s kcf
    

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 31, 2008 at 02:16 PM

    i think I may have found the answer with this:

    linktoFile = xlfile.getUrl(WDFileDownloadBehaviour.ALLOW_SAVE.ordinal());
    //linktoFile = xlfile.getUrl(WDFileDownloadBehaviour.OPEN_INPLACE.ordinal());
    //linktoFile = xlfile.getUrl(WDFileDownloadBehaviour.AUTO.ordinal());
    
    

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 10, 2008 at 03:13 PM

    ok thanks

    Add comment
    10|10000 characters needed characters exceeded