Clarity

  • 1.  How would one make a scheduled export to Excel from a portlet

    Posted Jan 04, 2017 07:32 AM

    Say you had a nice portlet and the users wanted to received the data every day without any user action.

    I'd rather do it with a portlet than with a report.

    Doing it  the hard way would be running the query in a process and creating an xml file like Export Excel data only format out of it and storing the file and then retrieving it as an attachment to the emails.

    Any shortcuts? Like putting the content of the file into the body of the email or constructing the body to be a table format of the data content only without the xml tags or maybe with html table tags.

     

    Using search scheduled Export to Excel or scheduled portlet did not bring anything helpful.



  • 2.  Re: How would one make a scheduled export to Excel from a portlet

    Posted Jan 04, 2017 08:24 AM

    Have you checked this ?

     

    How to code an HTML formatted email using GEL script

    https://communities.ca.com/message/241738049 

     

    NJ



  • 3.  Re: How would one make a scheduled export to Excel from a portlet
    Best Answer

    Posted Jan 04, 2017 08:29 AM

    I think that the "right" answer is to just create a scheduled report (reusing the query from the portlet) in your reporting tool (Jaspersoft/BO) and distribute the output via email.

     

    But if you really don't want to use a report-tool, then you could build (in "any" technology) something that called the portlet's existing query (via SOAP) and process the output (processing that response XML can get a bit technical though). I have built a number of things like that in Excel, but not anything that is scheduled as such I'm afraid (my Excel things rely on the use initiating the thing - open Excel, provide a parameter, press a button etc).

     

    Ultimately it depends really what schedule options you have in your "infrastructure" as to what you would choose to handle the scheduling / report production / distribution etc (all those sort of problems are handled 'normally' by the report-tool of course).



  • 4.  Re: How would one make a scheduled export to Excel from a portlet

    Posted Jan 04, 2017 03:49 PM

    You could create a process and schedule a job to run it. Just adding HTML tags to the query results in a GEL script would give you the basic HTML content which you could put into the email.

    If you create an HTML file like that in a text editor you get something that displays like this in a browser.

     

    The downside without stylesheets is limited formatting and initial creation of the tens of HTML tags. Finally it is an HTML file not Excel nor pdf.