获取reporting services导出pdf的url的方法

public static string genRptUrl(string strRptServer, string strRptPath, string strRptName, ParameterValue[] parameters, string type)
{
string strUrl = "";

strUrl = strRptServer + "?/" + strRptPath + "/" + strRptName;
//for (int i = 0; i < parameters.Length; i++)
//{
// strUrl += "&" + parameters[i].Name + "=" + System.Web.HttpUtility.UrlEncodeUnicode(parameters[i].Value);
//}
strUrl += "&rc:Parameters=False";

if (type == "PDF")
strUrl += "&rs:Format=PDF&rs:Command=Render";
if (type == "EXCEL")
strUrl += "&rs:Format=EXCEL&rs:Command=Render";
return strUrl;
}

string urlpath =genRptUrl(SplendidCRM.Properties.Settings.Default.SplendidCRM_PDTS_ReportService_ReportingService, "HHD", "HHD Satisfaction Survey Template", parameters, "PDF");

posted @ 2015-04-14 09:06  枫轻  阅读(529)  评论(0编辑  收藏  举报