Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 inject Javascript

Author  Topic 

2revup
Posting Yak Master

112 Posts

Posted - 2013-04-03 : 02:09:57
Hi Guys,

I am wondering how you all go about inject JS into a report. I have read http://blogs.infosupport.com/reporting-services-javascript-injection/ and for me its not ideal. I hoped there might be a better way. I am writing the report in VS and have included the JS files in the head and also tried adding them in the <asp:ScriptManager...> tag, like:
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Scripts>
<asp:ScriptReference Path="/scripts/jquery-1.3.2.min.js" />
<asp:ScriptReference Path="/scripts/jquery.tipsy.js" />
<asp:ScriptReference Path="/scripts/tooltip.js" />
</Scripts>
</asp:ScriptManager>

So I can see these being referenced into the source of the HTML but, it would seem nothing within the report is rendered by the javascript, however the controls (Next, back Export etc..) pick this up. What am I missing?

Side note: the reports are RDL's from report builder not RDLC from VS.

P.S. all I am trying to do is change the tool tip to something a little more exciting from a presentation point of view.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-04-03 : 02:21:49
we give javasrcipt code inside the expressions for relevant controls
for example

="javascript: history.go(-1)"

is what you would use for back button




------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

2revup
Posting Yak Master

112 Posts

Posted - 2013-04-03 : 02:50:14
Ok so how might you dump a whole file into this would it be something as simple as
= "javascript:(function($) {
$.fn.tipsy = function(options) {

options = $.extend({}, $.fn.tipsy.defaults, options);

return this.each(function() {

var opts = $.fn.tipsy.elementOptions(this, options);
.......blah blah blah "
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-04-03 : 02:53:56
Whats javascript you're trying to execute here?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

2revup
Posting Yak Master

112 Posts

Posted - 2013-04-03 : 19:51:08
The javascript is based on jQuery so "jquery-1.3.2.min.js" and then 2 others are a tool tip function found here: http://tooltipsy.com/index if you'd like me to attach the scripts I'd be more than happy to.
Go to Top of Page

2revup
Posting Yak Master

112 Posts

Posted - 2013-04-07 : 18:51:52
Anyone?
Go to Top of Page
   

- Advertisement -