Hitachi Vantara Pentaho Community Forums
Results 1 to 28 of 28

Thread: Export tables to Excel

  1. #1

    Default Export tables to Excel

    Hi all,

    Im traying to implemente a button in the tables to export the data to Excel, Im using the dataTable pulggin but I dont it doesn't work as a extension point.

    Anyone have idea?

    Thanks in advance

    NL

  2. #2
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    Extension points? DataTable? What do you mean by that?
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  3. #3
    Join Date
    May 2011
    Posts
    16

    Default

    Hi

    I've tried using the same plugin: DataTables TableTools, without success. The error I'm getting is an Apache Forbidden 403 error when trying to open the .swf file used to do the conversion to PDF and Excel.

  4. #4

    Default

    Hi all,

    Fisrt sorry wanted to say Extra Options not Extension Points

    Im using the http://datatables.net/ plunggins, I need something like this http://datatables.net/release-datata...ols/index.html

    Firts I exported the js (TableTools.js and ZeroClipboard.js) in the cde dashboard, then I add in the table Extra Options this sDom: T<"clear">lfrtip and I can see the buttons and the print button it works but I can't make work the Excel button, I think the problem that this need a flash file (copy_cvs_xls_pdf.swf).

    Any ideas?

    Thanks

    NL

  5. #5

    Unhappy

    No ideas?

  6. #6
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    Jeez, don't do any of that.


    What you need is much simpler than that, just hit the url for the cda that you're using to generate the table and pass it the correct arguments.
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  7. #7

    Default

    and what would be the correct arguments to have the cda export to an excel?

  8. #8
    Join Date
    Mar 2011
    Posts
    257

    Default

    http://www.webdetails.pt/cda/cda-doc...tml#cda-editor
    doQuery with outputType= xls !

    grtz,
    Hans

  9. #9

    Default

    so it should be something like
    $BASE_URL/pentaho/content/cda/previewQuery?path=solution/cda/file.cda?query=name1?parameter1=${parameter}?outputType=xls
    ?

    Thanks

  10. #10
    Join Date
    Mar 2011
    Posts
    257

    Default

    You have to look at doQuery here is an example that will work instantly.
    http://127.0.0.1:8080/pentaho/content/cda/doQuery?path=bi-developers/cda/cdafiles/denormalized-mondrian-jdbc.cda&dataAccessId=1&paramStatus=Shipped&outputType=xls
    So in your dashboard you will have a link named export to xls or something like that and that button triggers the above URL.
    and they will get a download of the CDA in xls format.

  11. #11

    Default

    Thanks!! it works great.

  12. #12
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    Or... render_tableComponent.query.export('xls')
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  13. #13
    Join Date
    Mar 2011
    Posts
    257

    Default

    Quote Originally Posted by pmalves View Post
    Or... render_tableComponent.query.export('xls')
    I will remember this one it might come handy !

  14. #14

    Default

    Quote Originally Posted by pmalves View Post
    Or... render_tableComponent.query.export('xls')
    Where and how should I config this?

    Thanks

  15. #15
    Join Date
    Mar 2011
    Posts
    257

    Default

    javascript

  16. #16

    Default

    Quote Originally Posted by pmalves View Post
    Or... render_tableComponent.query.export('xls')
    That exact statement didn't work for me, however this does work:
    Table Component: render_tableComponent.queryState.exportData('xls')
    CCC Component: render_CCCchartComponent.query.exportData('xls')


    Sample
    <script language="javascript" type="text/javascript">
    function exportTable(){render_compTbl.queryState.exportData('xls');}
    </script>
    <form><input type="button" value="Excel Export" onclick="exportTable()" /></form>

  17. #17
    Join Date
    May 2011
    Posts
    16

    Default

    I'm trying to use the exportData that Pedro is talking about but I get an error stating that queryState (or query, I tried both) does not have a function called "exportData()". Am I missing something? Is this an out-of-the-box functionality for CCC/CDA or do I need to import something?

    Thank you very much

  18. #18

    Default

    @JonJon,
    Click on the button next to Expression.Then copy and paste this code:
    function exportTable()
    {
    render_table_C.queryState.exportData('xls');
    }
    remember the code you need to change is render_<your_table_compoenentname>. In this example I have a table component named table_C which i put it here as render_table_C.Debug putting simple alert if that code is executing when pressing button doing sth like this:
    function exportTable()
    {
    alert('excel export');
    }
    Hope that helps.
    Last edited by bidev; 12-06-2011 at 02:19 PM. Reason: type semantics

  19. #19

    Default

    Pedro,
    This feature works only in Windows and I see file called cda-export.xls under download but same code doesn't do anything in Linux?any thing i need to do there to make it work ?where do I specify where to download ?any other extra configurations?

  20. #20

    Default

    [COLOR=red !important]Failed to load resource: the server responded with a status of 404 (Not Found)[/COLOR]
    [COLOR=red !important]Render:130Uncaught TypeError: Object [object Object] has no method 'exportData'
    [/COLOR]

  21. #21

    Default

    I looked at catalina.out in Linux and this is what it shows in logs when i click in Export to Excel button there i am not sure if these error is related to this export functionality at all?
    09:50:02,257 WARN [Logger] misc-org.pentaho.platform.engine.core.system.PentahoSystem: PentahoSystem.WARN_OBJECT_NOT_CONFIGURED - Object with name "IUserDetailsRoleListService" has not been configured in the Pentaho object factory.
    09:50:47,810 ERROR [SolutionEngine] d94ac801-20e2-11e1-a5f2-3167b106168f:SOLUTION-ENGINE:session-region-list.xaction: SolutionEngine.ERROR_0007 - Action sequence execution failed
    09:50:53,019 WARN [Logger] misc-org.pentaho.platform.engine.core.system.PentahoSystem: PentahoSystem.WARN_OBJECT_NOT_CONFIGURED - Object with name "IUserDetailsRoleListService" has not been configured in the Pentaho object factory.

  22. #22
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    Ae you sure you have the latest version? Should work regardless
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  23. #23

    Default

    I have 3.8 version in both Windows and Linux.Windows is fine works like charm putting same code in Linux not able trigger it to open excel.I put the alert in method its going into it some how its not opening the Excel.I made sure I gave permission too all solutions folder.Where do I set where to download like the download folder in Windows by default.

  24. #24

    Default Got this feature working in Ubuntu/LibreOffice too

    Quote Originally Posted by pmalves View Post
    Ae you sure you have the latest version? Should work regardless
    Pedro,
    I tried this feature today in my Personal computer that has Ubuntu and works fine.So seems the issue I am having is related to that particular server.
    I will track it.Thanks for your time to respond to my query.

  25. #25

    Default

    Pedro,
    I was trying all the export format documented here for CDA but was able to make it working only for xls and csv format?But other formats does nothing with same code?Any thing I am doing wrong here?
    "doQuery has an optional argument, outputType, where the format of the returned data is specified as either `json, xml,csv, xls or html. The default value is json."
    Also it it possible to make it working for Pdf and word as well ?What do I need to do for that?

    I see the logs and see this exporter not available:
    Caused by: java.lang.ClassNotFoundException: pt.webdetails.cda.exporter.HmtlExporter
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    Last edited by bidev; 12-12-2011 at 04:18 PM. Reason: logs added

  26. #26
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    "Hmtl"?
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  27. #27

    Default

    I did make it to 'html' but still no luck?Does it support export to Pdf/Word as well?It doesn't says those type are supported in docs of CDA so didn't tried those format.

  28. #28
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    Did you read cda.webdetails.org?
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.