Using a Paremeter when opening a link in SSRS - reporting-services

I'm struggling a bit here so hopefully someone will be able to help me out.
We're trying to open up a file which is on our servers, by clicking on a link in an SSRS report (using the Go To URL part).
The link works fine when we put it in a web browser, so I know the problem isn't a security issue.
Basically it looks like this...
="\\servername\foldername\"+Parameters!ParameterName.Value+".pdf"
This only opens in the same window in a web browser - how do I get this to open in a new tab?
Thanks!

You can set that URL to be anything you want, including javascript. This allows you to control how the link behaves, for example specifying the target for the link to open in:
="javascript:void(window.open('\\servername\foldername\"+Parameters!ParameterName.Value+".pdf','_blank'))"
In this case it is the '_blank' part of the javascript window.open function that targets either a new tab or a new window depending on your browser settings.

What was needed to be done in this case to solve this, was it needed to be set out as follows:
="Javascript:void(window.open('file://[servername]/[foldername]/" + Parameters![ParameterName].Value + ".pdf','_blank'))"

Related

How to show File Saveas Dialog in Blazor Server App

I am new to Blazor and trying to show File Saveas Dialog as shown in following link on a button click.
Save as Image
The requirement is - upon clicking the Saveas button above Saveas dialog should be popped up where user can choose the destination of file and file name.
I have tried "enabling the setting to check the save location in the download settings of the browser" and it works. But we do not want to depend on the Browser settings.
Please add your thoughts on below..
Instead of depending on the browser settings is there any other way to show Saveas dialog?
Are there any open source Nuget packages available to help on this?
NOTE: I am using .NET 6.0 for building my application
Thanks in advance,
Bhargavi Gowri.
I also wanted to bring up a window to save a file in which the user could select a folder. Before that, the system automatically saved to the Downloads folder.
As I understood, there was no such possibility before, but now it is possible thanks to this api: https://caniuse.com/native-filesystem-api.
I found this solution in the answer to this question: https://stackoverflow.com/a/70001920/16740180.
It's worth noting that I use Blazor WebAssembly and not a Blazor Server. And I do not know if it will work for you.
Unfortunately, this doesn't work for mobile devices right now, but it works fine for windows. I hope this helps someone.
This isn't a Blazor thing. In web browsers, files are downloaded from links using <a> tag in HTML using the download attribute. Just create a link to your file:
<a href="path_to_file" download>Save</a>
Save
The path must be on the same server, but blob and data links will work as well.
If you do not suggest a name, the browser will use the original filename (possibly changed to remove symbols the OS doesn't allow in file paths).
https://caniuse.com/download
If you want your link to look like a button, then that's a different issue, and you can google or ask that.

Get generated source of an HTML page programmatically

What is the easiest way to get the generated web page of a website programatically in any programming language?
The generated web page that is required is the one you get if you go to a web page in firefox and press Ctrl-a and then right click and press "View Selection Source".
The one way that comes to mind is to understand the chromium open source web browser code and get the rendered page and use it in our service.
But I believe that there may be another solution out there that I am not aware of.
In javascript, you can get the full document content with
var html = document.documentElement.innerHTML;
If you want to do this server side you can use file_get_contents()
Ex:
file_get_contents(path_to_webpage);
For reference:
http://php.net/manual/en/function.file-get-contents.php
https://www.w3schools.com/php/func_filesystem_file_get_contents.asp

Mediawiki open external links in a new window

I want to enable opening external links in a new window function in Mediawiki. I tried to modify the "LocalSettings.php" file according to the below instructions:
http://www.mediawiki.org/wiki/Manual:Opening_external_links_in_a_new_window
But I still couldn't get it working. When I looked up in the above link "Discussion" wiki page I found more informations which confused me. Any idea how to set this work in a simple and straightforward way?
If you want a few specific links to open in a new window:
You can use the LinkTarget extension. You can then surround the appropriate links with an HTML element with a class of your choosing and get the extension to handle them.
(tor's answer also had a relevant extension linked, but Wikia removed that extension and it probably will not be maintained).
If you want all external links to open in a new window:
MediaWiki already has a setting for it: $wgExternalLinkTarget.
Just add the following to your LocalSettings.php file:
$wgExternalLinkTarget = '_blank';
Do keep in mind that some internal links might not be identified as such, and therefore will open in a new window; one such example is an internal edit link created by using
[{{fullurl:Main Page|action=edit}}]
Link: $wgExternalLinkTarget on MediaWiki.org
I'm not sure if you want to open all external links in new windows (tabs) or only select links.
If it's the latter, then you can try our new window links extension. Not necessarily pretty, but will work if you only need a few links.
Now, if you want all external links to open up in new windows, you need to use the LinkerMakeExternalLink hook and modify the $attribs parameter to your liking.
Happy hacking!

Is it possible to save changes in Firebug locally?

What I'm trying to do is to save the changes I make to CSS and HTML on different sites with Firebug.
Just to be clear, I don't expect Firebug to upload the changes to the server via FTP or anything. I just want to save the changes locally, so only I will be able to see them.
For example I've seen a few Firefox/Chrome extensions that add a download button under every video on Youtube, so I know it's possible to do that somehow.
If you have a different way to achieve what I'm trying to do, I'll be glad to hear about it.
(It doesn't have to be with Firebug.)
Thanks in advance!
If you don't mind using Web Developer Toolbar it's easy to save changes made to the DOM (and CSS).
When you install the toolbar, you'll get a "View Source" menu, click on that and choose "View generated source". Then just copy and paste that into a .html file.
You did not say if you alter your HTML or CSS, if CSS, FireFile is a very good addon for this.
Edit, with some Googling, i found FireDiff, which states that it can export changes made in Firebug, i have not tested it bit it's worth checking out.
You could try using Greasemonkey.
It has support for adding custom scripts that are run whenever you load a page (linked to which pages it should load on) and that can make changes to the page dynamically.
https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/
The http://chrispederick.com/work/web-developer/ web developer toolbar will let you add a user style sheet to a site which should achieve your goals.
This may or may not be exactly what you're asking for, but you can download the extension FireDiff in order to save changes made with FireBug. I made a little tutorial on how to do it here: https://www.youtube.com/watch?v=m4OmZLX2zd4
I have a somewhat simlar use-case that I solved differently. I'm not sure if it is what you are looking for or not. I'll describe the behavior and if that is helpful I'll explain exactly how I implemented it.
I changed the code that execute when you click "Run" (or Ctrl+Enter) to check to see if the first line of the code is a hard-coded string //LoadFromFile:<file path>. If it is, and the file exists then I pull the file off of the local file system and run it instead of executing the code in the console window. This way I can use an external text editor to write code.

Cannot link to chrome://newtab

I'm trying to provide a link to chrome://newtab (the new tab page) for my distraction-preventing page for when I need to access it, however clicking the link gives the error Failed to load resource.
I've tried:
Linking to it using <a href="chrome://newtab">
Attempting to redirect the user using window.location.
The chrome: prefix aliases to chrome:// but still fails to load.
Does anyone know if this is possible or has any ideas to try?
I am not sure why it doesn't work, but I think it is for security reasons.
Pages on the internet should not have access to local resources and the new tab page is a local resource.
Format your link thusly (also will work with firefox and other tabbed browsers):
Click me
EDIT: of course, that's not actually the new tab page. It's just a blank tab. Going to leave it anyways.
I think you'll have to write a Chrome extension to get access to the chrome://newtab link, it doesn't seem possible for an ordinary webpage to access it.
Edit: This solution no longer works, but I'll leave it for anyone that might try to hunt down why it stopped working.
I finally found that https://www.google.com/_/chrome/newtab will open chrome://newtab, thanks to this post.
Don't ask me why.