If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Referencing parameter on Value prompt on report page - emailing, too

Started by ljmcognoise, 25 Jan 2012 12:17:45 PM

Previous topic - Next topic

ljmcognoise

Good afternoon,

I'm rather new to Cognos (3 months) (using 8.4) and I am in a quandry  ::) - I hope someone out there might be able to assist me.

I work at a University and our administrators want to send emails to their students (be it one student, a few students, or their entire student population).

My list report has a query - on it is a field called email. I was able to add an HTML item to the list on the report page for the user to click "Email me", which opens Outlook and puts the *one* selected student's email address in the TO: section.

I added a data item to the query, called AllEmails, which concatenates a semicolon to the end of the email address. On the Report Page, I made a repeater in the header section, which displays *all* student emails for the criteria selected on the Prompt Page, separated with commas. Faculty can copy/paste this email list into Outlook and email their students that way (not the best solution, but it works).

I was just able to create a value prompt on the report page itself. It uses AllEmails as the Use Value and Display Value, which displays all of the students' email addresses (the same list as the repeater). The parameter on this value prompt is P_ljm_all_emails . This is great - it shows all students and I now believe I can do away with the repeater ...

The question: I want the user to select particular student email address(es) from the value prompt, press a button, have Outlook open, and have the selected list of email addresses appear in a new Outlook email message. Faculty can write the Subject and Body sections themselves. 

I tried to create a Hyperlink Button with the code below ... but nothing happens:
'<a href="mailto:me@yahoo.com&bcc=' + ParamDisplayValue('P_ljm_all_emails') + '">Email Us</a>'

On a copied report, I tried adding three HTML items: two surrounding the repeater:
<span id='ljmAllEmails'> and
</span> and the third with JavaScript (which I do not know at all):
<script>
var theSpan=document.getElementById('ljmAllEmails');
<document.write('<a href="mailto:recipient@example.com?subject=Course&bcc= ' + theSpan + '">Email Us</a>')>
</script>

That gives an error
RSV-VAL-0002 Invalid expression <script>
var theSpan=document.getElementById('ljmAllEmails');
<document.write('<a href="mailto:recipient@example.com?subject=Course&bcc= ' + theSpan + '">Email Us</a>')>
</script>
. CRX-YXX-4010 A parsing error was found at or near the position 0 in the expression "<script>
var theSpan=document.getElementById('ljmAllEmails');
<document.write('<a href="mailto:recipient@example.com?subject=Course&bcc= ' + theSpan + '">Email Us</a>')>
</script>
".


I don't know if it matters, but the report itself has a prompt page for any administrator to select courses, faculty, meeting times, etc ... so I cannot add a value prompt on the prompt page for email address - that would give me thousands of records...

Has *anybody* done this successfully? I'd appreciate any assistance - I feel as though I'm so close ...

Thanks!
Laura  ;D