| Stonefield Query SDK |
| ReportEngine.AfterReportPrepared |
Parameters
A reference to the Stonefield Query Application object, the path for the report file about to be output, the output type ("PREVIEW," "PRINTER," "FILE," or "EMAIL"), and the output file name (blank unless the output type is "FILE").
Return Value
True if the report output should proceed or False if not.
Example
Here's an example that prevents output from being sent to a network drive.
Visual FoxPro
lparameters toApplication as SQApplication, tcReportFileName, ;
tcOutputType, tcOutputFileName
local llReturn
llReturn = .T.
if tcOutputType = 'FILE' and left(tcOutputFileName, 2) <> 'C:'
messagebox('Cannot output to network drive.')
llReturn = .F.
endif
return llReturn VBScript
function Main(Application, ReportFileName, OutputType, _ OutputFileName) Main = True if OutputType = "FILE" and left(OutputFileName, 2) <> "C:" then msgbox "Cannot output to network drive." Main = False end if end function
JavaScript
function Main(Application, ReportFileName, OutputType,
OutputFileName) {
var ReturnValue ;
ReturnValue = true ;
if (OutputType = 'FILE' && OutputFileName.substring(1, 2) != "C:") {
ReturnValue = false
}
return ReturnValue ;
} C#
Please note that the method in this script must be named ReportEngine_AfterReportPrepared.
public static bool ReportEngine_AfterReportPrepared(SFQApplication sfqApplication, string reportFileName, string outputType, string outputFileName)
{
bool returnVal = true;
if (outputType.ToUpper() == "FILE" && outputFileName.Substring(0, 2) != "C:")
{
returnVal = false;
}
return returnVal;
} VB.NET
Please note that the method in this script must be named ReportEngine_AfterReportPrepared.
public shared function ReportEngine_AfterReportPrepared(sfqApplication as SFQApplication, reportFileName as string, outputType as string, outputFileName as string) as Boolean
Dim returnVal as boolean = true
if outputType.ToUpper() = "FILE" AND outputFileName.Substring(0, 2) <> "C:"
returnVal = false
End If
return returnVal
End FunctionSee Also
Scripts
| Last Updated: 06/22/10 |