Solved

Embedding Javascript in SSRS

Posted on 2013-12-03
6
3,438 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
In this article I will describe the Detach & Attach 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.
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…

863 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

17 Experts available now in Live!

Get 1:1 Help Now