Resco CRM Connector: Difference between revisions

Jump to navigation Jump to search
(→‎Methods: GenerateReport)
Line 561: Line 561:


Binary project data.
Binary project data.
=== POST GenerateReport ===
Generate a mobile report.
Sample URL:
<code><nowiki>https://{organization}.rescocrm.com/rest/v1/data/GenerateReport</nowiki></code>
Examples of body requests:
a) Directly define report's data source record as entityid
<syntaxhighlight lang="xml">
<GenerateReportRequest>
  <ReportId>07e91ed7-ab9e-4807-acaa-27b8791451e0</ReportId>
  <EntityId>022e0024-35ca-41ba-a8cc-2f5ff304a919</EntityId>
  <GenerateReportFormat>Pdf</GenerateReportFormat>
  <Variables>
    <Variable name="name1">value1</Variable>
    <Variable name="name2">value2</Variable>
  </Variables>
</GenerateReportRequest>
</syntaxhighlight>
b) Fetch for report's data source records
<syntaxhighlight lang="xml">
<GenerateReportRequest>
    <ReportId>bbaade3e-0c9d-41c8-af0f-cc7b8c2b21bd</ReportId>
    <Fetch>
        <entity name="account">
            <attribute name="id"/>
            <filter>
                <condition attribute="id" operator="in">
                    <value>190C065A-9A2D-454A-A6BA-AAA29718C101</value>
                </condition>
            </filter>
        </entity>
    </Fetch>
    <Variables>
        <Variable name="name1">value2</Variable>
        <Variable name="name2">value1</Variable>
    </Variables>
    <GenerateReportFormat>Pdf</GenerateReportFormat>
</GenerateReportRequest>
</syntaxhighlight>
c) Request with custom report body.
<syntaxhighlight lang="xml">
<GenerateReportRequest>
  <ReportId>07e91ed7-ab9e-4807-acaa-27b8791451e0</ReportId>
  <Data>&lt;Report&gt;&lt;Styles&gt;&lt;Style Name=&quot;H1&quot;&gt;&lt;Background&gt;#0026d658&lt;/Background&gt;&lt;BorderColor&gt;#00000000&lt;/BorderColor&gt;&lt;BorderThickness&gt;0,0,0,0&lt;/BorderThickness&gt;&lt;FontSize&gt;15&lt;/FontSize&gt;&lt;FontWeight&gt;Normal&lt;/FontWeight&gt;&lt;Foreground&gt;#FF22e675&lt;/Foreground&gt;&lt;HorizontalAlignment&gt;Near&lt;/HorizontalAlignment&gt;&lt;Margin&gt;0,0,0,0&lt;/Margin&gt;&lt;Padding&gt;0,0,0,0&lt;/Padding&gt;&lt;VerticalAlignment&gt;Near&lt;/VerticalAlignment&gt;&lt;/Style&gt;&lt;Style Name=&quot;Normal&quot;&gt;&lt;Background&gt;#00000000&lt;/Background&gt;&lt;BorderColor&gt;#00000000&lt;/BorderColor&gt;&lt;BorderThickness&gt;0,0,0,0&lt;/BorderThickness&gt;&lt;FontSize&gt;10&lt;/FontSize&gt;&lt;FontWeight&gt;Normal&lt;/FontWeight&gt;&lt;Foreground&gt;#FF000000&lt;/Foreground&gt;&lt;HorizontalAlignment&gt;Near&lt;/HorizontalAlignment&gt;&lt;Margin&gt;0,0,0,0&lt;/Margin&gt;&lt;Padding&gt;0,0,0,0&lt;/Padding&gt;&lt;VerticalAlignment&gt;Near&lt;/VerticalAlignment&gt;&lt;/Style&gt;&lt;/Styles&gt;&lt;Variables&gt;&lt;Variable Name=&quot;src&quot; Type=&quot;Fetch&quot; Required=&quot;false&quot; Visible=&quot;false&quot; Source=&quot;true&quot; Lazy=&quot;true&quot; Fetch=&quot;&amp;lt;fetch&amp;gt;&amp;lt;entity name=&amp;quot;account&amp;quot;/&amp;gt;&amp;lt;/fetch&amp;gt;&quot;/&gt;&lt;Variable Name=&quot;str&quot; Type=&quot;String&quot; Required=&quot;true&quot; Visible=&quot;true&quot; Source=&quot;false&quot; Lazy=&quot;false&quot;/&gt;&lt;/Variables&gt;&lt;Body Width=&quot;595&quot; Height=&quot;842&quot; Margin=&quot;20&quot;&gt;&lt;Variables/&gt;&lt;Header&gt;&lt;Text Binding=&quot;Constant&quot; Content=&quot;Simple Account report with account records names&quot; Style=&quot;H1&quot; Column=&quot;0&quot; Row=&quot;0&quot; ColSpan=&quot;1&quot; RowSpan=&quot;1&quot;/&gt;&lt;/Header&gt;&lt;Repeater Alias=&quot;account&quot; FetchVariable=&quot;src&quot;&gt;&lt;Variables/&gt;&lt;Header&gt;&lt;Text Binding=&quot;Constant&quot; Content=&quot;Account Name&quot; Style=&quot;Normal&quot; Column=&quot;0&quot; Row=&quot;0&quot; ColSpan=&quot;1&quot; RowSpan=&quot;1&quot;/&gt;&lt;/Header&gt;&lt;Grid&gt;&lt;Text Binding=&quot;Value&quot; Content=&quot;account.name&quot; Style=&quot;Normal&quot; Column=&quot;0&quot; Row=&quot;0&quot; ColSpan=&quot;1&quot; RowSpan=&quot;1&quot;/&gt;&lt;/Grid&gt;&lt;/Repeater&gt;&lt;Footer&gt;&lt;Text Binding=&quot;Constant&quot; Content=&quot;Martin Test&quot; Style=&quot;Normal&quot; Column=&quot;0&quot; Row=&quot;0&quot; ColSpan=&quot;1&quot; RowSpan=&quot;1&quot;/&gt;&lt;/Footer&gt;&lt;/Body&gt;&lt;/Report&gt;</Data>
  <EntityId>022e0024-35ca-41ba-a8cc-2f5ff304a919</EntityId>
  <GenerateReportFormat>Pdf</GenerateReportFormat>
  <Variables>
    <Variable name="name1">value1</Variable>
    <Variable name="name2">value2</Variable>
  </Variables>
</GenerateReportRequest>
</syntaxhighlight>
Format possibilities:
<syntaxhighlight lang="xml">
<GenerateReportFormat>Pdf</GenerateReportFormat>
<GenerateReportFormat>Html</GenerateReportFormat>
<GenerateReportFormat>Word</GenerateReportFormat>
<GenerateReportFormat>Excel</GenerateReportFormat>
</syntaxhighlight>


== Sample C# project ==
== Sample C# project ==

Navigation menu