Author Topic: [Script] Some javascripts in actions  (Read 34369 times)

Offline sir_jeroen

  • Global Moderator
  • Statesman
  • *****
  • Join Date: Sep 2005
  • Posts: 959
  • Forum Citizenship: +65/-41
  • Creator of the Impact Suite
    • The Impact Suite
Re: Showcase - Show your scripts working
« Reply #30 on: 17 Oct 2005 08:07:10 am »
Tnx...

Offline sir_jeroen

  • Global Moderator
  • Statesman
  • *****
  • Join Date: Sep 2005
  • Posts: 959
  • Forum Citizenship: +65/-41
  • Creator of the Impact Suite
    • The Impact Suite
Re: Competition / Showcase - Show your scripts working
« Reply #31 on: 17 Oct 2005 03:36:12 pm »
Jolly I accepted your challenge and I raise you a:

Listitem with rowhighlighting and dynamic selection

Offline jolly

  • Full Member
  • ***
  • Join Date: Oct 2005
  • Posts: 47
  • Forum Citizenship: +9/-0
Re: Competition / Showcase - Show your scripts working
« Reply #32 on: 18 Oct 2005 12:58:03 am »
Okay, I take a look at the new Tutorial. Thereafter now I am probably again to bild a new Report.  ;D

Offline sir_jeroen

  • Global Moderator
  • Statesman
  • *****
  • Join Date: Sep 2005
  • Posts: 959
  • Forum Citizenship: +65/-41
  • Creator of the Impact Suite
    • The Impact Suite
Re: Competition / Showcase - Show your scripts working
« Reply #33 on: 18 Oct 2005 01:10:00 am »
I always like competition.... :D Hopefully I can beat you..

Offline jolly

  • Full Member
  • ***
  • Join Date: Oct 2005
  • Posts: 47
  • Forum Citizenship: +9/-0
Re: [Script] Some javascripts in actions
« Reply #34 on: 24 Oct 2005 03:27:40 am »
Sorry for the delay to bild a new report. Look at the attached file. On the left side there is a simple List with Javascript inside.  On the right side is an Iframe which contains a Power Play Cube.
« Last Edit: 07 Nov 2005 01:28:22 am by jolly »

Offline sir_jeroen

  • Global Moderator
  • Statesman
  • *****
  • Join Date: Sep 2005
  • Posts: 959
  • Forum Citizenship: +65/-41
  • Creator of the Impact Suite
    • The Impact Suite
Re: [Script] Some javascripts in actions
« Reply #35 on: 24 Oct 2005 03:04:19 pm »
Ok... I take this bet and I raise it this week... I'm still developing :D

Offline jo0001

  • Associate
  • **
  • Join Date: Oct 2005
  • Posts: 3
  • Forum Citizenship: +1/-0
Re: [Script] Some javascripts in actions
« Reply #36 on: 25 Oct 2005 04:40:45 am »
Hi,

I've just come across your site (COGNOiSe). Thanks a lot for all these cool tipps&tricks.

Therefore, I really would like to contribute some of mine.

Here is one of it. I called it TabView. Hope it is of anybody's interest:

Code: [Select]
<report xml:lang="de" xmlns="http://developer.cognos.com/schemas/report/1/"><!--RS:1.1-->
<modelConnection name="/content/package[@name='GO Sales and Retailers']/model[@name='model']"/>
<querySet xml:lang="de">
<BIQuery name="Abfrage1">
<cube><factList><item refItem="Retailer name" aggregate="none"/><item refItem="Order year" aggregate="none"/></factList></cube>
<tabularModel><dataItem name="Retailer name" aggregate="none"><expression>[gosales_goretailers].[Orders].[Retailer name]</expression></dataItem><dataItem name="Order year" aggregate="none"><expression>[gosales_goretailers].[Orders].[Order year]</expression></dataItem></tabularModel></BIQuery>
<BIQuery name="Abfrage2"><cube><factList><item refItem="Order year" aggregate="none"/></factList></cube><tabularModel><dataItem name="Order year" aggregate="none"><expression>[gosales_goretailers].[Orders].[Order year]</expression></dataItem></tabularModel></BIQuery><BIQuery name="Abfrage3"><cube><factList><item refItem="Quantity" aggregate="none"/></factList></cube><tabularModel><dataItem name="Quantity" aggregate="total"><expression>[gosales_goretailers].[Orders].[Quantity]</expression></dataItem></tabularModel></BIQuery></querySet>
<layoutList>
<layout>

<pageSet>

<page name="Seite1">
<pageBody>

<HTMLItem>
<HTML>&lt;table&gt;
     &lt;tr&gt;
          &lt;td class='mytab' onclick="swapTabs( 'tab1')"&gt;Tab 1&lt;/td&gt;
          &lt;td class='mytab' onclick="swapTabs( 'tab2')"&gt;Tab 2&lt;/td&gt;
          &lt;td class='mytab' onclick="swapTabs( 'tab3')"&gt;Tab 3&lt;/td&gt;
     &lt;/tr&gt;
&lt;/table&gt;
&lt;br&gt;
</HTML></HTMLItem>
<HTMLItem>
<HTML>&lt;span id='tab1' CLASS="DIV_DETAILS"&gt;</HTML></HTMLItem><block>
<list maxRows="1000" refQuery="Abfrage1" cellHeightBehavior="stretch">
<listColumnTitles><listColumnTitle><textItem><queryItemRef content="label" refItem="Retailer name"/></textItem></listColumnTitle><listColumnTitle><textItem><queryItemRef content="label" refItem="Order year"/></textItem></listColumnTitle></listColumnTitles>
<listColumns><listColumn><textItem><queryItemRef refItem="Retailer name"/></textItem></listColumn><listColumn><textItem><queryItemRef refItem="Order year"/></textItem></listColumn></listColumns>
<style>
<CSS value="border-collapse:collapse"/>
</style>
<XMLAttribute name="RS_ListGroupInfo" value=""/></list>
</block>
<HTMLItem>
<HTML>&lt;/span&gt;</HTML></HTMLItem><HTMLItem>
<HTML>&lt;span id='tab2'&gt;
</HTML></HTMLItem><block>
<list refQuery="Abfrage2">
<listColumnTitles><listColumnTitle><textItem><queryItemRef content="label" refItem="Order year"/></textItem></listColumnTitle></listColumnTitles>
<listColumns><listColumn><textItem><queryItemRef refItem="Order year"/></textItem></listColumn></listColumns>
<style>
<CSS value="border-collapse:collapse"/>
</style>
<XMLAttribute name="RS_ListGroupInfo" value=""/></list>

</block>
<HTMLItem>
<HTML>&lt;/span&gt;</HTML></HTMLItem><HTMLItem>
<HTML>&lt;span id='tab3'&gt;
</HTML></HTMLItem><block>
<list refQuery="Abfrage3">
<listColumnTitles><listColumnTitle><textItem><queryItemRef content="label" refItem="Quantity"/></textItem></listColumnTitle></listColumnTitles>
<listColumns><listColumn><textItem><queryItemRef refItem="Quantity"/></textItem><style><CSS value="text-align:right"/></style></listColumn></listColumns>
<style>
<CSS value="border-collapse:collapse"/>
</style>
<XMLAttribute name="RS_ListGroupInfo" value=""/></list>

</block>
<HTMLItem>
<HTML>&lt;/span&gt;
&lt;img src="../pat/images/blank.gif" onload="swapTabs( 'tab1')"/&gt;</HTML></HTMLItem></pageBody>
<pageHeader>

<HTMLItem>
<HTML>&lt;style&gt;
.mytab{
     font-size:12px;
     font-weight:bold;
     color:black;
     border:1px solid black;
     cursor: hand;
}

&lt;/style&gt;

&lt;script&gt;

function swapTabs( tabId){

//alert(tabId);

var tab1 = document.getElementById("tab1");
var tab2 = document.getElementById("tab2");
var tab3 = document.getElementById("tab3");

      if (tabId=="tab1"){
     
tab1.style.display = "block";
tab2.style.display = "none";
tab3.style.display = "none";
}
else if(tabId=="tab2"){
     
      tab1.style.display = "none";
tab2.style.display = "block";
tab3.style.display = "none";
}
else if(tabId=="tab3"){

tab1.style.display = "none";
tab2.style.display = "none";
tab3.style.display = "block";
}
   
}

&lt;/script&gt;
</HTML></HTMLItem><block class="reportTitle">
<textItem class="reportTitleText">
<text/>
</textItem>
</block>
<style>
<CSS value="padding-bottom:10px"/>
</style>
</pageHeader>
<pageFooter>
<table>
<tableRow>
<tableCell>
<textItem>
<expression>AsOfDate()</expression>
</textItem>
<style>
<CSS value="vertical-align:top;text-align:left;width:25%"/>
</style>
</tableCell>
<tableCell>
<textItem>
<text>- </text>
</textItem>
<textItem>
<expression>PageNumber()</expression>
</textItem>
<textItem>
<text> -</text>
</textItem>
<style>
<CSS value="vertical-align:top;text-align:center;width:50%"/>
</style>
</tableCell>
<tableCell>
<textItem>
<expression>AsOfTime()</expression>
</textItem>
<style>
<CSS value="vertical-align:top;text-align:right;width:25%"/>
</style>
</tableCell>
</tableRow>
<style>
<CSS value="border-collapse:collapse;width:100%"/>
</style>
</table>
<style>
<CSS value="padding-top:10px"/>
</style>
</pageFooter>
</page></pageSet></layout>
</layoutList>
</report>
Cheers, Jochen
« Last Edit: 25 Oct 2005 04:13:35 pm by ReportNet Addict »

Offline sir_jeroen

  • Global Moderator
  • Statesman
  • *****
  • Join Date: Sep 2005
  • Posts: 959
  • Forum Citizenship: +65/-41
  • Creator of the Impact Suite
    • The Impact Suite
Re: [Script] Some javascripts in actions
« Reply #37 on: 25 Oct 2005 04:11:18 pm »
Looks great... Are you in for some competition ? :D


2 little remarks:
Next time if possible add a screen dump and could you use the code-tag this because in some cases your code could get unescaped...(e.g. > becomes &gt; )


But still.. looks great!!
« Last Edit: 25 Oct 2005 04:13:03 pm by ReportNet Addict »

Offline jolly

  • Full Member
  • ***
  • Join Date: Oct 2005
  • Posts: 47
  • Forum Citizenship: +9/-0
Re: [Script] Some javascripts in actions
« Reply #38 on: 26 Oct 2005 02:20:54 am »
Hi jo0001,  8) 8)

Offline jolly

  • Full Member
  • ***
  • Join Date: Oct 2005
  • Posts: 47
  • Forum Citizenship: +9/-0
Re: [Script] Some javascripts in actions
« Reply #39 on: 26 Oct 2005 06:01:11 am »
Here is a small Video about another possibility to sort Columns with Javascript.
« Last Edit: 07 Nov 2005 01:29:10 am by jolly »

Offline CoginAustin

  • Community Leader
  • *****
  • Join Date: Jul 2005
  • Posts: 189
  • Forum Citizenship: +10/-0
Re: [Script] Some javascripts in actions
« Reply #40 on: 26 Oct 2005 06:50:54 am »
I cant play the file because of a "Unknown Codec" :(

Offline sir_jeroen

  • Global Moderator
  • Statesman
  • *****
  • Join Date: Sep 2005
  • Posts: 959
  • Forum Citizenship: +65/-41
  • Creator of the Impact Suite
    • The Impact Suite
Re: [Script] Some javascripts in actions
« Reply #41 on: 26 Oct 2005 07:20:25 am »
Jolly.... 1 word: AWSOME!!!

Offline jolly

  • Full Member
  • ***
  • Join Date: Oct 2005
  • Posts: 47
  • Forum Citizenship: +9/-0
Re: [Script] Some javascripts in actions
« Reply #42 on: 26 Oct 2005 07:48:22 am »
Okay, CoginAustin try this one. Sorry for the poor Quality.
« Last Edit: 07 Nov 2005 01:29:49 am by jolly »

Offline CoginAustin

  • Community Leader
  • *****
  • Join Date: Jul 2005
  • Posts: 189
  • Forum Citizenship: +10/-0
Re: [Script] Some javascripts in actions
« Reply #43 on: 26 Oct 2005 07:55:06 am »
Thanks! That is very cool

Offline COGNOiSe administrator

  • Administrator
  • Statesman
  • ******
  • Posts: 675
  • Forum Citizenship: +32/-8
    • BrightStar Partners, Inc
Re: [Script] Some javascripts in actions
« Reply #44 on: 02 Nov 2005 08:21:57 am »
I had to restore the forum from backups earlier this week following the corruption of some forum software files and as such as attachments after 21st September will need to be uploaded again.

Apologies! I will try to do these backups more frequently (or if anyone knows how to run a CRON job to backup and save the database please drop me a line).

Cheers