I'm attempting to get the value of a Textbox in my SSRS report, and copy that value to the clipboard so the user can paste it elsewhere. I am doing this in the form of a button the user can click.
However, I seem to be getting an error and I am unsure why this is the case.
Below is the expression I am using for the button:
=Code.CopyToClipboard(ReportItems!TextToCopy.Value)
And here is the custom code I am using for the report:
Public Sub CopyToClipboard(ByVal textBoxValue As String)
My.Computer.Clipboard.Clear()
My.Computer.Clipboard.SetText(textBoxValue)
End Sub
When previewing the report I get the following error:
The Value expression for the textrun 'CopyText.Paragraphs[0].TextRuns[0]' contains an error: [BC30491] Expression does not produce a value.
Any ideas as to why I may be getting this error?