Hello,
I am using a macro that saves a powerplay report as .pdf file per layer. So i use 20 layers and this results in 20 pdf files.
Since "fit to page" is no option when exporting to .pdf i thought of using a "pdf printer", via this way i can use the "fit to page" option.
But how do i add this printer in my macro? and how should the macro be changed that prints the files instead of saving them via Powerplay?
The macro looks like this
ption Explicit
Sub Main()
Dim objPDF as Object
Dim objPPRep as Object
Dim i as Integer
Dim RepNam as String
Set objPPRep = CreateObject("CognosPowerPlay.Report")
objPPRep.Open( "X:\Kobe Oberhausen\Commerciele rapportage\2004\200411\E-mail bestanden\Inkcomb pro vertreter\Inkcomb pro vertreter.ppr" )
objPPRep.visible( TRUE )
i=1
For i=1 to objPPRep.Layers.Count
RepNam = objPPRep.Layers.Item(i).Name
Set objPDF = objPPRep.PDFFile( "X:\Kobe Oberhausen\Commerciele rapportage\2004\200411\E-mail bestanden\Inkcomb pro vertreter\ " & RepNam , True )
With objPDF
.SaveEntireReport = False
.SaveAllCharts = False
.AxisOnAllPages = True
.ChartTitleOnAllPages = False
.IncludeLegend = True
.SetListOfLayersToSave objPPRep.Layers.Subset(i,i)
.SetListOfRowsToSave objPPRep.Rows
End With
objPDF.Save
Next i
Set objPPRep = Nothing
Set objPDF = Nothing
End Sub
Can someone help me?
I am using a macro that saves a powerplay report as .pdf file per layer. So i use 20 layers and this results in 20 pdf files.
Since "fit to page" is no option when exporting to .pdf i thought of using a "pdf printer", via this way i can use the "fit to page" option.
But how do i add this printer in my macro? and how should the macro be changed that prints the files instead of saving them via Powerplay?
The macro looks like this
ption Explicit
Sub Main()
Dim objPDF as Object
Dim objPPRep as Object
Dim i as Integer
Dim RepNam as String
Set objPPRep = CreateObject("CognosPowerPlay.Report")
objPPRep.Open( "X:\Kobe Oberhausen\Commerciele rapportage\2004\200411\E-mail bestanden\Inkcomb pro vertreter\Inkcomb pro vertreter.ppr" )
objPPRep.visible( TRUE )
i=1
For i=1 to objPPRep.Layers.Count
RepNam = objPPRep.Layers.Item(i).Name
Set objPDF = objPPRep.PDFFile( "X:\Kobe Oberhausen\Commerciele rapportage\2004\200411\E-mail bestanden\Inkcomb pro vertreter\ " & RepNam , True )
With objPDF
.SaveEntireReport = False
.SaveAllCharts = False
.AxisOnAllPages = True
.ChartTitleOnAllPages = False
.IncludeLegend = True
.SetListOfLayersToSave objPPRep.Layers.Subset(i,i)
.SetListOfRowsToSave objPPRep.Rows
End With
objPDF.Save
Next i
Set objPPRep = Nothing
Set objPDF = Nothing
End Sub
Can someone help me?