SaveReportToIDM

You can use this function for Optiva Workflows.

Purpose

Use this function to generate and save a report document in IDM for any Optiva symbol.

Syntax

Dim variable As Boolean = SaveReportToIDM(reportUrl, jobFileName, 
objectSymbol, reportType, reportPath, outputFilePath, debugMode, 
IDMdocCode, fileName, IDMattributes)

Arguments

Parameter Description
reportUrl Optiva WebReport Url. For example: http://<machine_name>/FsWebReports/Launch.aspx

The machine_name is the web server that is hosting WebReports.

jobFileName The path and the XML file that contains the data to report.
objectSymbol Optiva object symbol. For example, Formula or Item.
reportType Either PDF for Adobe Acrobat, Excel, MS Word or HTML.
reportPath Crystal Reports template; the path and file name of the Crystal Reports RPT file to use.
outputFilePath The path and file name to which the report file will copy from a temporary report path.
debugMode To write a trace log. If “TRACE” is provided, a log file will be created. For example, “TRACE” or empty string.
IDMDocCode An IDM Doc Code to which the report will be attached.
fileName Name of the report file for the File_Name IDM attribute. If an empty string is provided, the temporary report file name that is generated will be set to the “File_Name” IDM attribute.
IDMattributes

All required attributes (i.e., OPTIVA_SYMBOL, OPTIVA_SYMBOL_ID, OPTIVA_DOC_TITLE) and any additional attributes like expiry_date for an IDM doc type.

Example

This example saves the report file in IDM for a formula object symbol.


Option Strict Off
Imports System
Imports System.Collections.Generic
Imports System.Diagnostics
Imports DocICP = Infor.DocumentManagement.ICP

Class ActionScript
 Inherits FcProcFuncSetEventWF


 Function wf_start() As Long

 Dim reportURL As String = ""
 Dim jobfileName As String = ""
 Dim objectSymbol As String = ""
 Dim reporttype As String = ""
 Dim docfilepath As String = ""
 Dim IDMdocCode As String
 Dim fileName As String
 Dim reportPath As String 
 dim outputFilePath as String 
 dim debugMode as string
 Dim IDMattributes As Dictionary(Of String, Object)

 Try
                                                
 reportURL = "http://localhost/FsWebReports/launch.aspx"  
 jobFileName = "\\SERVERNAME\FsWebReports\Source\ReportTemplate.xml"  
 objectSymbol = "FORMULA"    
 reporttype ="pdf"  
 reportPath = "\\SERVERNAME\FsWebReports\Source\FsCRMSDS01.rpt"   
 filename = "Formula_Detail_RPT." & reporttype 
 outputFilePath = ""
 debugMode  = "TRACE"  
 IDMdocCode = "Report_Attach_Test" 
                                               
' IDM Attributes 
 IDMattributes = New Dictionary(Of String, Object)
 IDMattributes .Add("OPTIVA_SYMBOL", objectSymbol)
 IDMattributes .Add("OPTIVA_SYMBOL_ID", "01010")
 IDMattributes .Add("OPTIVA_SYMBOL_VERSION", "0001")
 IDMattributes .Add("OPTIVA_DOC_TITLE", "A Test-" & DateTime.Now.toString().Trim())

 Me.SaveReportToIDM(reportUrl, jobFileName, objectSymbol, reporttype, 
 reportPath, outputFilePath, debugMode, IDMdocCode, fileName, IDMattributes)

 Catch ex As exception
 Messagelist("error :" & ex.Message)
 End Try
 Return 111

 End Function


End Class