How Web Report pages pass Chinese parameters

Source: Internet
Author: User
Tags autoload

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.