Hi,

I created a button component that you can use to export any table inside your application, all you have to do is include it and give the name of the table you want to export.

First add the button and the table you want(could be the crosstab or any SDK component you developed)

/wp-content/uploads/2014/02/1_397677.png

On the component properties, you must type the name of the table you want to export.

/wp-content/uploads/2014/02/2_397678.jpg

Test it.

/wp-content/uploads/2014/02/3_397758.png

Here is the excel generated, none of the formatting is carried over, but it is a start.

/wp-content/uploads/2014/02/4_397769.jpg

Here is the code.

olafecorcam/com.leandro.gp.excel · GitHub

Let me know what you think, and any improvements you might think of.

Best

Leandro

To report this post you need to login first.

10 Comments

You must be Logged on to comment or reply to a post.

  1. Mustafa Bensan

    Hi Leandro,

    Nice example of an application of the SAPUI5 handler type and a clever approach for programmatically accessing the data of another component from within the SDK using DOM method calls.

    Thanks for sharing,

    Mustafa.

    (0) 
  2. Mike Howles

    This is great stuff 🙂

    I was doing a similar one to export charts as an invoked PNG download and was gonna do something like this, too – but now I don’t have to!

    Thanks!!

    (0) 
  3. Max Rosén

    Very nice!

    One question, the export works fine in chrome but not with IE. Just want to make sure if someone else has the same problem or if it’s my setup somehow?

    Br

    Max Rosén

    (0) 
    1. Leandro Cardoso Post author

      Hi,

      I just tried it on IE, and it does not work at all. It goes throught all the code, but it just does not do anything at all…. you’ve gotta love IE.. love love love…

      I’m a little swanped right now, but I’ll take a look at this later.

      Can you try running it inside BO LaunchPad, and not locally?

      The guy that provided me with the export function said that the UT8 must be set for it to work, and since we cannot do it locally on DS, and the launchpad already have it there, maybe it will work.

      Best

      Leandro

      (0) 
      1. Mike Howles

        Yeah I had a similar base-64 encoded approach, but with generating a PNG.  Worked in Chrome and does nothing in IE.  I think this is just a browser issue, which shouldn’t surprise anyone, LOL.

        I was really hoping to see the day where we could stop bouncing MIME creation off a server to instigate a file download, but it looks like HTML5 cannot solve all our problems just yet.  Probably also why vizPacker for Lumira only works in Chrome, too.  Same issue, but with a JS-created .ZIP in that case.

        (0) 
    1. Leandro Cardoso Post author

      Hey,

      Dimitry unfortunately I don’t have it with me or even the project loaded on a workspace to generate it..

      In a near future I’ll have to get back to DS, I’ll be able to do then. Sorry about that.

      Best

      Leandro

      (0) 
    1. Leandro Cardoso Post author

      Ali Mohammed Al Saleh,


      How are you today?


      Which browser are you using? Unfortunately this does not work on IE and I had no time to test it anymore. If it’s on chrome, can you look into the console and send me what it says in there?


      Just make sure the property component ID is set to the same name of the table you want to export.


      Best

      Leandro

      (0) 

Leave a Reply