现在的位置: 首页CRM 开发>正文
crms category
Vtiger报表部分—中文显示完美解决方案
发表于437 天前 CRM 开发 暂无评论

1.解决表头在打印预览机打印文档中显示不了中文的方法
找到 modules/Reprots/ReportRun.php  中的
function GenerateReport($outputformat,$filterlist, $directOutput=false)
找到约2410行:
$headerLabel = str_replace($modules," ",$this->getLstringforReportHeaders($fld->name));
在其后面添加一行代码为
$headerLabel = str_replace("_"," ",$this->getLstringforReportHeaders($fld->name));
//添加该行代码,中文就支持了 By SatSun中文就支持了
2.解决列表数据中英文无法转换为中文

翻译的解决方法在方法首行下面添加

$Report2Module=”;//By SatSun 用于列表字段,关联模板的翻译以$outputformat == “HTML” 为例设置其中一个视图 ,显示中文的解决方案

找到 代码:(约在1786行)

i5in_array($mod_name[0],$modules_selected)){ $module = getTranslatedString($mod_name[0],$mod_name[0]);}修改为

i5in_array($mod_name[0],$modules_selected)){

$module = getTranslatedString($mod_name[0],$mod_name[0]);

$Report2Module=$mod_name[0];//By SatSun  用于列表字段,关联模板的翻译}
找到里面的所有

$fieldvalue = getTranslatedString($custom_field_values[$i]);

修改为

$fieldvalue = getTranslatedString($custom_field_values[$i],$Report2Module);
这样就完成了中文显示了。当然 ,别人提到的在include中添加翻译也是可行的。但是那样不是理想的解决方案。

给我留言


/ 快捷键:Ctrl+Enter
不想听你唠叨×