This seems to be working:
// Prints the expanded Monthly Billing report
Var vPrintTheReport as string
Var vlist as String
Var vNewRetrieveSpec as Int
IF NOT @Mode() = 1
THEN
{
@MSGBOX("Reports can only be run in Update mode",
"Please switch to Search/Update and retrieve the records",
"you wish to run the report on before running the report.")
}
ELSE
{
// vList = @StringArrayAttributes(@StringArrayElementList(), ATTR_ID_TEMPORARY_VALUE)
vList = @StringArrayAttributes("Bill_To_Code", ATTR_ID_TEMPORARY_VALUE)
Writeln(vList)
// IF (vList = "" OR @INSTR(vList, "^") > 0)
IF (vList = "" OR @INSTR(vList, ";") > 0)
THEN
{
@MSGBOX("This report must be run against a single Customer's records.",
"Please return to the retrieve spec and select a specific Code.",
"")
vNewRetrieveSpec = @SelectTreeItem("Search Update Menu!Search (F7)")
}
ELSE
{
vPrintTheReport = @PrintAReport(". Customer History", REPORT_MODE_HTML_PREVIEW, PRINT_ORIENTATION_PORTRAIT, 0, -1, -1, -1, -1, -1, -1)
}
}
Thanks for your help, Ray. Please point out if I've screwed something up or if there's a more delicate way of doing this. If not, I'll roll it into all my "Print Report" buttons tomorrow.