We need to automate download of Reports from Oracle CRM OnDemand. The reports in Siebel CRM OnDemand can be downloaded in the form of Excel, CSV, etc. We have a task of downloading several such reports in Excel format everyday. The requirement is to automate the download of Reports by providing the URL of Excel format of report, Username and Password to logon to Oracle OnDemand.
Using CSHttpUnit, we could logon to the OnDemand instance and navigate to the URL that will prompt for a file download (File Download dialog box to save Excel form of the report in the local drive). But I am not able to suppress the File Download dialog box and assign default path for saving the Excel format of the Report being downloaded. I would welcome your valuable advice / suggestions to use any other method / enhance / change the currently used method.
Using CSHttpUnit, we could logon to the OnDemand instance and navigate to the URL that will prompt for a file download (File Download dialog box to save Excel form of the report in the local drive). But I am not able to suppress the File Download dialog box and assign default path for saving the Excel format of the Report being downloaded. I would welcome your valuable advice / suggestions to use any other method / enhance / change the currently used method.
Code:
using System;
using System.Collections.Generic;
using System.Text;
using CSHttpUnit;
namespace AutomateReportDownload
{
class AutomateReport
{
static void Main(string[] args)
{
CSWebConversation CW = new CSWebConversation();
CSWebResponse response = CW.GetResponse("https://mywebCRMwebsite.com/logon.asp");
CSWebForm form = response.GetFormByName("logonForm");
CSWebRequest request = form.GetRequest();
request.SetParameter("j_username", "authorizedusername");
request.SetParameter("j_password", "mypassword");
response = CW.GetResponse(request);
string res = response.GetTitle();
if (res.Equals("Home"))
{
CSWebResponse resp = CW.GetReportResponse("https://mywebCRMwebsite.com/OnDemand/user/analytics/saw.dll?Report&Format=mht&Extension=.xls");
string strTitle = response.GetTitle();
}
}
}
}
Comment