Expression in a report - reporting-services

I have a report that shows the way people have contacted our business - phone, email etc. When people run the report, they choose the contact method via a drop down parameter. They can select one / many / all contact methods.
I have added a chart to my report that shows top 10s by contact method - basically why did people contact us.
In order to be reasonably dynamic, I have added this expression to the title of the chart:
="Top 10 contact reasons:" + " " + Parameters!Contact.Value(0)
This works fine when one contact method is chosen, but not more than one.
Ideally I'd like the title to say, if someone has chosen more than one contact method (say phone and email):
"Top 10 contact reasons: phone and email"
At the moment it just shows one value, because my expression isn't dynamic enough to include more than one choice.
If anyone has any suggestions to improve my expression, I'd be very grateful.
Thanks.

="Top 10 contact reasons:" + " " + join(Parameters!Contact.Value,",")

Related

ColumnHistory of a table field within a form

I am attempting to utilize an idea I have found within an Access template listed as "Asset Tracking." One of the forms, Asset Details, has a comment tab with two fields, New Comments (which is associated with a comments field in the sourced table), and Comments History, which features the following code in the Control Source:
=ColumnHistory([RecordSource],"Comments","[ID]=" & Nz([txtID],0))
The code allows one to enter information into the comment field that then updates the comment history with that comment once the form is saved and closed. This is based on the append only option being set to "Yes" under the Long Text format. The result would look something like this:
[Version: 12/18/2019 5:00:22 PM ] Jonathan's Law
[Version: 12/18/2019 5:14:13 PM ] Complete Last Interview
[Version: 12/20/2019 9:35:52 AM ] Hello Paul
[Version: 12/20/2019 10:00:31 AM ]
[Version: 12/20/2019 11:42:54 AM ] And then she got fired
[Version: 12/20/2019 11:44:07 AM ] And never rehired.
I have a database that I am initially developing for my agency for incident management (four tables: Investigations, Investigations - Target(s), Investigations - Victim(s), Investigations - Target/Victim Joiner. See this previous question for more details), and I saw that this code would be handy in identifying when an allegation changes (i.e., Neglect to Mistreatment) or to provide a comment box with comment history of my own within the forms developed. I attempted the code in my form and created a text box with the following code(s) in the Control Source:
=ColumnHistory("[Investigations - Target/Victim Joiner]","Offenses","[TargetID]=" & Nz([TargetID],0))
OR
=ColumnHistory([RecordSource],"Offenses","[TargetID]=" & Nz([TargetID],0))
Originally I tried to have either of these on the main form but I realized that the main form does not directly source the correct tables needed (I was getting a #Name? error and could not remedy it), but one of the subforms within the form did. I attempted the above codes in a text box within my allegationsubform and now receive a #Error code. I am really not sure how to proceed; I am looking for a way essentially to create an audit trail of changes to one's offenses (and eventually outcomes) as they are changed. I am wondering if the many to many relationship between victims and targets based on my arrangement is also creating issues (the TargetID and VictimID on the junction table are both PK's as part of the many to many); in which case, I am curious if something like the following code (it didn't work for me) would be on the right path:
=ColumnHistory([RecordSource],"Offenses","[TargetID]=" & Nz([TargetID],0) & "[VictimID]=" & Nz([VictimID],0))
Any help regarding this would be much appreciated; my entire Friday has gone into trying to identify an article that clearly explains where I am going wrong and none so far have helped me make the connection. All errors I have seen others correct are either the result of the code miraculously working without explanation of what was changed, or a minor grammatical error was present (i.e., missing quotes) in the code.
Sources of Research prior to asking question:
How do I display a memo field to a Form in Access
https://access-programmers.co.uk/forums/showthread.php?t=293527
https://answers.microsoft.com/en-us/msoffice/forum/all/creating-a-comments-history-box/56c1b861-f081-442c-aaa5-02b95eae14b9
https://learn.microsoft.com/en-us/office/vba/api/Access.Application.ColumnHistory
Need an " AND " in the criteria:
=ColumnHistory("YourTableName","Offenses","[TargetID]=" & Nz([TargetID],0) & " AND [VictimID]=" & Nz([VictimID],0))

Creating a URL that will randomize at intervals and remove access to past URLs

Okay, I know this question has been half answered around here, but I'll explain in full and see if there maybe a better way to handle this then in just two parts.
I'm building an HTML5 voting site, that will close voting every half hour. And then open a new batch of voting.
What I need to do, is have the URL of this site be 'masked' ie:
have a random URL for it be generated that leads to the same location- so say I'm directing users to voting.com, I want them to only access it via the url votingstuff.com/hg67, and have that end portion be changed every half hour- and once the new url is generated, remove access to the site via the old URL.
I might add that after the user votes, I'd also like to close their voting access until the new URL is posted. AKA- everyone only gets one chance to vote.
Thoughts? Libraries to check out? Sites that do this? I know the randomization has been answered a few times, but usually it's a generator led to by a page, I want to START with a randomly generated URL, and not have a page that creates it as a function. I may have to write code that generates the page I guess?
Here is an approach I can think of -
You don't need to handle multiple URL's, you can achieve this on the same URL itself by enabling/disabling access to the URL content every hour.
You will need some action on your application/server side as well. For reference lets assume you have a PHP server running. You will need some table that holds a status setting for you, something like this -
Settings Table
id settingCode value
=============================
1 votingOpen 1
You will also need to setup a cron job on your server that will run every half an hour. The cron job's task would be to run every half an hour & change the value of the votingOpen to its inverse. So assume open your votings, initial value of the votingOpen field would be 1 i.e the first half an hour of voting starts.
Along with this you will start the cron job as well. Now what will happen is that after half an hour the cron job will fetch the value of votingOpen read it & if its 1, it will change it to 0 & if its 0 it will change it to 1. This will happen every half an hour on your server.
Now you need to make this votingOpen variable accessible on your client side code using a simple query to fetch its value. On each render of your voting page, on top somewhere you can check this value & if its 1 i.e true, you will write the logic to go ahead & show the voting page. But if its 0, you can redirect the user or show a different message on that page.
Lets say your voting happens on http://somedomain.com/voting, on the render logic of this page you can do something like this -
Voting View Logic
<?php
$votingOpen = {some database query that fetches the value from the database};
if($votingOpen) {
// your voting view resides here
} else {
// either redirect user to some other page
// or show some message like voting is closed on this same page.
}
?>
Limit multiple votes from one person
Normally the best way to handle this is a combination or registered user only vote + cookie/localStorage + IP tracking
But if you don't have registered user voting, you can still capture IP of user & allow only one vote per IP and you can also set a cookie or a localStorage variable in the users computer so he can only vote once.
Hope this helps.
Ref for Cron Job - http://code.tutsplus.com/tutorials/managing-cron-jobs-with-php--net-19428

Access Dropdown to filter subform

Apologies if this has been answered but being new to access i cant see what will help me,
I have a access form that as a subform in it that displays an engineer name and a tickbox to select when logging downtime for the engineering team. however there is 4 teams and they are generally getting bigger which now means we have to scroll through the names to get to an engineer we want.
I have a list of all the engineers and what team they are associated to on 1 table and on the main form there is a dropdown with the teams on. When i select a team from the dropdown i want the subform to filter out any engineers that dont belong to select team.
Additional Information
Subform_SelectEngineer
Dropdown name is TeamFilter
Hope this is substantial information
on after update for your Teamfilter, set your
subform_selectengineer.filter = "[TeamName] = '" & me.teamfilter & "'"
subform_selectenginner.filteron = true

Trac Advanced Reports

I have a trac report that displays how many tickets are at each stage of the workflow. Is it possible to make reports dynamic, so if a row is clicked a report for those tickets are shown.
SELECT stage,
count(status) as 'Number of Matches',
id as _id,
'[..1] Tickets Here' as link
FROM ticket
Failing that, it would be useful to have a link to another report that shows all the tickets at that stage but links are seen as text in the report.
[..1] Tickets Here
You can also make dynamic reports using wiki pages. Personally, I find that to be the easier approach most of the time.
For your purposes, you could have something like this:
== Open Tickets, By State ==
[report:4 New] ([[TicketQuery(status=new,format=count)]])\\
[report:5 Accepted] ([[TicketQuery(status=accepted,format=count)]])\\
[report:6 Code Review] ([[TicketQuery(status=codereview,format=count)]])\\
[report:7 Testing] ([[TicketQuery(status=testing,format=count)]])
This will result in output that looks like:
New (40)
Accepted (12)
Code Review (8)
Testing (17)
where the name of the state is a link to a detailed report listing all of the tickets in that state. You will need to create a report for each state and fill in the correct report numbers for the report:# links in the example.
If you are interested in viewing this information per milestone then you might do well to customise your milestone page instead of creating a separate report. This page explaining how to create custom state groupings in the milestone progress bar will be useful to you in such case.

How do I hotlink email addresses in reporting services?

I have a dataset that returns with individuals email addresses. I would like the ability to just click on them and boom up pops a message addressed to that person just like in any other MS application.
I tried right-clicking the field, go to properties, then the action tab, and point the "go to url" to the email column list in the data set and no go.
This seems like a no brainer...
It has to be a valid URL link, not just an email address, so you have to prepend it with "mailto:". For example, make the navigation URL be an expression like:
="mailto:" & Fields!EmailAddress.Value
For bonus points, add a subject:
="mailto:" & Fields!EmailAddress.Value & "?subject=This report is great!"
Or even a subject and a body:
="mailto:" & Fields!EmailAddress.Value & "?subject=This report is great!&body=You deserve a raise!"
Of course, the expression for the Value property of the cell should remain just as the email address.
="MailTo:" + Fields!EMAIL.Value & "?Subject=" + Fields!SUBJECT.Value