Class '<classname>' cannot be indexed because it has no default property - reporting-services

I created a custom code block for the first time in a report.
When the report is previewed this error is displayed:
Class '<classname>' cannot be indexed because it has no default property
I am trying to populate a report field with a value. Here is the code in the custom block:
Sub PopulateSubTotal
Fields!HeaderSubTotal.Value = Fields!TextboxSubTotal.Value
End Sub
Please tell me what I did wrong as this is my first attempt at using custom code blocks in a report.

If you get this error and the class name is ReportExprHostImpl.CustomCodeProxy, you may have written an expression with Code!MyFunction(...) instead of Code.MyFunction(...).

A solution was found.
I found out this can't be done in a custom code block so I used a variable instead.
Please reference this posting for the answer:
Displaying the value of a textbox in other parts of a report

Related

concatenate variables in angular property element

I comment, and looked here and I can not find the solution, my problem is the following:
in my html template in angular, I need to pass a series of data to the metadata property of a button, I can't get the correct way to successfully concatenate the variable that contains the value.
this should be the html element:
<mati-button clientId="clientId" flowId="flowId" color="green"metadata='{"user_id":"1234778","email":"som#som.com"}'/>
I tried several ways but I can't insert the respective values....
example:
<mati-button metadata='{"userID": "{{user.id}}" }'></mati-button>
unsuccessfully...
Assuming mati-button is an Angular component with metadata as Input(), you are probably looking for
<mati-button
[clientId]="clientId"
[flowId]="flowId"
[color]="green"
[metadata]="{ userId: '1234778', email: 'som#som.com'}"
></mati-button>
See the guide on property binding to learn more:
To bind to an element's property, enclose it in square brackets, [], which identifies the property as a target property. [...] The brackets, [], cause Angular to evaluate the right-hand side of the assignment as a dynamic expression. Without the brackets, Angular treats the right-hand side as a string literal and sets the property to that static value.
By "dynamic expression" they mean JS-expressions, i.e., a public variable available through the component's TypeScript, a boolean expression, an array, or, like in your case, a JS-object that you can construct inline.
You can try doing this
<mati-button metadata="{'userID': user.id }"></mati-button>
metadata='{" userID ": {{user.id}}}'
in the end I got it. Apparently I don't know why, but the third-party script hides that parameter and it couldn't be debugged in the console, but it does receive them without any problem! Thanks everyone for your help!

Paste a value in a textbox on the second tab of a navigation form access vba

I'm quite new to VBA and I've been looking around but cannot seem to find a solution to my problem.
I have made a navigation form (frmNavigation) with 3 buttons, each referring to a different form, let's call them frm1, frm2 and frm3. In the navigationform the control buttons to switch between tabs are all named differently (btn1, btn2, btn3), but the subform that shows either frm1, frm2, or frm3 has the same name: “NavigationSubform” (this shows a different form depending on which tab is clicked on, based on the 'navagation target name' referring to frm1, frm2 and frm3).
When I want to refer to a textbox (txtBox1) on form 1 (first tab) and insert a value i can do this by:
Forms!frmNavigation!NavigationSubform.Form!txtBox1.Value = "insert awesome text"
But how would I refer to txtbox10 on the second tab (frm2)? Just using the following does not work:
Forms!frmNavigation!NavigationSubform.Form!txtBox10.Value
You then get the error 2465 (can't find the field).
I’ve been trying many different things, but can’t seem to get it right. So how do I refer to a textbox on a different tab than the first one?
Help us much appreciated!
Only one subform can be loaded at once. So you've just got to break this process into two steps.
Store the value from txtBox1 somewhere outside of the NavigationSubforms (a textbox on the parent form with visible = no, a global variable or a table works).
In frm2's On Load event, set txtbox10 to be the value you stored.
Just note, that you will need to add conditions in the On Load event if you want to avoid that textbox being set to an empty string or a wrong value if you have a setup where your filter is changing.

SSRS Hiding Text in Footer

On my SSRS report I want to hide a page footer if none of the rows returned meet the condition where I need to show the footnote. I have a list of names and on the report I add an asterisk to indicate a certain condition for that person. For example:
Smith, Sally*
I have a footnote that says something along the lines of:
*Employee needs updated form on file
I am using the Visibility option of the Text Box Property to add an expression to hide the text in the textbox of the page footer if none of the employees have an asterisk after their name. (No sense in showing the footnote if it does not apply to anyone on the report.)
I've seen some examples here and thought this would work (setting false to not hide the text if an asterisk is appended to the name in the dataset):
=IIf(Fields!Name.Value.Contains("*"),False,True)
I don't get a syntax error but the footnote does not show no matter what I do with this expression or similar ones I have tried. I saw one place that said you cannot use a expression to hide the text in a textbox in a page footer but could not confirm this is true.
Is it my syntax or that fact that one cannot hide text in a textbox on a page footer? The option is not grayed out so it seems this should be possible.
This formula doesn't lookup a results set.
It only checks the first row: if the first row contains asterisk you will see footnote.
You can try to solve this for footer such way:
Create report variable "Has asterisk"
Create function at report code:
Public Function CheckAsterisk(ByVal CheckString As String) As String
If CheckString.Contains("*") Then
Report.Variables!HasAsterisk.Value = True
End If
Return CheckString
End Function
Call function from textbox where you display person name:
=Code.CheckAsterisk(Fields!Name.Value)
Check report variable at footer

Use multiple ReportItems in one expression in RDLC Report

I want to display page wise sum of 2 columns in footer.for that I am using following expression in footer
=Sum(ReportItems!col1.Value) + Sum(ReportItems!col2.Value)
but it gives following error
"The Value expression for the textrun refers to more than one report item. An expression in a page header or footer can refer to only one report item."
anybody knows how can I solve this issue and display page wise sum in footer ?
Thanks
Here is simple workaround for your problem:
Add single textbox to the body of the report and name it i.e. "SUM"
Add your expression to this textbox =ReportItems!col1.Value + ReportItems!col2.Value
For this textbox set visibility as hidden
In the footer refer to this hidden textbox using =ReportItems!SUM.Value
I usually use Custom code-feature of report for these operations. Just open Report Properties and choose Code-view. Just then write basic VB get/set-methods to save and sum values.
Referring to methods in TextBox expression goes just like this: =Code.[YourMethodNameHere].
For example, saving value:
=Code.SaveMyValue(Fields!MyVal.Value)
and getting value:
=Code.GetMyValue()

Giving a multiselect combox a default (set of) value(s)

I am currently using multiselect comboboxes to specify filters for a query (that will go on to generate a report).
I have it all working fine, apart from the fact I would like to specify default values to each of these comboboxes when the form is loaded.
It seems like using the builtin default box in the property panel doesn't accept multiple values (or rather I don't know how to give it multiple values)
I have tried selecting the values I want at runtime using the Selected property of the control:
For i = 0 To Me.MyComboBox.ListCount - 1
Me.MyComboBox.Selected(i) = True
Debug.Print Me.MyComboBox.Selected(i) 'Returns false
Next i
But unfortunately that doesn't work. It doesn't give an error or anything, but setting it just doesn't seem to change the value.
Does anyone have any idea on how to achieve this? I would essentially like to go on to have an "All" button next to each combobox that selects all the values in the combobox, so preferably a VBA approach to the problem would benefit me the most.
Any help is much appreciated
Add the following before setting the Selected property:
MyCombobox.SetFocus
MyCombobox.ListIndex = 0