Main Dataset Query in SSRS for D365

 Main Dataset Query in SSRS for D365

In SSRS report, we need to retrieve the current record's details to populate the report fields.

For example, for the current opened CrimeReport record, I need to create a report for it.

In the dataset for this CrimeReport record, we can follow below query.

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true" >
  <entity name="dxc_crimereport" enableprefiltering="true" prefilterparametername="CrimeReportId">
    <attribute name="dxc_arrestdatetime" />
    <attribute name="dxc_arrestingagency" />
    <attribute name="dxc_arrestingofficerbadge" />
    <attribute name="dxc_arrestingofficerlookup" />
    <attribute name="dxc_crimereportnbr" />
    <attribute name="dxc_offensecity" />
    <attribute name="dxc_offensedatetime" />
    <attribute name="dxc_offensestate" />
    <attribute name="dxc_offensestreet1" />
    <attribute name="dxc_offensestreet2" />
    <attribute name="dxc_offensezipcode" />
    <attribute name="dxc_youthid" />
    <attribute name="dxc_arrestingagency" />
    <attribute name="dxc_elementsofoffense" />
  </entity>
</fetch>

Pls note, since this report is just targeting a specified CrimeReport (the current opening one),  we have to enable prefilter, and set prefilter parameter name.  

Then, SSRS will automatically create a parameter for it.





No comments:

Post a Comment