| Stonefield Query SDK |
| ReportEngine.AfterRunReport |
Parameters
A reference to the Stonefield Query Application object, the name of the report, the output type ("PREVIEW," "PRINTER," "FILE," or "EMAIL"), the output file name (blank unless the output type is "FILE"), and a Boolean value indicating whether the report ran successfully or not.
Return Value
Any value (Stonefield Query ignores the return value).
Example
Here's an example that logs after a report is run.
Visual FoxPro
lparameters toApplication as SQApplication, tcReportName, ; tcOutputType, tcOutputFileName strtofile(tcReportName + ' ran by ' + ; SQApplication.Users.UserName, 'reportlog.txt') return
VBScript
function Main(Application, ReportName, OutputType, _
OutputFileName)
dim fso, ts
const ForWriting = 2
set fso = CreateObject("Scripting. FileSystemObject")
set ts = fso.OpenTextFile("reportlog.txt", ForWriting, True)
ts.WriteLine(ReportName + " ran by " + Application.Users.UserName)
ts.Close
end function JavaScript
function Main(Application, ReportName, OutputType,
OutputFileName) {
var fso, ts ;
var ForWriting= 2 ;
fso = new ActiveXObject("Scripting.FileSystemObject") ;
ts = fso.OpenTextFile("reportlog.txt", ForWriting, true) ;
ts.WriteLine(ReportName + " ran by " + Application.Users.UserName) ;
ts.Close ;
} C#
Please note that the method in this script must be named ReportEngine_AfterRunReport.
public static void ReportEngine_AfterRunReport(SFQApplication sfqApplication,
string reportName, string outputType, string outputFileName, bool reportRun)
{
StreamWriter writer = new StreamWriter("reportlog.txt");
writer.WriteLine(reportName + " ran by " + sfqApplication.Users.UserName);
writer.Close();
} VB.NET
Please note that the method in this script must be named ReportEngine_AfterRunReport.
public shared function ReportEngine_AfterRunReport(sfqApplication as SFQApplication, _
reportName as string, outputType as string, outputFileName as string, _
reportRun as Boolean) as Boolean
Dim writer as StreamWriter = new StreamWriter("reportlog.txt")
writer.WriteLine(reportName + " ran by " + sfqApplication.Users.UserName)
writer.Close()
Return True
End Function
See Also
ReportEngine.BeforeRunReport | Scripts
| Last Updated: 06/11/10 |