Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
When I click on a button in a qlikview sheet , I want to open ana existing pdf report ? I think I should use macros , but don't have the macro codes for this operation !
My idea is that some of the customers use qlikview via a browser! so they do not have the menu "reports" ! and need to use some reports that have been already created!
Any reason why your not creating a text object, and then actions>add>external>launch?
Try to use this...
Hope this code help you
sub ReportCheck
set var = ActiveDocument.Variables("vCreatePDF")
val = var.GetContent.String
if val = 1 then
call CreateReports
var.SetContent 0, true
end if
End Sub
'***************************************************
'Functions creates the reports in PDF format
'***************************************************
sub CreateReports
tempFolder = "D:\DataPDF"
reportID = "RP01"
set rep = ActiveDocument.GetReport(reportID)
'set vShow = ActiveDocument.Variables("vShow")
'vShow.SetContent "on", true
reportName = rep.Name
'Create the file name with path
reportFile = tempFolder & "\" & reportID & "_" & reportName & ".pdf"
'print the report
printReportPDF reportID, tempFolder 'Call the function
'Rename the report
'checkOutputFile reportFile, tempFolder 'Call the function
'call ClearDefault() 'Call the function
end sub
'***************************************************
'Actual function to print the PDF format without being asked for location to save
'***************************************************
function printReportPDF(oReport, pdfLocation)
Set WSHShell = CreateObject("WScript.Shell")
WSHShell.RegWrite "HKCU\Software\CUSTPDF Writer\DefaultLocation", pdfLocation, "REG_SZ"
WSHShell.RegWrite "HKCU\Software\CUSTPDF Writer\UseJobName", "1", "REG_SZ"
WSHShell.RegWrite "HKCU\Software\CUSTPDF Writer\UseDefaultLocation", "1", "REG_SZ"
'QV Print
ActiveDocument.PrintReport oReport, "PDFCreator",false
set WSHShell = nothing
end function
and than create the
"I created a trigger OnOpen to run macro "ReportCheck"
Hope this help you.
Thanks and regards
Kamal
I wonder whether you have ever tried to convert pdf files into text? How about this one I found by Google? Any suggetsion will be appreciated. Thanks in advance.