kikkerkermit
Programmer
Dear cognos experts,
I have script problem and i need desperately help. Sometimes i pass a variabele to a powerplay report that gives an empty report.
I get than the message, and the script process hangs.
message:
THIS REPORT CONTAINS NO DATA VALUES. NO PDF FILE WAS CREATED
But what i want is that the report resumes.
I have tried on error resume next but this does not work. does someone has an idea, please !!!
Thanks in advance
SCRIPT (in the script stands the message on the line with *** ***)
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Naam : Genereer '
' Eigenaar : Maarten van Eck Getronics/PinkRoccade Food '
' Datum : 16-11-2005 '
' Versie : 1.0 '
' Ltste wijziging : 16-11-2005 '
' '
' Doel : Aan de hand van een extern bestand wordt een filter '
' opgehaald. Deze wordt vervolgens naar een PowerPlay rapport '
' rapport gestuurd en tot slot wordt een excelbestand of PDF-bestand '
' van dit PowerPlay rapport gemaakt. '
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' CONSTANTEN
CONST Inputfile = "G:\Cognos\Tombola\input\inputmail.txt"
' VARIABELEN
DIM Rapport as String
DIM Excelrapport as String
DIM Export as String
DIM Lijst as String
DIM Aantal as Integer
DIM Regel as String
DIM Home as String
DIM Teller as Integer
DIM Duur as Long
dim strPadImpReport as String
dim strPadMacro as String
dim strPadXLSReport as String
dim strPadPDFReport as String
dim strPadXLSServer as String
dim strPadPDFServer as String
dim Serverdir as String
dim ivpdir as String
Dim SourceName As String
Dim DestPDFName As String
Dim objPDF as Object
Dim objPPRep as Object
Dim objPPAPP as Object
DIM ExcelSheet as Object
Sub Main()
'Paden instellen
strPadImpReport = "G:\Cognos\Tombola\reports\"
strPadMacro = "G:\Cognos\Tombola\macro\"
strPadCatalog = "G:\Cognos\Tombola\catalog\"
strPadXLSReport = "G:\Cognos\Tombola\xls\"
strPadPDFReport = "G:\Cognos\Tombola\pdf\"
strPadXLSServer = "G:\Cognos\Tombola\xls\"
strPadPDFServer = "k:\tombola\pdf\"
'Powerplay openen waarbij de postwijk centraal staat.
SourceName = "G:\Cognos\Tombola\Cube\mozaiek.ppr"
'Openen van PowerPlay
Set objPPAPP = CreateObject("CognosPowerPlay.Application")
objPPAPP.Application.Visible =True
'Te exporteren rapporten opzoeken
Open InputFile For Input As #1
'Logfile openen
kill strPadPDFReport & "logfile.txt"
Open strPadPDFReport & "logfile.txt" For Output As #2
'Beginnen bij derde regel
Line Input #1, Regel
Line Input #1, Regel
'Starttijd wegschrijven in logfile
Print #2, "================================================================================="
Print #2, " LOGFILE GENEREREN PDF BESTANDEN "
Print #2, "================================================================================="
Print #2, "Startdatum: " & Date$
Print #2, "Starttijd : " & Time$
Print #2, "================================================================================="
do while not EOF(1)
Line Input #1, Regel
regio = Trim(Left (Regel, 10))
bezorger = Trim(Mid (Regel,13,16))
' Openen van PowerPlay-rapport
Set objPPRep = CreateObject("CognosPowerPlay.Report")
objPPRep.Open SourceName
objPPRep.Visible = True
' Elke keer terug naar het bovenste niveau
objPPRep.dimensionline.item("regio").changetotop
' Geef de parameter door
objPPRep.dimensionline.item("regio").change(regio)
'-----------------------------------------------------'
' Creeren PDF bestand
'-----------------------------------------------------'
Set objPDF = objPPRep.PDFFile( "g:\cognos\tombola\pdf\" & regio & "_postwijk.pdf" , True )
With objPDF
.SaveEntireReport = True
.SaveAllCharts = True
.AxisOnAllPages = True
.ChartTitleOnAllPages = True
.IncludeLegend = True
.SetListOfLayersToSave objPPRep.Layers
.SetListOfRowsToSave objPPRep.Rows
End With
objPDF.Save
on error resume next
Set objPDF = Nothing
objPPRep.Close
Set objPPRep = Nothing
loop
********** Sometimes I Got THE POPUP: THIS REPORT CONTAINS NO DATA VALUES. NO PDF FILE WAS CREATED *************
'Eindtijd wegschrijven in logfile
' Duur = Time - Duur
Print #2, ""
Print #2, "================================================================================="
Print #2, "Einddatum: " & Date$
Print #2, "Eindtijd : " & Time$
' Print #2, "Duur : " & Minute(Duur)
Print #2, "================================================================================="
Close #1
Close #2
'PowerPlay sluiten
'objPPRep.Quit
'Set objPPRep = Nothing
objPPAPP.Quit
Set objPPAPP = Nothing
I have script problem and i need desperately help. Sometimes i pass a variabele to a powerplay report that gives an empty report.
I get than the message, and the script process hangs.
message:
THIS REPORT CONTAINS NO DATA VALUES. NO PDF FILE WAS CREATED
But what i want is that the report resumes.
I have tried on error resume next but this does not work. does someone has an idea, please !!!
Thanks in advance
SCRIPT (in the script stands the message on the line with *** ***)
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Naam : Genereer '
' Eigenaar : Maarten van Eck Getronics/PinkRoccade Food '
' Datum : 16-11-2005 '
' Versie : 1.0 '
' Ltste wijziging : 16-11-2005 '
' '
' Doel : Aan de hand van een extern bestand wordt een filter '
' opgehaald. Deze wordt vervolgens naar een PowerPlay rapport '
' rapport gestuurd en tot slot wordt een excelbestand of PDF-bestand '
' van dit PowerPlay rapport gemaakt. '
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' CONSTANTEN
CONST Inputfile = "G:\Cognos\Tombola\input\inputmail.txt"
' VARIABELEN
DIM Rapport as String
DIM Excelrapport as String
DIM Export as String
DIM Lijst as String
DIM Aantal as Integer
DIM Regel as String
DIM Home as String
DIM Teller as Integer
DIM Duur as Long
dim strPadImpReport as String
dim strPadMacro as String
dim strPadXLSReport as String
dim strPadPDFReport as String
dim strPadXLSServer as String
dim strPadPDFServer as String
dim Serverdir as String
dim ivpdir as String
Dim SourceName As String
Dim DestPDFName As String
Dim objPDF as Object
Dim objPPRep as Object
Dim objPPAPP as Object
DIM ExcelSheet as Object
Sub Main()
'Paden instellen
strPadImpReport = "G:\Cognos\Tombola\reports\"
strPadMacro = "G:\Cognos\Tombola\macro\"
strPadCatalog = "G:\Cognos\Tombola\catalog\"
strPadXLSReport = "G:\Cognos\Tombola\xls\"
strPadPDFReport = "G:\Cognos\Tombola\pdf\"
strPadXLSServer = "G:\Cognos\Tombola\xls\"
strPadPDFServer = "k:\tombola\pdf\"
'Powerplay openen waarbij de postwijk centraal staat.
SourceName = "G:\Cognos\Tombola\Cube\mozaiek.ppr"
'Openen van PowerPlay
Set objPPAPP = CreateObject("CognosPowerPlay.Application")
objPPAPP.Application.Visible =True
'Te exporteren rapporten opzoeken
Open InputFile For Input As #1
'Logfile openen
kill strPadPDFReport & "logfile.txt"
Open strPadPDFReport & "logfile.txt" For Output As #2
'Beginnen bij derde regel
Line Input #1, Regel
Line Input #1, Regel
'Starttijd wegschrijven in logfile
Print #2, "================================================================================="
Print #2, " LOGFILE GENEREREN PDF BESTANDEN "
Print #2, "================================================================================="
Print #2, "Startdatum: " & Date$
Print #2, "Starttijd : " & Time$
Print #2, "================================================================================="
do while not EOF(1)
Line Input #1, Regel
regio = Trim(Left (Regel, 10))
bezorger = Trim(Mid (Regel,13,16))
' Openen van PowerPlay-rapport
Set objPPRep = CreateObject("CognosPowerPlay.Report")
objPPRep.Open SourceName
objPPRep.Visible = True
' Elke keer terug naar het bovenste niveau
objPPRep.dimensionline.item("regio").changetotop
' Geef de parameter door
objPPRep.dimensionline.item("regio").change(regio)
'-----------------------------------------------------'
' Creeren PDF bestand
'-----------------------------------------------------'
Set objPDF = objPPRep.PDFFile( "g:\cognos\tombola\pdf\" & regio & "_postwijk.pdf" , True )
With objPDF
.SaveEntireReport = True
.SaveAllCharts = True
.AxisOnAllPages = True
.ChartTitleOnAllPages = True
.IncludeLegend = True
.SetListOfLayersToSave objPPRep.Layers
.SetListOfRowsToSave objPPRep.Rows
End With
objPDF.Save
on error resume next
Set objPDF = Nothing
objPPRep.Close
Set objPPRep = Nothing
loop
********** Sometimes I Got THE POPUP: THIS REPORT CONTAINS NO DATA VALUES. NO PDF FILE WAS CREATED *************
'Eindtijd wegschrijven in logfile
' Duur = Time - Duur
Print #2, ""
Print #2, "================================================================================="
Print #2, "Einddatum: " & Date$
Print #2, "Eindtijd : " & Time$
' Print #2, "Duur : " & Minute(Duur)
Print #2, "================================================================================="
Close #1
Close #2
'PowerPlay sluiten
'objPPRep.Quit
'Set objPPRep = Nothing
objPPAPP.Quit
Set objPPAPP = Nothing