<div class="content" name="CreateReportJob" uuid="c16d5b16-7d93-40a7-b7f3-222fad915695"><p>The CreateReportJob method creates a <a href="0b493832-f781-4c1a-bddd-d39c9df1680f" data-linktype="relative-path">Non-Persisted Report Job
Instance (section 3.2.1.5.1.2)</a> and returns S_OK upon successful
completion.</p><dl>
<dd>
<div><pre> [id(FSRM_DISPID_REPORT_MANAGER | 0x02)] HRESULT CreateReportJob(
   [out, retval] IFsrmReportJob** reportJob
 );
</pre></div>
</dd></dl><p><b>reportJob: </b>Pointer to an <b>IFsrmReportJob</b>
interface pointer (section <a href="1a053a62-6aa7-425f-9160-64c8925d6705" data-linktype="relative-path">3.2.4.2.33</a>)
that upon completion contains a pointer to the newly created <a href="809180e0-571e-40a0-8067-ffe89cbdcc40#gt_15957e50-08ab-48d2-8824-57a71b23f833" data-linktype="relative-path">report job</a>. To have the
report job added to the server&#39;s <b>List of Persisted Report Jobs</b> (section <a href="8443b4d3-17a2-440b-9587-77d4aa0ce732" data-linktype="relative-path">3.2.1.5</a>), the caller MUST
call <a href="2d4215d6-6707-4240-ad79-3d41029d711a" data-linktype="relative-path">Commit (section 3.2.4.2.34.1)</a>.
The caller MUST release the report job when the caller is done with it.</p><p><b>Return Values: </b>The method MUST return zero on
success, or a nonzero error code on failure.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>0x80070057 E_INVALIDARG</td>
  <td>The reportJob parameter is NULL.</td>
 </tr></tbody></table>
</dd></dl><p>Upon receiving this message, the server MUST validate
parameters:</p><ul><li><p><span><span> 
</span></span>Verify that <i>reportJob</i> is not NULL.</p>
</li></ul><p>If any validation fails, the server MUST terminate
processing and return a nonzero error code.</p><p>Upon successful validation of parameters, the server MUST
perform the following actions.</p><ul><li><p><span><span> 
</span></span>Create a new Non-Persisted Report Job Instance.</p>
<ul><li><p><span><span>  </span></span>Set
<b>FSRM Base Object.Id</b> to a <a href="809180e0-571e-40a0-8067-ffe89cbdcc40#gt_f49694cc-c350-462d-ab8e-816f0103c6c1" data-linktype="relative-path">GUID</a>.</p>
</li><li><p><span><span>  </span></span>Set
<b>Report Job.Formats</b> to DHTML and XML.</p>
</li><li><p><span><span>  </span></span>Set
<b>FSRM Base Object.Description</b> to an empty string.</p>
</li><li><p><span><span>  </span></span>Set
<b>Namespace roots</b> to an empty list.</p>
</li><li><p><span><span>  </span></span>Set
<b>Task name</b> to an empty string.</p>
</li><li><p><span><span>  </span></span>Set
<b>Report Job.Mail to</b> to an empty string.</p>
</li><li><p><span><span>  </span></span>Set
<b>Report Job.Reports</b> to an empty list.</p>
</li><li><p><span><span>  </span></span>Set
<b>Running Status</b> to <b>FsrmReportRunningStatus_NotRunning</b>.</p>
</li><li><p><span><span>  </span></span>Set
<b>Last run time</b> to a specific value in the past<a id="Appendix_A_Target_60"></a><a aria-label="Product behavior note 60" href="1cc8408c-3c9b-4510-9585-e4a8d0d40e27#Appendix_A_60" data-linktype="relative-path">&lt;60&gt;</a>. This value MUST be the same
for all new Non-Persisted Report Job Instances. Any value subsequently assigned
to the property that is on or before this specific value MUST be interpreted by
the server as &#34;never&#34;.</p>
</li><li><p><span><span>  </span></span>Set
<b>Last error</b> to an empty string.</p>
</li><li><p><span><span>  </span></span>Set
<b>Last generated in directory</b> to an empty string.</p>
</li></ul></li><li><p><span><span> 
</span></span>Set <i>reportJob</i> to the <b>IFsrmReportJob</b> interface of
the new Non-Persisted Report Job Instance.</p>
</li></ul><p>The new Non-Persisted Report Job Instance MUST NOT be
associated with an existing <a href="8f5aa057-1aeb-4430-b548-e841a6c4ac0a" data-linktype="relative-path">Persisted
Report Job (section 3.2.1.5.1.1)</a>.</p></div>