function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
bssantoshbssantosh 

Loading Report List

Hi,
 
I need to load the ReportList present at
 
In C#, I have logged in and submitted the Url and SessionId to the API.
Can someone provide a code sample to set the cookie "sid" and create a httprequest to
load the xmldoc.
 
Thanks.
Gareth DaviesGareth Davies

Code:

        Cookie _SessionCookie = new Cookie();
        HttpWebRequest _WebRequest;

        string _SessionID;
        string _Url;
  
        /// <summary>
        /// Creates an instance and populates its details using the SessionID and URL. 
        /// </summary>
        /// <param name="pSession">A valid Salesforce.com SessionID</param>
        /// <param name="pUrl">The base URL for the connection (i.e. https://na1.salesforce.com )</param>
        public SFReportList(string pSession, string pUrl)
        {
            _SessionID = pSession;
            _Url = pUrl;
            _SessionCookie.Name = "sid";
            _SessionCookie.Value = _SessionID;
            _SessionCookie.Domain = _CookieDomain;
            _SessionCookie.Path = "/";
            string QueryURL = _Url + _ReportURL;
            _WebRequest = (HttpWebRequest)WebRequest.Create(QueryURL);
            _WebRequest.CookieContainer = new CookieContainer();
            _WebRequest.CookieContainer.Add(_SessionCookie);
            Process();
        }


 
Drop me an email and I'll send you all the code for handling reports.

Gareth.

Message Edited by Gareth Davies on 07-20-2006 01:11 AM