Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sockets/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Crystal reports 水晶报表字段中的掩码_Crystal Reports - Fatal编程技术网

Crystal reports 水晶报表字段中的掩码

Crystal reports 水晶报表字段中的掩码,crystal-reports,Crystal Reports,在巴西,我们有一个名为CNPJ的数字,这个掩码为00.000.000/0000-00,我将这个数字保存在SQL中,就像一个int列一样,当我使我的报告正常工作时,fiels就会出现 00000000000000 我是如何在报告中的字段上放置一个面具来显示的 00.000.000/0000-00 感谢任何方向如果您不需要前导零,那么: local stringvar sample := totext({table.number},0,''); if length(sample)<>14

在巴西,我们有一个名为CNPJ的数字,这个掩码为00.000.000/0000-00,我将这个数字保存在SQL中,就像一个int列一样,当我使我的报告正常工作时,fiels就会出现 00000000000000 我是如何在报告中的字段上放置一个面具来显示的 00.000.000/0000-00


感谢任何方向

如果您不需要前导零,那么:

local stringvar sample := totext({table.number},0,'');
if length(sample)<>14 then "Handle the error case" else
  picture(sample,"xx.xxx.xxx/xxxx-xx")

必须使用此公式添加公式字段 mid({impimepj;1.doc_cnpj},1,2)+“+mid({impimepj;1.doc_cnpj},3,3)+”+mid({impimepj;1.doc_cnpj},6,3)+”+ mid({impimepj;1.doc_cnpj},9,4)+“-”+mid({impimepj;1.doc_cnpj},13,2)

local stringvar sample := totext({table.number},"00000000000000");
picture(sample,"xx.xxx.xxx/xxxx-xx")