Solved

Embedding Javascript in SSRS

Posted on 2013-12-03
6
3,360 Views
Last Modified: 2013-12-04
This may be a real stretch, but I've been asked to look into it...

I've found a website which has some pretty neat visualization tools using javascript. If we take the most basic sample, what I'd like to know is if there's anyway to use this to visualize a dataset within SSRS 2008 R2. It looks if anything like one would:

1. Create a .js file with the init() function as shown in the above link
2. Put this .js file into ...Reporting Services\ReportManager\Pages

Here's where I'm lost...

3. Go into Report -> Report Properties -> Code, and call the function in the .js file, but using what custom code? Do I need to include any references?
4. What object would I drop into the report to render this chart, and where do I set the Code.Init() call?

For now, I'm just trying to reproduce the chart with the static data in the javascript function. Next step would be to bind it to an SSRS dataset, but again how?

Any assistance is appreciated,
Jeff
0
Comment
Question by:jdallen75
  • 2
  • 2
  • 2
6 Comments
 
LVL 22

Expert Comment

by:Nico Bontenbal
ID: 39695101
The only html SSRS supports is markup of text in report fields. But this html is very limited (just bold, italic and a few other things). For sure not JavaScript. You need to use something else to create these reports.
0
 
LVL 44

Accepted Solution

by:
Rainer Jeschor earned 500 total points
ID: 39695109
Hi Jeff,

sorry I have not done this before, but the following link embeds HighCharts.js:
http://thinknook.com/running-highcharts-within-ssrs-or-any-js-graph-library-2013-01-22/

The question is, do you really want the script inside of your report OR do you want a the Javascript just consume the data from a report -> inside the above link the author references another blog entry of him where he shows how to use a "normal" page with Javascript consuming report data as Xml !!!)

HTH
Rainer
0
 
LVL 44

Expert Comment

by:Rainer Jeschor
ID: 39695112
@Nicobo: sorry but in this case you are wrong: you can inject Javascript into SSRS reports

Question is if this makes sense (e.g. exporting the report to PDF???) - but technically it is possible
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 22

Expert Comment

by:Nico Bontenbal
ID: 39695154
Mea maxima culpa.
That is a very clever technique indeed. Thank you very much!
0
 

Author Closing Comment

by:jdallen75
ID: 39696510
Rainer,

Thanks for this valuable link. It's gotten me basically up to an past step "4" in my question. The only thing I can't envision right now is how to - instead of the static dataset that is embedded in the show_chart function - use an SSRS dataset to populate the chart. I've asked the author this question as well through that link.

Thanks,
Jeff
0
 

Author Comment

by:jdallen75
ID: 39696532
Rainer, to answer your other question, the goal here is to stay within the SSRS container - downstream, we already have (I think) a Visual Studio project/webpage 'wrapping' around SSRS.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now