RunAnalyticsReport operation provides the ability to execute an Analytics report in Oracle Service Cloud.

Signature for this function is shown below:

 CSVTableSet results = RunAnalyticsReport(AnalyticsReport reportObject, int limit, int start, string delimiter, bool returnRawResult, bool disableMTOM, out byte[] fileData)

In the RunAnalyticsReport there is an argument called start which specifies the starting record no. while fetching the data. If you pass Start as 0 and limit as 10,000 then get operation will return first 10,000 rows (0-9,999), if you pass start as 10,000 and limit as 10,000 then get operation will fetch next 10,000 rows (10,000-19,999).So to fetch records more than 10,000, you have to form a loop to call RunAnalyticsReport again and again by passing different start value till it return no more rows.





An object of type AnalyticsReport that identifies a unique report.


Maximum number of rows to return (10,000 is the overall maximum).


Specifies the starting row.


Specifies the character(s) to delimit the column fields by (where comma is the default delimiter).


Specifies whether to return the results as base 64 encoded data (inside FileData tags), or as row data inside a CVSTableSet. The default is false.


Specifies whether or not to use MTOM for the response. The default is true (MTOM is disabled).


Refers to the field that holds the base64 encoded data.

Below is the sample code in .Net to get any number of rows from Analytics report.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CreateSamples.RightNowService;
using System.ServiceModel;
using System.ServiceModel.Channels;

namespace CreateSamples
    class BasicRunReport

        private RightNowSyncPortClient _service;
        BasicHttpBinding binding;
        public BasicRunReport()
            setBinding(ref binding);
            //Set your Service end point here
            EndpointAddress endPointAddr = new EndpointAddress("https://<your_site><your_interface>.cfg/services/soap");
            _service = new RightNowSyncPortClient(binding, endPointAddr);
            _service.ClientCredentials.UserName.UserName = "username";
            _service.ClientCredentials.UserName.Password = "password";
            BindingElementCollection elements = _service.Endpoint.Binding.CreateBindingElements();
            elements.Find<SecurityBindingElement>().IncludeTimestamp = false;
            _service.Endpoint.Binding = new CustomBinding(elements);


        public void RunReport()
            //Create new AnalyticsReport Object
            AnalyticsReport analyticsReport = new AnalyticsReport();
            //Specify a report ID of Public Reports
            ID reportID = new ID();
   = 110324;//Change it with your report id
            reportID.idSpecified = true;
            analyticsReport.ID = reportID;
            ClientInfoHeader clientInfoHeader = new ClientInfoHeader();
            clientInfoHeader.AppID = "Run Analytics Report";
            //Below loop run continuously till more rows are available in the reports
            //start and limit variables are initialized and in every loop we just increment the start variable
            for (int start=0,limit=10000; ; start=start+limit)
                CSVTableSet thisset = new CSVTableSet();
                byte[] rawResult = null;
                thisset = _service.RunAnalyticsReport(clientInfoHeader, analyticsReport, limit, start, ",", false, true, out rawResult);

                CSVTable[] tableResults = thisset.CSVTables;
                CSVTable csvTable = tableResults[0];
               if (csvTable.Rows.Count()<=0)
                   //Exit from the loop if there are no more rows available
                //To Do with the rows
                String[] data = tableResults[0].Rows;
                foreach (String row in data)
                    Console.WriteLine("Row Data: " + row);

        private void setBinding(ref BasicHttpBinding binding)
            binding = new BasicHttpBinding(BasicHttpSecurityMode.TransportWithMessageCredential);
            binding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName;
            binding.MaxReceivedMessageSize = 2147483647;
            binding.MaxBufferSize = 2147483647;
            binding.MaxBufferPoolSize = 2147483647;