Use of JavaScript jQuery in Cognos

Source: Internet
Author: User
Http://www.kuitao8.com/20140730/2884.shtml
Several jquery problems encountered during the modification of Cognos Business Intelligence & Bigdata played an important role in enterprise decision making as an important engine of business development, All of these information requires a visualizer to be present to the end user, regardless of whether the tool is paid or open source framework. In our project we are using IBM's billing tool Cognos. Cognos provides powerful reporting capabilities as a business intelligence tool, and we use two analysis features 1 in our current projects. Using SQL directly from a database to provide data for a report is simple, but not easy to maintain and use in a large number of ways. In this article, we will focus on the role of jquery-Kai in this use Method 2. The other is to use the framework and Transformer to build package, model cube, MDL files, and finally generate MDC files and Das Hboard and so on, this process is too complex but the rules, not the focus of this article discussion
Next we'll talk about the first scenario: The following figure describes using SQL to provide data directly for a report

One of the things you might encounter in your project is the underlying data that is provided from the database, if there are spaces or some other data that affects the display of the page, we need to fix it in some way, and in this case we still have a number of ways to temporarily call the cleaning data 1. Directly on our diagram of the SQL cleaning put Unwanted data is removed, or the required data is added 2. The original data original display on our page, and so the entire page page after loading, we are in the page through JS repair
In some of our projects we have covered the above mentioned methods. The first method can achieve the desired result only through the knowledge of the SQL, and the second method is not difficult to implement if there is an HTML base, but the cost of not knowing the process is necessary for our students doing bi and large data. This article is a brief description of the problems we have encountered throughout the adjustment process, in order to be able to achieve in the subsequent development of the use of the same error no longer or less.
Cognow as a show tool, the principle is still dependent on HTML, so the use of jQuery in HTML is not a new problem, after all, it has a powerful function. Here is a microcosm of our development in Cognos page first we need to introduce jquery packets in the page, and then use the jquery information of our own defined function functions, and the first error of the fan is that the jquery package must be in our defined function Ago. Ballshit, right.
The second problem is that you have to introduce jquery packets. The third problem is the grammar, now serve a small code:
<script language=javascript type= ' Text/javascript ' > jquery.noconflict ();
JQuery (document). Ready (function () {//jquery (window). Ready (function ().
if (JQuery ("#Gamma-kappa span"). HTML () = = ' Gamma ') {//Gamma-kappa the value of gamma jQuery (' #html tag ') based on the HTML-SPAN tag. HTML (jquery ( ' #html label '). html (). Replace (/&lt;span&gt;/g, ')); Find the HTML page based on the label and issue the Replace command JQuery (' #html tag '). HTML (jquery (' #html tag '). html (). Replace (/&lt;span&gt;/g, ')) ; jquery ("#html label"). each (function () {jquery (this). HTML (jquery (this). html (). Replace (/&lt;span&gt;/g, ' < Span> ')})}
});
</script>
The above is today's simple to share, it is known that jQuery powerful, to be harvested in this field need to be carefully cultivated.
Add: Content excerpt from: http://www.w3school.com.cn/jquery/jquery_noconflict.asp
Jquery.noconflict (); How to use jQuery and other frames on the page. jquery and other JavaScript frameworks as you've learned, jquery uses the $ symbol as a shorthand for jquery. What if the other JavaScript framework uses the $ symbol as a shorthand. Other JavaScript frameworks include: MooTools, Backbone, Sammy, cappuccino, Knockout, JavaScript MVC, Google Web Toolkit, Google Closure, Ember, Batman and Ext JS. Some of these frameworks also use the $ notation as shorthand (like jQuery), which may cause the script to stop running if you are using the same shorthand notation in two different frameworks. The JQuery team considered the problem and implemented the Noconflict () method. The JQuery noconflict () method noconflict the () method to release the control of the $ identifier so that other scripts can use it. Example of course, you can still use jquery: $.noconflict (), jquery (document). Ready (function () {jquery ("button") by using the full name instead of the shorthand. Click ( function () {jquery ("P"). Text ("jquery is still running.") "); });});
instance, you can also create your own shorthand. Noconflict () can return a reference to JQuery, which you can deposit into a variable for later use. Take a look at this example: var JQ = $.noconflict (); JQ (document). Ready (function () {JQ ("button"). Click (function () {JQ ("P"). Text ("JQuery is still running. "); });}); Example if your JQuery code block uses $ shorthand, and you don't want to change the shortcut, you can pass the $ symbol as a variable to the Ready method. This allows you to use the $ symbol within the function-and, beyond the function, you still have to use jquery: $.noconflict (), jquery (document). Ready (function ($) {$ ("button"). Click ( Function () {$ ("P"). Text ("JQuery is still running.") "); });});

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.