// This example allows the user to schedule a report and have the instance delievered
// in a certain format. This page allows the user to a pick a report and a format. It then
// calls ScheduleWithFormat.csp to schedule the report.
<!-- #include file="RetrieveIStore.csp" -->
<!-- #include file=helper_js.csp -->
// Return a list box populated with all the formats that are supported by
Formats.push("Crystal Report");
Formats.push("Microsoft Excel");
Formats.push("Microsoft Word");
Formats.push("Microsoft RTF");
Formats.push("Paginated Text");
Formats.push("Tab Seperated Text");
Formats.push("Character Seperated Text");
var HTML="<select name=Format>";
for (k=0;k<Formats.length;k++)
HTML = HTML + "<option value='"+k+"'>"+Formats[k]
// This function returns a listbox popuplated with all reports.
// If there are no reports, an empty string is returned.
var Reports = IStore.Query("SELECT SI_ID, SI_NAME FROM CI_INFOOBJECTS WHERE SI_PROGID='CrystalEnterprise.Report' And SI_INSTANCE=0");
var HTML="<select name=ReportID>";
for (k=1;k<=Reports.Count;k++)
HTML = HTML + "<option value='"+Reports.Item(k).ID+"'>"+Reports.Item(k).Title;
// Print a form that allows the user to choose a report and a format.
Response.Redirect ("Start.csp");
Response.Write ("<H2>Schedule a report using a specific file format</H2>");
Response.Write ("<form action='ScheduleWithFormat.csp' method=post name='Schedule'>");
Response.Write ("Report: <BR>");
Response.Write (GetReports(IStore));
Response.Write ("<BR><BR>Format: <BR>");
Response.Write (GetFileFormats());
Response.Write ("<BR><input type=submit name='Next' value='Schedule'>");
Crystal Decisions, Inc. http://www.crystaldecisions.com Support services: http://support.crystaldecisions.com |