SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Development Tools
 Reporting Services Development
 inject Javascript
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

2revup
Posting Yak Master

112 Posts

Posted - 04/03/2013 :  02:09:57  Show Profile  Reply with Quote
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.

Edited by - 2revup on 04/03/2013 02:11:20

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 04/03/2013 :  02:21:49  Show Profile  Reply with Quote
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 - 04/03/2013 :  02:50:14  Show Profile  Reply with Quote
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

India
52317 Posts

Posted - 04/03/2013 :  02:53:56  Show Profile  Reply with Quote
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 - 04/03/2013 :  19:51:08  Show Profile  Reply with Quote
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 - 04/07/2013 :  18:51:52  Show Profile  Reply with Quote
Anyone?
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000