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

Impromptu 7.5 (Win7 64bit) - Scheduler Issue - Delimited ASCII

Started by fishmac, 13 Aug 2014 11:51:30 AM

Previous topic - Next topic

fishmac

On my report - Report Properties > General > CSV Export ... I have checked the "Mark text fields for import into Microsoft Excel.  When I save this file as a .csv everything is proper. 

I have the same report on the scheduler.  The only relevant option I have within Scheduler in Results > Save As is Delimited ASCII.  It is ignoring the report setting and not marking the text fields properly.

I could really use some help!

ianderson

It looks like scheduler does the equivalent of the 'ExportAscii' method with none of the optional parameters set, and ignores the 'mark as text' checkbox.

Only thing I can suggest is write a CognosScript macro to run the report and save it with the desired output, and then schedule the macro instead of the actual report.

From my simple test, this seems to do the trick (replace anything within <>, including the <>, with the required values, including file extensions for catalog, reportname, and reportoutput):

Sub Main
   Dim ImpApp       as Object
   Dim ImpCat       as Object
   Dim ImpRep       as Object

   Dim ReportName    as String
   Dim ReportOutput  as String
   Dim Catalog       as String

   Catalog      = "<your catalog>"
   ReportName   = "<the report>"
   ReportOutput = "<output filename>"   
       
   Set ImpApp = CreateObject("Impromptu.Application")

' next line just for testing
   ImpApp.Visible 1
   
   ImpApp.OpenCatalog Catalog, "Creator","<catalog password>","<database user>","<database password>"
   
   Set ImpRep = ImpApp.OpenReport(ReportName)
   
' next line ticks the 'Mark text fields...' box
   ImpRep.CSVExportOptions 1
   
' next line exports as ascii with header and fields in quotes
   ImpRep.ExportAscii ReportOutput , -1, -1
   
   ImpRep.Save
   ImpApp.Quit
   
   Set ImpRep = Nothing
   Set ImpCat = Nothing
   Set ImpApp = Nothing   

End Sub

fishmac

Thanks very much ... this worked great and you've saved me hours of frustration.