1. Scene description
In a Web report designed with the report development tool Finereport, the initial parameter values are often passed to the report when you set SRC to embed a report to the IFRAME, for example:
<iframe id= "Reportframe" width= "," height= "" src= "/webreport/reportserver?reportlet=/report.cpt& parameter 1 = Parameter value & Parameter 2 = parameter value ... "></iframe>
If the parameter name, parameter value, or even the name of the report contains Chinese or special characters, there may be a series of problems if the encoding is not converted. Like what:
650) this.width=650; "src=" http://img.blog.csdn.net/20150818094036635 "alt=" 20150818094036635 "/>
Today I'll talk about how to pass the Chinese parameters.
2, the use of Cjkencode to the Chinese encoding conversion
Using Cjkencode to encode the path or parameter that invokes the report, the report is automatically decoded when it gets to the parameter, ensuring that there are no garbled cases.
Cjkencode is a good coding method in the FR internal package, the use of Cjkencode in JS in two ways, the section we introduce examples.
2.1 Loading Finereport.js using Cjkencode
cjkencode method has been provided in advance in the JS Library of Finereport, Users can introduce Finereport's JS library into their own web pages, and they can encode CJK characters using Fr.cjkencode, cjkencode the URL of the calling report as follows:
1. Finereport.js uses the jquery framework, if the user also uses jquery, it may cause conflicts, it is recommended not to introduce finereport.js, but to copy the Cjkencode method directly to the page to use, see the following methods.
For a completed example, refer to%fr_home%\webreport|page_demo\parameter_ch.html
2.2 Calling Cjkencode directly
Loading finereport.js again references Cjkencode, on the one hand may cause JS conflict, on the other hand also loaded a lot of unnecessary methods.
If the user only need to use this method, you can copy the code implemented by Cjkencode to the Web page or the user's own JS file, and then reference Cjkencode.
1.
How Web Report pages pass Chinese parameters