If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Rename Files using Cognos

Started by dsmuker, 27 Jan 2020 07:20:20 PM

Previous topic - Next topic

dougp

Nope.  The script gets called when a copy of a report output (version) are created on the file system.  It does not run when the report is sent to the file system using Run as... or a schedule and the option "Save report as external file" is used (and output is not saved as a version).

Francis aka khayman

i haven't tested but if you schedule the report you can select 2 kinds of deliveries: Save report as external file and save report.

i could be wrong here but i think if you select both, it will save the report 2x as well as run the script. through the script you can then rename the file created in save report as external file provided the output folder is fixed, then delete the duplicate files.

dougp

I think I finally understand how this works.  It seems less configurable, but the script picks up the rest of the configuration...

My current way (using Archive Location File System Root):

  • Within the Archive Location File System Root, a folder is created for a user or business unit to write to.  This is usually a junction pointing to their folder on the network.  (like a shared folder or a web site folder)
  • In Define File System Locations, I configure an alias to the folder and apply permissions for certain users, groups, or roles to use (write to) that alias.
  • Users schedule or use "run as" to get their reports to run and write output to their location.

To replicate the functionality using CM.OutPutLocation and CM.OutputScript:

  • For the folder or report in Cognos, apply permissions for certain users, groups, or roles to create versions.  (write or full permission?)
  • Users schedule or use "run as" to save their report output as a version of the report.
  • Cognos saves a copy to the folder defined in CM.OutPutLocation.
  • The script defined in CM.OutputScript runs.  This script can:

    • Identify which file was just created.
    • Read the description (xml) file to determine the report path.
    • If the report path matches a specific pattern or value, do something (like copy it to the subfolder/junction and rename it to something meaningful like the report name).
    • Delete the original output file.


So the second option seems like more coding, but far more flexible.  It must be a .bat file, but that can call anything (PowerShell, Windows Scripting Host, executable) to do the actual work, so batch programming isn't even needed.

Both would not be needed.  If I implement CM.Output*, I'll probably clear the Archive Location File System Root box so that "Save report as an external file" disappears from the list of delivery options.

Thanks for sticking with me, Francis.  This was very helpful.

Francis aka khayman