<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="../notes.xsl"?>
<Documentation>
	<Title code="0360">ReportSavedReports</Title>
	<Overview>
		<p>Schema to enable the user to deal with 'saved' reports which are created using methods
			<a href="./0310_documentation.xml">0310</a>,
			<a href="./0320_documentation.xml">0320</a> and
			<a href="./0340_documentation.xml">0340</a> with an active 'SavedReport' element.
			Only relative date-ranges are permitted: e.g. Today; Last Month or Recent 5 days.
			Methods exist both to retrieve information on the type of report required and to delete a user's saved reports.
			Retrieved information may be used by a client application to construct a further XML request to obtain the actual report results.
			Note that at present it is not possible to simply re-run a report using the 'SavedReportID' value.</p>
	</Overview>
	<Request schema="0360_RequestReportSavedReports.xsd">
		<p>The 'UserID' and 'Password' elements identify the account.
			The 'ServiceName' element must be set to 'ReportSavedReports'.
			The 'SoftwareVersion' element is for internal 2SMS use only and should not be set.</p>
		<p>The 'ServiceDetail' element should contain one of the following:</p>
		<ul>
			<li>An empty 'RetrieveSavedReports' child to obtain information on all of a user's saved reports.</li>
			<li>A 'DeleteSavedReports' child element with a set of 'SavedReportID' child elements containing the IDs of the reports to be removed.
				These will have been obtained with a previous 'RetrieveSavedReports' call using this schema.</li>
		</ul>
	</Request>
	<Response schema="0360_ResponseReportSavedReports.xsd">
		<p>This method returns a successful "00/OK" response if the request was successfully completed.
			The 'Result' element contains the number of 'Record' elements.</p>


		<p>The information in the 'Detail' element depends on the 'ServiceDetail' child of the initial request:</p>
		<ul>
			<li>A 'RetrieveSavedReports' request returns a <b><i>set</i></b> of 'Record' elements
				each of which present information about a saved report in the following child elements:
				<ul>
					<li>A 'SavedReportID' element whose value uniquely identifies the report to 2SMS.</li>
					<li>A 'Name' element containing the name chosen by the user to identify the report.</li>
					<li>A 'Detail' element containing the type of report (i.e. ReportStandard, Report2way or ReportOverview).</li>
					<li>A 'DateRange' element containing a date range: relative time period or recent number of days.</li>
					<li>A 'Status' element containing the status filter or 'All' to apply no filter.</li>
					<li>A 'Destination' element containing the destination filter or 'All' to apply no filter.</li>
					<li>A 'GUID' element containing the GUID reference filter or 'All' to apply no filter.</li>
					<li>A 'GroupBy' element containing grouping information for ReportOverview reports
						(code <a href="./0340_documentation.xml">0340</a>).</li>
					<li>A 'ReportFormat' element containing any additional information for the client application (e.g. format for results).</li>
				</ul></li>
			<li>A 'DeleteSavedReports' request returns a <b><i>single</i></b> 'Record' element which contains:
				<ul>
					<li>An 'ItemsDeleted' child element whose 'Count' attribute contains the number of reports successfully deleted.</li>
				</ul></li>
		</ul>
	</Response>
</Documentation>