Conditional Footer on SSRS Email Subscriptions - reporting-services

At my company, we are big on knowing who provided what data so each of our reports have a footer as such
="Report Executed On: " & Globals!ExecutionTime & Environment.NewLine & "Report Executed By: " & MID(User!UserID,InStr(User!UserID,"\")+1, Len(User!UserID)) & Environment.NewLine & "Page " & Globals!PageNumber & " of " & Globals!OverallTotalPages
This works fine when a report is run from the Reports Manager Portal but if I set up an email subscription where this footer is included, the emailed version of the report contains my name as the Executor which is technically correct but I don't always want my name on EVERYTHING. Is there some expression trickery I can do to hide this portion of my report footers when a subscription is executed? Other options?
Thanks in advance!

Create a separate account to execute the subscription under then hide that part if the user name matches this account.

You could create a hidden parameter that has the User!UserID as a default value and use this in your footer. When you create a subscription you can overwrite the default.

Related

Open form using macro with where clause and it opens dialog box

I have an issue with "where condition" in macro on OpenForm in Access 2016.
I'm struggling with exactly the same issue, meaning a dialog window opening in between forms as in the link below:
Access- Open form with where clause
I have a condition like this in macro builder on OpenForm:
="ID_code_SC = " & [Forms]![SearchFRM_Materiel]![ID_code_SC]
and it still asks me to type the name of the ID. If I type it, it goes to a correct record.
Importantly, my ID is a text, such as ABC_01. So I modified it according to:
http://www.baldyweb.com/wherecondition.htm
and I have:
="ID_code_SC = '" & [Forms]![SearchFRM_Materiel]![ID_code_SC] & "'"
but this, on the other hand, opens an empty form and doesn't refer to any record.
I use Access 2016. I'm very new to Access and macros/VBA, so most likely I don't see some basic mistake.
Try this:
"ID_code_SC = '" & [Forms]![SearchFRM_Materiel]![ID_code_SC] & "'"

SSRS open report with a parameter in a new window

I'm trying to open a report with a parameter in a new window. I tried many things but it still doesn't work. It goes to the report window but it's asking to enter the parameter manually. If I hide the parameter, it says the parameters are missing.
My problem with passing the parameter is that It is a varchar(10) type value.
I checked other posts but they didn't help. The code that I'm using:
="javascript:void(window.open('http://www.report.utm.com/Reports/Pages/Report.aspx?ItemPath=%2fTechn+Info%2fConst_Tel&**ConstID=" & Fields!CONSTITUENTID.Value** & "','_blank'))"
Well, try using the following to see if that works for you?
="javascript:void(window.open('http://www.report.utm.com/Reports/Pages/Report.aspx&rs:Command=render&rc:Parameters=true&ConstID=" & Fields!CONSTITUENTID.Value & "','_blank','resizeable=1,toolbar=0,status=0,menu=0,top=20,left=20,width=1040,height=730'))"
I found the solution here: https://technet.microsoft.com/en-us/library/ms155391(v=sql.105).aspx
The below finally worked. I had to put reportserver? followed by the report path,
name and parameter.
="javascript:void(window.open('http://www.report.utm.com/reportserver?/Tech Info/Const_Tel&rs:Command=Render&ConstID=" & Fields!CONSTITUENTID.Value & "','_blank'))"
Thanks all for your help.
Try this :
="javascript:void window.open(" &"'"& Globals!ReportServerUrl &"/Pages/ReportViewer.aspx?"&Globals!ReportFolder &"/JournalVoucher&voucher_id="&Fields!account_voucher_id.Value &" ','_blank')"
 
JournalVoucher is my drilldown report and voucher_id is the parameter inside that report.
I pass the value of account_voucher_id from the column from the main report.
And if you have multiple parameters, use the following to add one parameter after another
="javascript:void window.open(" &"'"& Globals!ReportServerUrl &"/Pages/ReportViewer.aspx?"&Globals!ReportFolder &"/TrialBalanceSheetAcctCntrwise&user_id=" & Parameters!user_id.Value &"&acct_centre_id=" & Parameters!acct_centre_id.Value &"&led_id=" & Fields!lid.Value &"&from_dt=" & Parameters!frm.Value &"&to_dt=" & Parameters!to.Value & "','_blank')"

how do I show the parameters of a report in a textbox on the report?

I have a date range as parameters on my report, #dt_begin and #dt_end.
On the header of the report I would like to display "report run from #dt_begin to #dt_end".
with the actual date values in it, example:
"Report run from 14-Oct-2013 to 16-Oct-2013".
How can I do that?
thanks and regards
Marcelo
In expressions, refer to parameter values using Parameters!param.Value.
In your example, add an expression similar to this to a textbox in the header:
="Report run from " & Format(Parameters!dt_begin.Value, "dd-MMM-yyyy")
& " to "
& Format(Parameters!dt_end.Value, "dd-MMM-yyyy")
All it's doing is formatting your parameters and adding them to a larger string.

How to add a subreport in a new window?

I am developing a SSRS 2008 R2 RDL with a chart. Currently, I have a subreport built into this chart where if they click on a pie piece it goes directly to this subreport. It is currently configured as an action on the series via "Go to Report".
However, my customer wants it to instead open a new browser window so that they can still see original chart without having to rerun my report. Also, this subreport requires several input parameters. I tried the "Go to URL" Action link instead and entered the URL there. But this didn't work cause I couldn't pass in my input parameters. How can I do this?
This subreport takes multiple parameters. I have it configured as:
="javascript:void(window.open('http://evolvdb/Reports/Pages/Report.aspx?ItemPath=%2fIncoming%2fCensus_by_Date_Range2_Subreport&rs:Command=Render&startdate="+Parameters!startdate.Value+"&enddate="+Parameters!enddate.Value+"&region="+Parameters!region.Value+"&state="+Parameters!state.Value+"&office="+Parameters!office.Value+"&status="+Parameters!status.Value+"&program_hyperlink="+Fields!program_code.Value+"&funding_source_param="+Parameters!funding_source.Value+"'))"
But when I try to click this subreport it is not clickable.
I also tried this, but this exceeds the 255 character count:
="javascript:void(window.open('http://evolvdb/Reports/Pages/Report.aspx?ItemPath=%2fIncoming%2fCensus_by_Date_Range2_Subreport&rs:Command=Render&startdate=" & Parameters!startdate.Value & "&enddate=" & Parameters!enddate.Value & "&region=" & Parameters!region.Value & "&state=" & Parameters!state.Value & "&office=" & Parameters!office.Value & "&status=" & Parameters!status.Value & "&program_hyperlink=" & Fields!program_code.Value & "&funding_source_param=" & Parameters!funding_source.Value & "'))"
I also tried this, but this was not clickable either:
="javascript:void(window.open('http://evolvdb/Reports/Pages/Report.aspx?ItemPath=%2fIncoming%2fCensus_by_Date_Range2_Subreport&rs:Command=Render
&startdate="+Parameters!startdate.Value+"
&enddate="+Parameters!enddate.Value+"
&region="+Parameters!region.Value+"
&state="+Parameters!state.Value+"
&office="+Parameters!office.Value+"
&status="+Parameters!status.Value+"
&program_hyperlink="+Fields!program_code.Value+"
&funding_source_param="+Parameters!funding_source.Value+"'))"
I'm looking at the last code snippet that you tried and here is my feedback:
The report path doesn't look correct. Should be in the format http://evolvdb/ReportServer/Path/To/Report&Parameters=XX
You can't concatenate strings in SSRS with + and need to use & instead.
Example:
="javascript:void(window.open('http://evolvdb/ReportServer/Incoming%2fCensus_by_Date_Range2_Subreport&rs:Command=Render
&startdate=" & Parameters!startdate.Value & "
&enddate=" & Parameters!enddate.Value & "
&region=" & Parameters!region.Value & "
&state=" & Parameters!state.Value & "
&office=" & Parameters!office.Value & "
&status=" & Parameters!status.Value & "
&program_hyperlink=" & Fields!program_code.Value & "
&funding_source_param=" & Parameters!funding_source.Value & "'))"
My general advice for creating SSRS links is to take your browser and start there with zero programming. Ensure that your report path is correct, then manually add a parameter and ensure the report accepts the parameter value correctly. Once you have a working URL example, create a textbox in your report that spits out the URL string you are trying create. This is an easy way to ensure you are getting the expected output and you can compare to the URL that you manually crafted in the first step. Lastly, put the finished expression into the "Go to URL" action and you should most likely have a link that works as expected.

how to overwrite a parameter default value in SSRS?

I'm using SSRS 2008 and I have two reports (A and B). B has 4 parameters for which I have assigned a default value. Both reports work fine on its own
The problem is that I want to be able to call report B from report A and use the selected value to overwrite one of those parameters in report B.
So far what happens is that Report B appears when it's called from Report A but the parameter that should be overwritten remains blank and causes the data not to load at all, the. The other parameters show the default values but the 4th one remains blank.
I have tried:
taking off the default value and didn't work.
order: I also read a post here about the order of the parameters and I chose to leave the one that needs to be overwritten last in report B.
data types match among the parameter being overwritten and the value being sent from the parent report (string).
the omit parameter expression is set to false which enables the value to pass through to the drill-down report.
Any thoughts?
I've done this recently by setting a click action in a tablix control. Essentially, I went to the Text Box Properties I went to Action and then set the action as Go to URL. I've then put an expression in for the following (which you can modify to your needs depending on the destination report name and parameters):
=IIf(
Parameters!p_hide_links.Value="y",
Nothing,
"javascript: void( window.open('http://' + window.location.host + '/ReportServer/Pages/ReportViewer.aspx?/Property+Management/" & replace(Parameters!i_this_report.Value, " ", "+") &
"&p_from_date=" & Parameters!p_from_date.Value &
"&p_to_date=" & Parameters!p_to_date.Value &
"&p_lease_exec=" & Fields!submitted_by.Value &
"&p_building_state=" & Parameters!p_building_state.Value &
"&p_division_id=" & Parameters!p_division_id.Value &
"&p_building_id=" & Parameters!p_building_id.Value &
"&p_view_type=d" &
"') );"
)