To download the CSP files from this tutorial, click TutorialSamples.zip. For more information, see Code examples.
<META HTTP
<link REL=STYLESHEET TYPE='text/css' HREF='tut.css'>
<!-- #include file=RetrieveIStore.csp -->
<!-- #include file=helper_js.csp -->
function SearchForReport(SearchString ,IStore)
//This function searches for a report that contains the
//sub string, SearchString, and returns an HTML table
//that is populated with the report name,
//report description, and the last time it was modified.
//SearchString - The string that will help identify the report
//IStore - The InfoStore object required to interface with the server.
//Returns an empty string if there are no reports, null if an error occurred, and
//The function returns a string that is an HTML table.
//The query that will select the reports and report instances.
//A string to hold the HTML table.
//Create a query that selects all the reports, and the instances.
Query = "Select SI_NAME, SI_ID, SI_DESCRIPTION, SI_UPDATE_TS, SI_PARENT_FOLDER " +
"From CI_INFOOBJECTS Where SI_PROGID='CrystalEnterprise.Report' And SI_NAME LIKE '%" + StrCSearch + "%'";
HTMLTable="<TABLE Border=0 Width = \"100%\"><TR><TD><B>Name</B></TD>" +
"<TD><B>Description</B></TD>" +
"<TD><B>Last Modified</B></TD></TR>" ;
//Add the report name and details to the table.
"<A HRef='ReportDescription.csp
"&FolderID=" + Result.Item(k).Properties.Item("SI_PARENT_FOLDER") +
"' Target='Main'>" + Result.Item(k).Title + "</A></TD>" +
"<TD>" + Result.Item(k).Description + "</TD>" +
"<TD>" + Result.Item(k).Properties.Item("SI_UPDATE_TS") + "</TD></TR>";
HTMLTable=HTMLTable+"</TABLE>";
function RedirectWithFrames(URL)
Response.Write ("<script language=javascript>open (\""+URL+"\",\"_top\");</script>");
//Retrieve the search string from the search form.
SearchString = Request.Form.Item("SearchString");
//Try to retrieve the InfoStore object.
//If it failed, redirect the user to the logon page.
RedirectWithFrames ("LogonForm.csp");
HTMLTable = SearchForReport(SearchString, IStore,Error);
Response.Write ("<B>Report Listing</B><BR><BR>");
Response.Write ("No reports were found.");
Response.Write ("There was an error trying to retrieve the reports.");
Crystal Decisions, Inc. http://www.crystaldecisions.com Support services: http://support.crystaldecisions.com |