Solved

Embedding Javascript in SSRS

Posted on 2013-12-03
6
3,693 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

 
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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

752 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