Topic
  • 6 replies
  • Latest Post - ‏2013-11-28T15:26:45Z by M_vdLaan
jester76
jester76
68 Posts

Pinned topic How to load Excel template for exporting to excel

‏2013-10-14T10:18:48Z |

Hello,

Is there a way to load excel template. Ineed to name use specific template to export to. How can this be done.

 tried adding

         clear args
         // Change the path according to your path settings.
         put(args, "rtm.xlt")
but did not work

Thanks

Jester

Updated on 2013-10-14T10:19:49Z at 2013-10-14T10:19:49Z by jester76
  • charles.easter
    charles.easter
    2 Posts

    Re: How to load Excel template for exporting to excel

    ‏2013-11-15T14:40:26Z  

    I also would like to export a doors module to an Excel template. Any help with this will be appreciated.

    Thanks,

    Charles

  • llandale
    llandale
    2983 Posts

    Re: How to load Excel template for exporting to excel

    ‏2013-11-19T18:04:48Z  

    I also would like to export a doors module to an Excel template. Any help with this will be appreciated.

    Thanks,

    Charles

    Not very familiar, but I would consider opening a particular excel file (your template), commanding excel to Save-As, then populate it, then Save.

  • charles.easter
    charles.easter
    2 Posts

    Re: How to load Excel template for exporting to excel

    ‏2013-11-20T16:05:27Z  
    • llandale
    • ‏2013-11-19T18:04:48Z

    Not very familiar, but I would consider opening a particular excel file (your template), commanding excel to Save-As, then populate it, then Save.

    Thanks llandale.

    Specifically, what I'm trying to do is get DOORS to export directly to the Excel template. DOORS has this capability for Word, and I'm looking to do something similar for Excel.

  • HazelWoodcock
    HazelWoodcock
    25 Posts

    Re: How to load Excel template for exporting to excel

    ‏2013-11-20T16:48:02Z  

    Thanks llandale.

    Specifically, what I'm trying to do is get DOORS to export directly to the Excel template. DOORS has this capability for Word, and I'm looking to do something similar for Excel.

    DOORS has no inbuilt menu option to export to Excel.  You can export to a spreadsheet, either tsv or csv and then open that file with Excel and work whatever template magic you have.

  • Mathias Mamsch
    Mathias Mamsch
    1970 Posts

    Re: How to load Excel template for exporting to excel

    ‏2013-11-20T17:10:04Z  

    I also would like to export a doors module to an Excel template. Any help with this will be appreciated.

    Thanks,

    Charles

    Some old code says:

        OleAutoObj wbs = null;
        oleGet(objExcel, "Workbooks", wbs)
        if (null wbs) error "Could not get Workbooks Collection of Excel instance. "
        OleAutoArgs args = create();
        put(args, templatePath);
        OleAutoObj objWorkbook = null;  
        oleMethod(wbs, "Add", args, objWorkbook) // open from template
        // oleMethod  (wbs, "Open", args, objWorkbook)  // open existing Excel File

    It was encapsuled in some other syntax because of OLE helper functions, so it can be that it has some syntax errors (I did not check), but I think it might give you a start. Regards, Mathias

  • M_vdLaan
    M_vdLaan
    27 Posts

    Re: How to load Excel template for exporting to excel

    ‏2013-11-28T15:26:45Z  

    Just wondering what the required approach would be. Are thinking along the lines of:

    1. Load a template
    2. Read the first row of cells on the first sheet and match the values to object attributes
    3. For each object in the module/view:
      1. Create a new row
      2. Copy the attributes to the corresponding columns of the row

    I think that you will face issues when coming across OLE object (e.g. pictures) within rich text fields. Other than that, this should be 'doable' with the OleAutoObj interface. I might have a stab at it at some point. Sounds like a useful utility.

    BTW, you know the scripts over at Galactic Solutions Corporation? They have an Advanced Export to Excel script you can download. A while since I've seen/used it, though. Check it out.

    Good luck!