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

Offline ReportNet Addict

  • Global Moderator
  • Statesman
  • *****
  • Posts: 826
  • Forum Citizenship: +61/-40
  • Creator of the Impact Suite
    • The Impact Suite
[Script] Some javascripts in actions
« on: 05 Oct 2005 04:06:12 pm »
Show your reports!!



I'll start off:

Look in my tutorials section and click on "ReportNet extended"....
http://www.jeroendegraaff.nl/cognoise


Upload your movies/screen dumps etc...

Let me know what you think
« Last Edit: 10 Jan 2007 01:52:04 am by ReportNet Addict »

Offline davidsoc

  • Full Member
  • ***
  • Posts: 40
  • Forum Citizenship: +0/-0
Re: Showcase - Show your scripts working
« Reply #1 on: 06 Oct 2005 04:04:09 pm »
 :o OK... tell me how you did that world map!  :o

It's very impressive! All done with sdk or script?

Offline ReportNet Addict

  • Global Moderator
  • Statesman
  • *****
  • Posts: 826
  • Forum Citizenship: +61/-40
  • Creator of the Impact Suite
    • The Impact Suite
Re: Showcase - Show your scripts working
« Reply #2 on: 06 Oct 2005 04:38:42 pm »
No sdk used at all... only javascript... :D
Took some time... but got it finally working....

Tnx for the compliment...

Offline CoginAustin

  • Community Leader
  • *****
  • Posts: 189
  • Forum Citizenship: +10/-0
Re: Showcase - Show your scripts working
« Reply #3 on: 06 Oct 2005 05:31:44 pm »
I actually did the same thing with google maps. Our outside sales reps can pull their address list, click on one and it open google maps in an iframe to show them where it is located :)

Offline ReportNet Addict

  • Global Moderator
  • Statesman
  • *****
  • Posts: 826
  • Forum Citizenship: +61/-40
  • Creator of the Impact Suite
    • The Impact Suite
Re: Showcase - Show your scripts working
« Reply #4 on: 06 Oct 2005 05:41:49 pm »
Yeah right... ;)
Show it :P

Offline CoginAustin

  • Community Leader
  • *****
  • Posts: 189
  • Forum Citizenship: +10/-0
Re: Showcase - Show your scripts working
« Reply #5 on: 06 Oct 2005 05:54:06 pm »
I dont have the ability to record anything but here is the XML , just to prove it..

Code: [Select]
<report xml:lang="en-us" xmlns="http://developer.cognos.com/schemas/report/1/"><!--RS:1.1-->
<layoutList>
<layout>

<pageSet>

<page name="Page1">
<pageBody><table><tableRow><tableCell><textItem><text>North American Sales Team by City</text><style><stringFormat/><CSS value="font-size:16pt;font-weight:bold;color:navy"/></style></textItem><style><CSS value="padding-bottom:15px"/></style></tableCell><tableCell/></tableRow><tableRow><tableCell>

<selectValue refQuery="Query2" required="false" selectUI="dropdown" parameter="pCity" autoSubmit="true" multiSelect="false"><useItem refItem="City"/><displayItem refItem="City1"/><defaultSelections><defaultSelection>Boston</defaultSelection></defaultSelections></selectValue>
<style><CSS value="text-align:left;vertical-align:top"/></style></tableCell><tableCell/><style><CSS value="text-align:left"/></style></tableRow><tableRow><tableCell>
<style><CSS value="vertical-align:top;text-align:left;padding-bottom:15px"/></style><table><tableRow><tableCell><list refQuery="Query1">
<listColumnTitles><listColumnTitle><textItem><queryItemRef content="label" refItem="Country"/></textItem></listColumnTitle><listColumnTitle><textItem><text>National Flag</text></textItem></listColumnTitle><listColumnTitle><textItem><queryItemRef content="label" refItem="City"/></textItem></listColumnTitle><listColumnTitle><textItem><text>Postal / Zip Code</text></textItem></listColumnTitle></listColumnTitles>
<listColumns><listColumn refLevel="Country"><textItem><queryItemRef refItem="Country"/></textItem></listColumn><listColumn refLevel="Flag image"><image><queryItemRef refItem="Flag image"/><style><CSS value="width:40px;height:20px"/></style></image></listColumn><listColumn refLevel="City"><textItem><queryItemRef refItem="City"/></textItem></listColumn><listColumn refLevel="Postal zone"><textItem><queryItemRef refItem="Postal zone"/></textItem></listColumn></listColumns>
<style>
<CSS value="border-collapse:collapse"/>
</style>
<XMLAttribute name="RS_ListGroupInfo" value="Country|Flag image|City|Postal zone|Address line 1"/></list></tableCell></tableRow><tableRow><tableCell><table><tableRow><tableCell>
<table><tableRow><tableCell><list refQuery="Query1">
<listColumnTitles><listColumnTitle><textItem><text>Office Street Address</text></textItem></listColumnTitle></listColumnTitles>
<listColumns><listColumn refLevel="Address line 1"><textItem><queryItemRef refItem="Address line 1"/></textItem></listColumn></listColumns>
<style>
<CSS value="border-collapse:collapse;margin-top:10px"/>
</style>
<XMLAttribute name="RS_ListGroupInfo" value="Country|Flag image|City|Postal zone|Address line 1"/></list></tableCell><tableCell>
<style><CSS value="vertical-align:top;text-align:left;padding-top:10px"/></style><button>
<textItem>
<text>Office Location</text></textItem>
<expression>[Street Address]</expression></button>
</tableCell></tableRow><style><CSS value="border-collapse:collapse;width:100%"/></style></table></tableCell></tableRow><tableRow><tableCell><list refQuery="Query1">
<listColumnTitles><listColumnTitle><textItem><queryItemRef refItem="City1"/></textItem><textItem><text> Staff Members</text></textItem></listColumnTitle></listColumnTitles>
<listColumns><listColumn><textItem><queryItemRef refItem="Staff name"/></textItem></listColumn></listColumns>
<style>
<CSS value="border-collapse:collapse;vertical-align:text-top;text-align:left;margin-top:10px"/>
</style>
<XMLAttribute name="RS_ListGroupInfo" value="Country|Flag image|City|Postal zone|Address line 1"/></list></tableCell></tableRow><style><CSS value="border-collapse:collapse;width:100%"/></style></table></tableCell></tableRow><style><CSS value="border-collapse:collapse;width:100%"/></style></table></tableCell><tableCell>
<style><CSS value="vertical-align:top;text-align:left"/></style><HTMLItem>
<expression>[Iframe Generator]</expression></HTMLItem>
</tableCell></tableRow><tableRow><tableCell><table><tableRow><tableCell>
<block/>
</tableCell></tableRow><tableRow><tableCell/></tableRow><style><CSS value="border-collapse:collapse;width:100%"/></style></table></tableCell><tableCell/></tableRow><style><CSS value="border-collapse:collapse;width:100%"/></style></table></pageBody>
</page></pageSet></layout>
</layoutList>
<modelConnection name="/content/package[@name='GO Sales and Retailers']/model[@name='model']"/><querySet xml:lang="en-us"><BIQuery name="Query1"><cube><factList><dataItem name="Dynamic URL" aggregate="none"><expression>'http://www.google.com/maps?q='|| Trim([Postal zone])</expression></dataItem><dataItem name="Analyze Hyperlink" aggregate="none"><expression>[Dynamic URL]</expression></dataItem><item refItem="Staff name" aggregate="none"/><dataItem name="Iframe Generator" aggregate="none"><expression>'&lt;iframe src="http://www.google.com/maps?q=' || Replace ([Address line 1], ' ', '+') || '+' || Trim([Postal zone])|| Trim('"')|| ' name="SetIFrame" ' || 'style=" width:610px; height:450px" /&gt;&lt;/iframe&gt;'

</expression></dataItem><item refItem="City1" aggregate="none"/><dataItem name="Street Address" aggregate="none"><expression>'http://www.google.com/maps?q=' || Replace([Address line 1],' ','+') || '+' ||Trim([Postal zone])
</expression></dataItem></factList><dimension name="Country"><level name="Country"><item key="true" refItem="Country" aggregate="none"/></level><level name="Flag image"><item key="true" refItem="Flag image" aggregate="none"/></level><level name="City"><item key="true" refItem="City" aggregate="none"/></level><level name="Postal zone"><item key="true" refItem="Postal zone" aggregate="none"/></level><level name="Address line 1"><item key="true" refItem="Address line 1" aggregate="none"/></level></dimension></cube><tabularModel><dataItem name="Postal zone" aggregate="none"><expression>[gosales_goretailers].[Sales branch address].[Postal zone]</expression></dataItem><dataItem name="Staff name" aggregate="none"><expression>[gosales_goretailers].[Sales reps].[Staff name]</expression></dataItem><dataItem name="Country" aggregate="none"><expression>[gosales_goretailers].[Countries].[Country]</expression></dataItem><dataItem name="Flag image" aggregate="none"><expression>[gosales_goretailers].[Countries].[Flag image]</expression></dataItem><dataItem name="Address line 1" aggregate="none"><expression>[gosales_goretailers].[Sales branch address].[Address line 1]</expression></dataItem><dataItem name="City" aggregate="none"><expression>[gosales_goretailers].[Sales branch address].[City]</expression></dataItem><filter use="optional"><condition>[gosales_goretailers].[Sales branch address].[City] = ?pCity?</condition></filter><filter><condition>[gosales_goretailers].[Sales branch address].[Country] in ('Canada', 'Mexico', 'United States')</condition></filter><dataItem name="City1" aggregate="none"><expression>[gosales_goretailers].[Sales branch address].[City]</expression></dataItem></tabularModel></BIQuery><BIQuery name="Query2"><cube><factList><item refItem="City" aggregate="none" isHeader="true"/><item refItem="City1" aggregate="none" isHeader="true"/></factList></cube><tabularModel><dataItem name="City" aggregate="none"><expression>[gosales_goretailers].[Sales branch address].[City]</expression></dataItem><dataItem name="City1" sort="ascending" aggregate="none"><expression>[gosales_goretailers].[Sales branch address].[City]</expression></dataItem><filter><condition>[gosales_goretailers].[Sales branch address].[Country] in ('Canada', 'Mexico', 'United States')</condition></filter></tabularModel></BIQuery></querySet></report>

Offline CoginAustin

  • Community Leader
  • *****
  • Posts: 189
  • Forum Citizenship: +10/-0
Re: Showcase - Show your scripts working
« Reply #6 on: 06 Oct 2005 06:01:20 pm »
Screenshot attached.. It uses google local because it makes it easier to find things if you can quickly look at whats around it as well :)
This was my inspiration not the final product. You can actually use the above XML and "copy from clipboard" to use it on your Go Sales package. I also must thank Pat Dolinger at Cognos for help with this :)

« Last Edit: 06 Oct 2005 06:08:59 pm by CoginAustin »

Offline ReportNet Addict

  • Global Moderator
  • Statesman
  • *****
  • Posts: 826
  • Forum Citizenship: +61/-40
  • Creator of the Impact Suite
    • The Impact Suite
Re: Showcase - Show your scripts working
« Reply #7 on: 06 Oct 2005 10:00:43 pm »
Looks great!!
But ... you pass the address parameters in the url... am I correct?
In my example I use the Google API in my code (yep... it's googlemaps too :) )
Does your code also work with the API?

Anyway looks great!!

Offline CoginAustin

  • Community Leader
  • *****
  • Posts: 189
  • Forum Citizenship: +10/-0
Re: Showcase - Show your scripts working
« Reply #8 on: 06 Oct 2005 10:13:12 pm »
Yes, it gets passed in the URL. I am not sure the API works with google local? I will have to check it out again..

Offline ReportNet Addict

  • Global Moderator
  • Statesman
  • *****
  • Posts: 826
  • Forum Citizenship: +61/-40
  • Creator of the Impact Suite
    • The Impact Suite
Re: Showcase - Show your scripts working
« Reply #9 on: 06 Oct 2005 11:30:16 pm »
yes it does... that's how it works for me :D

Offline JoeBass

  • Global Moderator
  • Community Leader
  • *****
  • Posts: 143
  • Forum Citizenship: +8/-0
Re: Showcase - Show your scripts working
« Reply #10 on: 07 Oct 2005 07:58:37 pm »
RN A, Your clickable map report looks great.  Can you show the source?  Thanks. 

Offline JoeBass

  • Global Moderator
  • Community Leader
  • *****
  • Posts: 143
  • Forum Citizenship: +8/-0
Re: Showcase - Show your scripts working
« Reply #11 on: 12 Oct 2005 01:41:59 am »
Hi again,  Hope I'm not breaking one of the board rules by bumping this thread. 

I understand that you don't want to share the code behind your clickable map report.  Can you share with me if it is a data-driven map, or are you hard-coding clickable hot spots? 

I work for an expanding company that could benefit from a map like yours - cool idea.

Offline ReportNet Addict

  • Global Moderator
  • Statesman
  • *****
  • Posts: 826
  • Forum Citizenship: +61/-40
  • Creator of the Impact Suite
    • The Impact Suite
Re: Showcase - Show your scripts working
« Reply #12 on: 12 Oct 2005 01:59:20 am »
you can contact me using msn chat... See my profile for details...

Offline ReportNet Addict

  • Global Moderator
  • Statesman
  • *****
  • Posts: 826
  • Forum Citizenship: +61/-40
  • Creator of the Impact Suite
    • The Impact Suite
Re: Showcase - Show your scripts working
« Reply #13 on: 12 Oct 2005 02:50:33 am »
and to make you curious: it's data driven :D

Offline JoeBass

  • Global Moderator
  • Community Leader
  • *****
  • Posts: 143
  • Forum Citizenship: +8/-0
Re: Showcase - Show your scripts working
« Reply #14 on: 12 Oct 2005 02:51:51 am »
My interest is piqued!  I would like to follow up but, I will be away from the PC for some time.  Thank you.