EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB36388: How to Execute a Prompted Report Services Document and Export the Resulting Document to PDF using the Intelligence Server SDK 9.x.


Community Admin

• Strategy


The following code snippet shows how to execute a prompted Report Services Document and export the resulting document to PDF. The code answers a value prompt

The following code snippet shows how to execute a prompted Report Services Document and export the resulting document to PDF. The code answers a value prompt
 
 
Sample Code/Error
' Find the objects
    Set oComDocumentDef = oComObjSource.FindObject("8650172D48AAC1F7ED5FD8A80D95CE57", DssTypeDocumentDefinition) ' Search for the Document Object ID
    Set oComPrompt = oComObjSource.FindObject("C8C7605E488A679B940503BCE11E6919", DssTypePrompt) ' Search for the value prompt ID
 
    Set oComDocumentSource = oComSession.Component(DssRoleDocumentSource)
    Set oComResolution = oComSession.ObjectSource.NewObject(DssTypeResolution, DssSourceDoNotCache)
' Execute document definition
    Set objDocServer = MySession.Component(DssRoleDocumentSource)
    Set objDocInstance = objDocServer.ExecuteDefinition(MyDocDef, 15, 1)
' Build prompt answer
    Set oComPrompt2 = lResolution.Add(oComPrompt)
    oComPrompt2.Answer = CLng(2)
    oComPrompt2.Closed = True
' Answer prompts
    Call objDocServer.PromptResume(objDocInstance, lResolution, MySession.UserRuntime, lngCookie)
' Execute document instance
    Call objDocServer.Execute(objDocInstance, 268435457, 1)
'   Export the document instance to PDF using the Export Engine
    Dim abcArray() As Byte
    abcArray = objDocInstance.ExportDocument(DssExportFormatPdf)
' Save as file
    Dim myFile As String
    myFile = "c:\temp\SDK.pdf"
    Open myFile For Binary As 1 'open, put, and close the .pdf file
    Put #1, 1, abcArray
    Close #1
 
 
A working VB6.0 sample can be found here 

ka04W000000Od7eQAC_0EM440000002Gn5.png

ExportDocument
 
 
 
CUSTOMIZATION WARNING
 
This customization is provided as a convenience to Strategy users and is only directly applicable to the version stated. While this code may apply to other releases directly, Strategy Technical Support makes no guarantees that the code provided will apply to any future or previous builds. In the event of a code change in future builds, Strategy Technical Support makes no guarantee that an updated version of this particular customization will be provided. In the event of a code change in future builds, Strategy may not be able to provide additional code on this matter even though this customization is provided at this time for this specific build. For enhancements to this customization or to incorporate similar functionality into other versions, contact your Account Executive to inquire about Strategy consulting assistance.
 
 
 
 
 
 
 
 
 


Comment

0 comments

Details

Knowledge Article

Published:

June 23, 2017

Last Updated:

June 23, 2017