Skip to Content
avatar image
Former Member

reg Export to Excel

Hi All,

I have used the Export to Excel component for my application. I have downloaded the componed from SDN. When I use it in my application for opening or saving the table data in an excel file, it is opening in XML list. The actual requirement is that it should get stored as csv file. How can I achieve that?

Can anyone help me regarding this one?

Thank You.

Regards,

Murthy.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Dec 20, 2007 at 12:56 PM

    Hi

    Check the mime type.

    and check in the code that the resource type is set to WDWebResourceType XLS

    IWDResource createResource(byte[] data, String resourceName,

    WDWebResourceType type)

    Regards

    Ayyapparaj

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Siva,

      Thanx for ur response.

      I will try this out. As of now I have a problem with the server. I am unable to do any changes in my applications. Once the problem is solved. I shall check this.

      Thank You.

      Regards,

      Murthy.

  • avatar image
    Former Member
    Mar 20, 2010 at 01:59 AM

    Hi all,

    Additionally to the constants defined in class WDWebResourceType (XML, XLS, DOC, etc.), there is a way to export a file to any MIME Type + File Extension combination that exists as a standard.

    Instead of using the type constants use the WDWebResourceType.getWebResourceType method:

    byte[] fileBytes = ... // the resource bytes you want to export
    // MIME Type: "text/csv", File Extension: "csv"
    WDWebResourceType type = WDWebResourceType.getWebResourceType("text/csv", "csv");
    IWDResource resource = WDWebResourceType.getCachedWebResource(fileBytes, "MyFileName", type);

    Finally, you can use the resource to export the file, open in browser, save as dialog, etc.

    Please check this link as reference for Mime Types List:

    [http://www.webmaster-toolkit.com/mime-types.shtml]

    Note. This was tested with SAP NW 7.11.

    (The points, please)

    Add comment
    10|10000 characters needed characters exceeded