AndrewKent
Programmer
Hi there everyone,
I'm new to the forum and indeed new to using Cognos! I was looking for some help. I have written a very simple bit of code (using VB6) to open Impromptu, login and extract a report to .csv. Now this seems to work however I'm not sure that I have declaired my variable dates properly as the extract report comes back blank (ie the only thing in the csv file is the column headers, no data).
Sub Extract()
Dim objImpApp As Object
Dim objImpRep As Object
Dim StartDate As String
Dim EndDate As String
StartDate = txtStartDate.Text
EndDate = txtEndDate.Text
Set objImpApp = CreateObject("CognosImpromptu.Application")
objImpApp.OpenCatalog "F:\Cognos\db_local.cat", "", "", "kentaa", "novem999"
Set objImpRep = objImpApp.OpenReport("G:\MI\Cognos Reports\New Cognos Reports\E-Leads.imr", "StartDate|EndDate")
objImpRep.RetrieveAll
objImpRep.ExportASCII ("F:\Cognos MI Suite\Ya Bam.csv")
objImpRep.CloseReport
objImpApp.Quit
Set objImpRep = Nothing
Set objImpApp = Nothing
End Sub
Can anyone help please?
Cheers,
Andy
I'm new to the forum and indeed new to using Cognos! I was looking for some help. I have written a very simple bit of code (using VB6) to open Impromptu, login and extract a report to .csv. Now this seems to work however I'm not sure that I have declaired my variable dates properly as the extract report comes back blank (ie the only thing in the csv file is the column headers, no data).
Sub Extract()
Dim objImpApp As Object
Dim objImpRep As Object
Dim StartDate As String
Dim EndDate As String
StartDate = txtStartDate.Text
EndDate = txtEndDate.Text
Set objImpApp = CreateObject("CognosImpromptu.Application")
objImpApp.OpenCatalog "F:\Cognos\db_local.cat", "", "", "kentaa", "novem999"
Set objImpRep = objImpApp.OpenReport("G:\MI\Cognos Reports\New Cognos Reports\E-Leads.imr", "StartDate|EndDate")
objImpRep.RetrieveAll
objImpRep.ExportASCII ("F:\Cognos MI Suite\Ya Bam.csv")
objImpRep.CloseReport
objImpApp.Quit
Set objImpRep = Nothing
Set objImpApp = Nothing
End Sub
Can anyone help please?
Cheers,
Andy