Hello Everybody,
Can someone recommend any good book on Impromptu 6.0 advanced features as stored procedures, filtering reports etc. The documentation provided with the product is not too impresive.
Actually, maybe someone could help me 2 problems, they don't seem to be very complicated, but I can't find good help.
First thing is, I run macro before running the report to gather start and end dates to limit scope of the report,
I'm getting this 2 values ok, just don't know how to filter it. I need one of the fields to be between this 2 dates, I found the following sample in the documention, but don't know what I need to set '.AppendEx' to.
Sub ApplyFilter(dStartDt$, dEndDt$)
Dim objImpApp As Object
Dim objImpCat As Object
Dim objDB as object
Dim objUser As Object
Dim objFilter As Object
Set objImpApp = CreateObject("CognosImpromptu.Application"
Set objImpCat = objImpApp.ActiveCatalog
Set objDB = objImpCat.Databases("SCC"
Set objUser = objImpCat.ActiveUserClass.UserClasses(1)
Set objFilter = objUser.CreateFilterFor _
(objDB.Tables("SCC_2A_KEYS".Columns("CREATE_TIMESTAMP")
With objFilter
.AppendEx objDB.Tables("SCC_2A_KEYS".Columns("CREATE_TIMESTAMP"
.AppendEx 29 '<>
.AppendEx 1, dStartDt 'string constant
.AppendEx 1, dEndDt 'string constant
.Commit
End With
ObjImpCat.Save
Set objDB = Nothing
Set objUser = Nothing
Set objFilter = Nothing
Set objImpCat = Nothing
Set objImpApp = Nothing
End Sub
The other problem is, trying to execute stored procedure from within the macro, I created procedure in SQL Server and trying to execute the following macro code:
Sub Main()
Dim ImpApp As Object
Dim ImpSP As Object
Set ImpApp = CreateObject("Impromptu.Application"
ImpApp.OpenCatalog "C:\Census2001\SCC_ Reporting\Testsp.cat"
Set ImpSP = ImpApp.CreateStoredProcedure
ImpSP.SetProcedure "TestImp"
ImpSP.Execute
End Sub
It doesn't seem to be any link between the procedure and calling macro. I have feeling I'm doing something wrong setting up the catalog.
Any help would be greatly apreciated.
Andrew
Can someone recommend any good book on Impromptu 6.0 advanced features as stored procedures, filtering reports etc. The documentation provided with the product is not too impresive.
Actually, maybe someone could help me 2 problems, they don't seem to be very complicated, but I can't find good help.
First thing is, I run macro before running the report to gather start and end dates to limit scope of the report,
I'm getting this 2 values ok, just don't know how to filter it. I need one of the fields to be between this 2 dates, I found the following sample in the documention, but don't know what I need to set '.AppendEx' to.
Sub ApplyFilter(dStartDt$, dEndDt$)
Dim objImpApp As Object
Dim objImpCat As Object
Dim objDB as object
Dim objUser As Object
Dim objFilter As Object
Set objImpApp = CreateObject("CognosImpromptu.Application"
Set objImpCat = objImpApp.ActiveCatalog
Set objDB = objImpCat.Databases("SCC"
Set objUser = objImpCat.ActiveUserClass.UserClasses(1)
Set objFilter = objUser.CreateFilterFor _
(objDB.Tables("SCC_2A_KEYS".Columns("CREATE_TIMESTAMP")
With objFilter
.AppendEx objDB.Tables("SCC_2A_KEYS".Columns("CREATE_TIMESTAMP"
.AppendEx 29 '<>
.AppendEx 1, dStartDt 'string constant
.AppendEx 1, dEndDt 'string constant
.Commit
End With
ObjImpCat.Save
Set objDB = Nothing
Set objUser = Nothing
Set objFilter = Nothing
Set objImpCat = Nothing
Set objImpApp = Nothing
End Sub
The other problem is, trying to execute stored procedure from within the macro, I created procedure in SQL Server and trying to execute the following macro code:
Sub Main()
Dim ImpApp As Object
Dim ImpSP As Object
Set ImpApp = CreateObject("Impromptu.Application"
ImpApp.OpenCatalog "C:\Census2001\SCC_ Reporting\Testsp.cat"
Set ImpSP = ImpApp.CreateStoredProcedure
ImpSP.SetProcedure "TestImp"
ImpSP.Execute
End Sub
It doesn't seem to be any link between the procedure and calling macro. I have feeling I'm doing something wrong setting up the catalog.
Any help would be greatly apreciated.
Andrew