I Have a PerformancePoint Server 2007 Dashboard in a Sharepoint 2007 page.
In my Sharepoint page, there's 2 Filters who get passed to the Report, and I need to print this report in the page (in another button, not the SSRS one).
So what I need is a javascript method that calls the SSRS print button, which is on a named DIV, inside a WebPartZone that only have one WebPart, a PerformancePoint Dashboard Item (don't know the exact name of the webpart).
Edit:
I've noticed that the Report, that is shown by an PerformancePoint Server webpart, is being shown by an IFrame in my Sharepoint Page.
Edit2:
Due to my architecture the reporting services Iframe is on another server, causing Access Denied when accessing through javascript.
So the question in the way I wanted is not answerable anymore, however I'll try to answer the question directly inside the reporting services, just to keep the question answer accurate.
The onclick event for the print button is document.getElementById('ReportViewerControl').ClientController.LoadPrintControl();return false;, however I was unsuccessful in just adding that to another link outside of the report viewer. That makes sense, since you can have multiple reports on a page and there's one print button for each.
Maybe you can try forcing a click of the print button?
document.getElementById('ReportViewerControl_ctl01_ctl07_ctl00_ctl00').onclick();
in my document, anyway.
Solved it:
Since the SSRS was inside an Iframe of my Sharepoint i had to look inside the Iframe
(this only works when the Iframe access the same server of the webpage currently accessed or else we will get a access denied in javascript and fail silently)
I used JQuery to make things simpler and used IE 8 to lookup the nodes (since PerformancePoint Server 2007 doesn't appear in Firefox)
Nathan's javascript helped me alot, I've checked the button html structure and find that it's a table that handle's the click and the table has a attribute called title with a value called Print (note the uppercase on the firt letter), so I written this little JQuery Javascript to solve this.
$('iframe').contents().find('table[title="Print"]').click();
remembering that this won't help me, because in my case the SSRS is hosted on another server, and therefore it's not accessible throught javascript, I've just completed the answer to help other people in this situation.
Related
I'm scratching my head from yesterday trying to find about this.
When I navigate to account settings page and view source code, there's literally no user specific data like name, email, gender etc, but when I check via inspect element its there. Same happens with other web pages like order history etc.
I'm assuming the data is being generated dynamically (Am I right?)
I have two questions about this.
How do developers do this?
What's the purpose of doing this? Since developers take the extra pain of generating data dynamically this must be solving an issue otherwise why would they do this?
By generating the new page dynamically, developers can improve the user experience. For example, if you had a separate html file for your settings page, the user would have to make a call to your server to receive that file and see the page (maybe 1/3 of a second). However, if the developer dynamically generates new pages using javascript or some framework, everything is stored locally on the user's machine meaning that the page loads significantly quicker (~1/500 of a second).
Hope this helps.
I'd like to be able to manually select text from cross-domain iframe with javascript on the frontend.
I know it's pretty difficult to achieve such result as the use of postMessage is required if I decided to use a 100% javascript solution. I'm opened to backend solutions (either php or nodejs)
Optimizely can access any dom element from the page, I'd like to understand how they are doing it. Is it because the user needs to install a widget on his website first? If yes, how does it works exactly?
Here's an example:
Reproduced from #2 of this answer:
Let's say you want to create an experiment on http://www.mypage.com ... The Optimizely Editor loads http://www.mypage.com inside an iframe and uses window.postMessage to communicate with the page. This only works if that page already has a snippet like [<script src="//cdn.optimizely.com/js/XXXXXX.js"></script>] on it. If that's not the case, the editor will timeout while waiting for a message from the iframe'd page, and will load it again via a proxy that actually inserts the snippet onto the page. This loading process allows the editor to work with pages that a. contain an account snippet b. do not contain an account snippet, or c. sit behind a firewall (c. requires the snippet.)
The product I work on offers SSO into Office365, through both the web and native, "thick" clients aka rich clients. Part of SSO-ing into an Office365 app, such as Excel for example, involves displaying my product's login page inside of the login popup window inside the thick client. The problem is, only on Windows, I get many JavaScript errors when trying to execute the JavaScript included in our login page (it happens to be using AngularJS, but I suspect many frameworks/libraries would be incompatible). It appears that console is not supported, along with document.body, and many other "essentials".
Does anyone have any knowledge of the DOM and script engines that are used here? The first page shown in the SSO flow is Microsoft's login page where you enter your email address, which then redirects to my product's login page (mapped by domain on the email address), and their page seems to render fine, so clearly it's possible to get HTML and JS to work nice (enough). I'd also take a recommendation on any kind of shim/polyfill that would help me get moving, as well.
After doing some more digging, it looks like I was able to solve my problem by specifying an HTTP Response header of name X-UA-Compatible with value IE=edge, which tells IE to render using the latest document standards. It looked like the web view was originally trying to render using IE7 compatibility mode, which explains why none of my JS was working as intended.
See https://stackoverflow.com/a/6771584/3822733 for more information on X-UA-Compatible, this is the question/answer that helped me solve this problem.
First of all hello everybody,
I'm new to this site but I still searched for 10 minutes and couldn't find an answer to my question so I'll ask it now.
I'm trying to create a sidebar gadget for windows vista/7.
In that gadget I need to get some text from another page in the web (not in my domain).
I know I can't really do it but I've found a work around with an Iframe.
Right now the page I want is loading through the Iframe and I can see that.
The question is how do I get the entire text of that page in the Iframe into a label or text area or whatever...
Since the windows sidebar gadgets doesn't work with ASP I need this done with pure HTML and javascript.
Anyone that can help me please do,
Thanks,
Sagi.
The sidebar may not allow ASP, but it will certainly allow ajax calls, your asp page will reside on the server and do all this hard work, and your gadget will just call your asp page?
You'll probably want to do an ajax call to the server where the other webpage is hosted.
jQuery might help with this (using .ajax()), otherwise, just google how to do this normally in js.
[EDIT]
An intermediate server/proxy where you do the ajax calls might help, you can use access control headers to allox cross-site-scripting. See my here for more info :)
If the fact that the page escapes your Iframe is the issue you can set up an intermediate server, that gets the text from the server you want (as you mentioned; www.bbc.com), and serves it as clean text. Have your widget then include an ifram from the text from you intermediate server. This would be the cleanest approach really.
I'm sorry if this is a newbie question but I don't really know what to search for either. How do you keep content from a previous page when navigating through a web site? For example, the right side Activity/Chat bar on facebook. It doesn't appear to refresh when going to different profiles; it's not an iframe and doesn't appear to be ajax (I could be wrong).
Thanks,
I believe what you're seeing in Facebook is not actual "page loads", but clever use of AJAX or AHAH.
So ... imagine you've got a web page. It contains links. Each of those links has a "hook" -- a chunk of JavaScript that gets executed when the link gets clicked.
If your browser doesn't support JavaScript, the link works as it normally would on an old-fashioned page, and loads another page.
But if JavaScript is turned on, then instead of navigating to an HREF, the code run by the hook causes a request to be placed to a different URL that spits out just the HTML that should be used to replace a DIV that's already showing somewhere on the page.
There's still a real link in the HTML just in case JS doesn't work, so the HTML you're seeing looks as it should. Try disabling JavaScript in your browser and see how Facebook works.
Live updates like this are all over the place in Web 2.0 applications, from Facebook to Google Docs to Workflowy to Basecamp, etc. The "better" tools provide the underlying HTML links where possible so that users without JavaScript can still get full use of the applications. (This is called Progressive Enhancement or Graceful degradation, depending on your perspective.) Of course, nobody would expect Google Docs to work without JavaScript.
In the case of a chat like Facebook, you must save the entire conversation on the server side (for example in a database). Then, when the user changes the page, you can restore the state of the conversation on the server side (with PHP) or by querying your server like you do for the chat (Javascript + AJAX).
This isn't done in Javascript. It needs to be done using your back-end scripting language.
In PHP, for example, you use Sessions. The variables set by server-side scripts can be maintained on the server and tied together (between multiple requests/hits) using a cookie.
One really helpful trick is to run HTTPFox in Firefox so you can actually monitor what's happening as you browse from one page to the next. You can check out the POST/Cookies/Response tabs and watch for which web methods are being called by the AJAX-like behaviors on the page. In doing this you can generally deduce how data is flowing to and from the pages, even though you don't have access to the server side code per se.
As for the answer to your specific question, there are too many approaches to list (cookies, server side persistence such as session or database writes, a simple form POST, VIEWSTATE in .net, etc..)
You can open your last closed web-page by pressing ctrl+shift+T . Now you can save content as you like. Example: if i closed a web-page related by document sharing and now i am on travel web page. Then i press ctrl+shift+T. Now automatic my last web-page will open. This function works on Mozilla, e explorer, opera and more. Hope this answer is helpful to you.