How can I dynamically set "Display text" property of report parameter?
What do you exactly mean by "display text" of a parameter. Are you refering to the "Selected display value" from a combobox or a listbox parameter? If so, you can use a scripted DS and generate the display values in the fetch method.
He's talking about the parameter displayText, I think he meant either this:
params["name"].displayText
aka:
reportContext.getParameterDisplayText("name")
You could try something similar to this:
var javaString = (new Packages.java.lang.String(param["name"].displayText));
javaString.replace("old_value", "new_value ");
Related
I am trying to populate a form controls default value based on the value of a combobox on that form. The combobox is called Title, and I want the control HIPAA to populate based on the value of HIPAA in my table tblTrainingEventTiles where the Title selected on the form matches the title in the table.
I was putting the following code into the default value of the control on the form:
=IIf(IsNull([Title]),0,DLookUp("HIPAA","tblTrainingEventTitles","[tblTrainingEventTitles].[Title]=[Title]"))
Access seems to ignore it however. It doesn't do anything and there are no error messages. I'm not sure if my problem is with my dlookup or with the fact that I'm trying to use this in the default value field. (or both?) Does anyone have any ideas?
Try this:
=Nz(DLookUp("HIPAA","tblTrainingEventTitles","[tblTrainingEventTitles].[Title]=[Title]"),0)
If your combobox's bound column is text you should use ' around it's content. And you should concatenate value of combobox to filter part of dlookup.
=IIf(nz([Title],"")="",0,DLookUp("HIPAA","tblTrainingEventTitles","[tblTrainingEventTitles].[Title]='" & [Title] & '"))
i have been trying to hide/show columns within my tablix based on multi value parameter , but whenever i am plugging in the expression in the column visibility properties it is not showing what i select from the parameter and hide what is not select.
Here is the expression:
=IIF(InStr(JOIN(Parameters!parameter.Value,", "),"value"),false,true)
any help???
If I understand correctly, you want to show the column if you select a value which contains "value". Right?
So the expression should be like below:
=IIF(InStr(JOIN(Parameters!parameter.Value,","),"value")>0,false,true)
I always get this wrong too. I think backwards. It is actually asking for the expression that will hide the column. SO Black_T is correct with his answer.
=IIF(InStr(JOIN(Parameters!Parameter.Value,","),"value")>0,false, true)
so whenever the expression picks up that value in the statement, it will return false, meaning that it should not hide it, and whenever it doesn't find it, well the returned product will also hide it! pretty ingenious!
Thanks and enjoy!
=IIF(InStr(JOIN(Parameters!parameter.Value,","),"value")>0,true,false)
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()
I'm new to flex/flash builder, i need to read in data from a text document, then slice it into pieces i set out in my custom class.
all of this so far worked
var theCustomer:Customer=new Customer(name,address,phoneNo,comment,custNo);
custArray.addItem(theCustomer);
So now what i want to do is display only the name from each entry of the array into a combobox - and then on close it will display all the details into a list box
If i just bind the custArray to the combobox it displays name:address:phoneNo:comment:custNo as i set it out, but like i said i want only the name so how do i separate the name from each Customer entry in the array ??
Any help you be awesome and thanks in advance !!!
If I'm understanding your question correctly, I think you want to set the labelField property on the combobox. This specifies the field in the source data objects to use in the label.
<s:ComboBox dataProvider="{custArray}" labelField="name"/>
The ComboBox has several ways to specify what it should use as the "label" for each item in the dataProvider:
By default, if the elements in the dataProvider has a property named label, and that property contains a String it will display that value.
ComboBox has a labelField property that you can use to tell it where to find the "label" for each item. In your case, you could set the labelField to "name"
ComboBox has a labelFunction property that allows you to use a function (that you write) to specify what text should be displayed for each item.
I suggest using the the labelField, as that seems the most straight forward in this case:
<s:ComboBox dataProvider="{custArray}" labelField="name" />
I have a drop down list like so:
<%= Html.DropDownList("SoldTo", Model.SellDealerList, "Select a Dealer")%>
I'm populating the list in my Controller with the following code:
SellDealerList = new SelectList(repository.GetDealerList(), "id", "name", vehicle.SoldTo);
When I debug through the code the selected value on the SellDealerList has a value that is being set but the HTML source shows no selected value in the list.
I'm baffled as to what I'm doing wrong, but being new to MVC I'm sure it is probably something very simple. The biggest difference from all the other questions and answers I've seen is that I'm not using the ViewData.
Thanks!
Check my answer to this question, maybe it helps.
Perhaps you have a property "SoldTo" in your model, ViewData or ModelState. The DropDown tries to override the selected value if some of these objects has a property or key with the same name as your field. Is kind of crazy if you don't know how it works internally because you see the selected property set to true on the right item of the SelectList and yet no option of the select is selected.