| Stonefield Query SDK |
| PreviewReport |
Syntax
PreviewReport(ReportName as String [, Values as String]) as Boolean
Parameters
ReportName
The name of the report to run.
Values
The values for any ask-at-runtime conditions. If it is passed, this parameter must be specified as an XML string with the following format:
<values> <value>First value</value> <value>Second value</value> </values>
Put no space between the opening and closing <value> tags to indicate that a condition should be ignored. For example:
<values> <value></value> </values>
Return Value
True if the report was successfully previewed or False if not (in that case, check the ErrorMessage property of the ReportEngine object for the reason for failure; "*" means the user canceled in any ask-at-runtime dialog that may appear).
Example
This example previews the Customers report.
Visual FoxPro
loQuery = createobject('SQProxy.SQProxy')
loQuery.LoadProject('\MyProjects\Northwind', 'admin', 'admin')
if loQuery.ProjectLoaded
if not loQuery.SQApplication.ReportEngine.PreviewReport('Customers')
messagebox(loQuery.SQApplication.ReportEngine.ErrorMessage)
endif
endif C#
using SFQWrapper;
using SQProxyWrapper;
using System.IO;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
SQProxy sqProxy = new SQProxy();
sqProxy.LoadProject(@"\MyProjects\Northwind");
// Wait for project to finish loading
while (!sqProxy.ProjectLoaded)
{
}
boolean result = sqProxy.SQApplication.ReportEngine.PreviewReport("Customers");
if not result {
String result = sqProxy.SQApplication.ReportEngine.ErrorMessage;
MessageBox.Show("The report failed because " + reason);
}
}
}
}
VB.NET
Imports SQProxyWrapper
Imports SFQWrapper
Module Module1
Sub Main()
Dim sqProxy As SQProxyWrapper.SQProxy = New SQProxyWrapper.SQProxy
sqProxy.LoadProject("\MyProjects\Northwind")
' Wait for project to finish loading
While Not sqProxy.ProjectLoaded
End While
Dim result As Boolean = _
sqProxy.SQApplication.ReportEngine.PreviewReport("Customers")
if not result then
dim result as String = sqProxy.SQApplication.ReportEngine.ErrorMessage
MessageBox.Show("The report failed because " + reason)
end if
End Sub
End ModuleSee Also
PrintReport | ReportEngine Object | RunReport | RunReportToFile | SQProxy Object
| Last Updated: 06/11/10 |