Menu

Adding export csv or excel to the portal

2020-08-14
2020-09-02
  • jose antonio garcia panadero

    Hello, I was wondering if there is any way of adding a button on the UserRequest(Portal) for exporting to csv or excel, I couldnt find any info on the web, so maybe you could help me out, thx

     
  • Vincent @ Combodo

    https://www.itophub.io/wiki/page?id=2_7_0%3Acustomization%3Aportal_xml
    Within the ManageBrick, there is an <export> tag which enable that feature.
    So you can have it on a list only and you can define which fields are part of the export.</export>

     
    • jose antonio garcia panadero

      but thats made from the itop/pages web if im not wrong, i need to add a button to the portal to export the ticket I have selected, ill put a image where i want to add the button.
      Btw, where do i need to add that html code for creating a button on the portal for the current user request, its on datamodel.itop-tickets.xml? or is on other file? thx

       
      • Pierre Goiffon

        Pierre Goiffon - 2020-08-17

        https://www.itophub.io/wiki/page?id=2_7_0%3Acustomization%3Aportal_xml
        Within the ManageBrick, there is an <export> tag which enable that feature</export>

        but thats made from the itop/pages web if im not wrong

        No, this is definitely part of the portal customization !
        Go see the link VIncent sent you and have a try !

         

        Last edit: Pierre Goiffon 2020-08-17
        • jose antonio garcia panadero

          but can you export fields from the module itop-request-template? at the same time with fields from ticket?

           
  • Vincent @ Combodo

    Well, I am not sure that you can do it from the portal, but you can try to put it within the list of attributes which are part of the csv export in the ManageBrick definition.

    <export>
      <fields>
          <field id="service_details"/>
          ...
    

    With the latest version of itop-request-template those fields are stored in standalone rows, so can be queried by OQL

     
    • jose antonio garcia panadero

      I tried to do it like this:
      First step -> created a new AttributeExternalKey on the class ticket for getting the templatefieldvalue.
      Second step -> created a new AttributeExternalField to reference the value of the field and the code of it
      Third step -> go to the <export><fields> and put the field AttributeExternalField on it
      Fourth step -> added a scope for the class templatefieldvalue</fields></export>

      Is that ok?

       
      • jose antonio garcia panadero

        btw, <field id="service_details"/> that worked too, but it shows all fields on the same cell and thats a bit rough

         
  • Vincent @ Combodo

    I doubt that any other method than <field id="user-content-service_details"> would work as your Portal has no clue of which fields will be created in the Template, so AttributeExternalField cannot work ! One information is part of the code, the other is dynamic while using itop.</field>

     
    • jose antonio garcia panadero

      ok thx

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.