| Stonefield Query SDK |
| ReportEngine.BeforeRunReport |
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"), the output file name (blank unless the output type is "FILE"), and a reference to a Report object for the report.
Return Value
True if the report run can continue, False to cancel the run..
Example
Here's an example that logs when a report is run.
Visual FoxPro
lparameters toApplication as SQApplication, tcReportFileName, ; tcOutputType, tcOutputFileName, toReport as Report strtofile(tcReportFileName + ' started by ' + ; SQApplication.Users.UserName, 'reportlog.txt') return .T.
VBScript
function Main(Application, ReportFileName, OutputType, _
OutputFileName, Report)
dim fso, ts
const ForWriting = 2
set fso = CreateObject("Scripting. FileSystemObject")
set ts = fso.OpenTextFile("reportlog.txt", ForWriting, True)
ts.WriteLine(ReportFileName + " started by " + Application.Users.UserName)
ts.Close
Main = true
end function JavaScript
function Main(Application, ReportFileName, OutputType,
OutputFileName, Report) {
var fso, ts ;
var ForWriting= 2 ;
fso = new ActiveXObject("Scripting.FileSystemObject") ;
ts = fso.OpenTextFile("reportlog.txt", ForWriting, true) ;
ts.WriteLine(ReportFileName + " started by " + Application.Users.UserName) ;
ts.Close ;
return true;
} C#
Please note that the method in this script must be named ReportEngine_BeforeRunReport.
public static void ReportEngine_BeforeRunReport(SFQApplication sfqApplication,
string reportFileName, string outputType, string outputFileName Report report)
{
StreamWriter writer = new StreamWriter("reportlog.txt");
writer.WriteLine(reportFileName + " started by " + sfqApplication.Users.UserName);
writer.Close();
return true;
} VB.NET
Please note that the method in this script must be named ReportEngine_BeforeRunReport.
public shared function ReportEngine_BeforeRunReport(sfqApplication as SFQApplication, _
reportFileName as string, outputType as string, outputFileName as string, _
report as Report) as Boolean
Dim writer as StreamWriter = new StreamWriter("reportlog.txt")
writer.WriteLine(reportFileName + " started by " + sfqApplication.Users.UserName)
writer.Close()
Return True
End FunctionSee Also
ReportEngine.AfterReportPrepared | ReportEngine.AfterRunReport | Report Object | Scripts
| Last Updated: 06/22/10 |