Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want to export sheet to PDF format and save it as pdf file.
Like, i want to have snapshot of whole sheet and save it as PDF.
Is there any macro to achieve this functionality?
HOPE THIS HELP YOU
VIKAS
HI Uday ,
Try This ..
Sub PrintReport()
ActiveDocument.ClearAll
Dim FieldName
FieldName = "Country"
Dim mySelections
set mySelections = _
ActiveDocument.Fields(FieldName).GetPossibleValues
Dim i
for i = 0 to mySelections.Count - 1
Dim FieldValue
FieldValue = mySelections.Item(i).text
ActiveDocument.Fields(FieldName).Select FieldValue
Print_PDF FieldValue, "My Report", "RP01"
Next
End Sub
Sub Print_PDF(FieldValue, ReportName, ReportID)
' This is mostly reference code from the
' PDF Creator documentation
' Designed for early bind, set reference to PDFCreator
Dim pdfjob
Dim sPDFName
Dim sPDFPath
'/// Change the output file name here! ///
sPDFName = ReportName & " - " & FieldValue
sPDFPath = "C:\Temp"
Set pdfjob = CreateObject("PDFCreator.clsPDFCreator")
With pdfjob
If .cStart("/NoProcessingAtStartup") = False Then
If .cStart("/NoProcessingAtStartup", True) = _
False Then
Exit Sub
End if
.cVisible = True
End If
.cOption("UseAutosave") = 1
.cOption("UseAutosaveDirectory") = 1
.cOption("AutosaveDirectory") = sPDFPath
.cOption("AutosaveFilename") = sPDFName
.cOption("AutosaveFormat") = 0 ' 0 = PDF
.cClearCache
End With
' Print the QlikView Report
ActiveDocument.PrintReport ReportID, "PDFCreator"
' Wait until the print job has entered the print queue
Do Until pdfjob.cCountOfPrintjobs = 1
ActiveDocument.GetApplication.Sleep 20
' in VBScript use WScript.Sleep(20)
Loop
pdfjob.cPrinterStop = False
' Wait until PDF creator is finished
' then release the objects
Do Until pdfjob.cCountOfPrintjobs = 0
ActiveDocument.GetApplication.Sleep 20
Loop
pdfjob.cClose
Set pdfjob = Nothing
End Sub
Hope It Helps
You need to install free PDF BULLZIP
Vikas
Hi Uday,
Hope this link make help for you.
http://community.qlik.com/thread/102666
- Regards
Vishal Waghole.