SSRS - Open hyperlink using javascript - reporting-services

I am trying to open an url in ssrs.When I try directly ="http://www.google.com" it works.
I'm using placeholder properties - Action - GoToURL
="javascript:void(window.open('http://www.google.com', '_blank'))" is not working.
I have tried both IE and chrome.Any help is appreaciated.Thanks!

As you have not added much info ti's hard to tell what "doesn't work". However as a guide you use this format... This assumes the URL is stored in a field.
="javascript:void(window.open('" & TRIM(Fields!URL.Value) & "','_blank'))"
I have used this regularly with no problems. This will only work once the report is deployed (it won't work from Visual Studio or Report Builder)

Related

Drill through in SSRS in Report Server using the expressions

I've my reports previously on SharePoint site.
I recently deployed my reports to the Report Server.
In the reports there're expressions on the URL Actions part in Text Box properties where expressions have been applied based on the parameters values.
After deploying my reports to the report server and clicking on one of the value where actions have been applied i get the error.
Error:
The item 'BC/Report/get.rdl' cannot be found. (rsItemNotFound)
I've tried placing the link of the report directly in the expressions but that's not working either. I think there needs some review in the expression.
Expressions looks like this:
= IIF(Parameters!ForEmail.Value <>
TRUE,Globals!ReportServerUrl,Parameters!ReportURLSub.Value) & "?" &
Globals!ReportFolder & "/get.rdl"
Thank you in Advance and sorry if explanation is not enough.
did you tried static url per hand in browser? does it work.
If yes try adding this parameters as Parameters!ReportURLSub.Value) in Textbox and see if it results desired result.
Also check if Globals!ReportServerUrl returns correct value
If yes can create this url whith your parameters in a Textbook static and see what result you get.
If all these steps pass then move to your last step, creating as a Action.

VS 2017 with Local reports - The report definition has not been specified

I am using vs2017 with ReportViewer 14.0 in a WinForms application. I have done this before in previous versions of VS without any issues and I am very surprised why I can't make this work this time.
Here is what I have done so far:
I created a report (RDLC) in the Reports folder which resides in the root of the application.
I set the BuildAction to None and Copy to Output Directory to Copy if newer
In a new form, I placed the ReportViewer component (called rpt)
I set the Processing mode to Local
In the Load event of the form I run the following code:
string path = AppDomain.CurrentDomain.BaseDirectory + #"Reports\Report.rdlc";
rpt.LocalReport.ReportPath = path;
rpt.LocalReport.SetParameters(new ReportParameter("parTitle", Title));
rpt.LocalReport.DataSources.Add(new ReportDataSource("ds", Data));
rpt.Refresh();
When I run the app, the form loads but the ReportViewer displays a message: The report definition has not been specified
I also tried setting the build action to EmbeddedResource and using:
rpt.LocalReport.ReportEmbeddedResource = "Project.Reports.Report.rdlc";
Same result. I even tried:
Assembly a = Assembly.GetExecutingAssembly();
Stream report = a.GetManifestResourceStream("Project.Reports.Report.rdlc");
rpt.LocalReport.LoadReportDefinition(report);
No difference. I am always getting this:
I have been staring at this for several hours now and for the life of me I cannot figure out what I am doing wrong. Any help would be greatly appreciated.
Thank you.
I feel quite foolish now, but just as a reference to anyone facing the same issue I am posting the solution here.
Changing
rpt.Refresh();
to
rpt.RefreshReport();
did the trick. The report now loads properly. Refresh is inherited from Control and only invalidates the control, but does not force the report to be processed and rendered. RefreshReport does just that.
Hope this saves some time to someone.

Adding styles to Parameters controls in SSRS 2008

I am new to SSRS.
We are building reports in BIDS 2008 and hosting them on Share point.
There are different parameters for these reports like Regions/Districts, Start Date and End Date, Which by default shown as Dropdowns and Calendar controls by SSRS.
Is there a way we can add styles to parameter pane, parameters?
And also add validations to Calendar controls?
Any kind of help is much appreciated.
Thanks :)
You could try hacking the css in the report manager - not sure if that will 'pass through' to sharepoint. Maybe you could modify some css in sharepoint to this. Use a dom inspector such as Firebug, Chrome developer tools or IE developer tools to see where the styles are coming from.
If you need to validate dates, you can do this in a stored procedure. Check the values of the parameters and kick out an error message. It's not pretty, but it works.
IF DATEDIFF(m,#STARTDATE, #ENDDATE) > 0
RAISERROR(N'Date range must be less than one month',16,1)

How to stop ReportViewer control (VS 2010) from html encoding my links

I have a reporting services report with a url with querystring parameters in a column. When it is accessed directly through reporting services, all is well. I click on the url and it goes to the appropriate page.
However, when I access the report through the ReportViewer control in VS 2010, the ampersand in my link is html encoded. So the querystring parameters
?value1=abc&value2=def
become
?value1=abc&value2=def
This is messing up my report. How do I stop the ReportViewer from HtmlEncoding the results?
Ok, I have just encountered this and found a simple yet unsatisfying solution:
Create a text expression like this:
=Replace(Fields!MyDbField.Value ,"amp;","")
Not elegant but it works and it is unlikely you will have a string with the actual real value of "amp;"

SQL Server Reporting Services Default Values From Query not working in deployed report

In order to populate a textbox in a page header I am setting up a parameter (as you cannot use Fields) and referencing this in the textbox. The parameter has the Default Value set to "From Query" and the Dataset and Value Field are set accordingly. This works a treat in developmentt in Visual Studio 2005. Once I have deployed the report and am viewing the report in the ReportViewer control I get the error:
"Parameter validation failed. It is not possible to provide valid values for all parameters. (rsParameterError)".
If I remove the parameter, the report works fine.
(Strange thing is that I thought I had this working earlier).
You've probably checked, but has the default value copied over? I've had issues in the past with reporting services where the default values were lost when I moved a report from one box to another.
Thanks for the answer - it has pointed me in the right direction...I have been using my own program to deploy multiple reports so rarely look at them via the Report Manager website. Anyway - I just deployed the report on my home PC and it worked fine....looking at the report in Report Manager on both PCs I found that "Prompt User" on the PC that wasn't working was not ticked...go figure. Ticking this resolved the problem.
I am liking the results that I am getting from SSRS, but I am quite new to it and am finding some things (like this) a little frustating...mouse and keyboard are lucky to not find themselves thrown out the window!