Solved

Embedding Javascript in SSRS

Posted on 2013-12-03
6
3,562 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
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…

860 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