BIEE 中Go Path访问分析报表加过滤器有汉字时需要对汉字进行特殊的编码处理,例:Action=Navigate&P0=1&P1=eq&P2="DIM_NEWSPAPER_SEGMENT_TAB"."STATION_NAME"&P3=1+北京
URL中的P2为:表名.字段名,如果表示层中的表名为中文,应在别名中加入英文名称以方便过滤器使用
前台报表过滤器中也要做相应的设置
P3为要过滤字段的实际值,如果是汉字要进行两次UTF-8编码,然后加入到URL中才能正常过滤,例如“北京”两次转换之后的代码为%25%45%35%25%38%43%25%39%37%25%45%34%25%42%41%25%41%43。
private string getUTF(string utf8)
{
byte[] buffer = Encoding.GetEncoding("utf-8").GetBytes(utf8);
string str = "";
foreach (byte b in buffer) str += string.Format("%{0:X}", b);
return str;
}
private string 转换两次(string 要转换的汉字)
{
string strTemp = getUTF(要转换的汉字); return getUTF(strTemp);
}
完整URL如下
http://localhost:9704/analytics/saw.dll?Go&path=%2Fusers%2Fweblogic%2Fanalytics%2Ffilter&Action=Navigate&P0=1&P1=eq&P2="DIM_NEWSPAPER_SEGMENT_TAB"."STATION_NAME"&P3=1+%25%45%35%25%38%43%25%39%37%25%45%34%25%42%41%25%41%43