Dynamically changing the bound entity of a list box on a canvas - powerapps-canvas

I'm wondering if anyone has come across this issue.
I have two radio buttons on a canvas app that I am attempting to control the values displayed within a list box.
RadioButtons.Items: ["SomeValueA","SomeValueB"]
The list box control should be getting reset whenever the value of the radio button changes.
UpdateContext({resetList: !resetList});
UpdateContext({resetList: !resetList});
Reset(lbListbox);
lbListbox.Reset: resetList
For the list box itself I have the following for Items:
Switch(
RadioButtons.Selected.Value,
"SomeValueA",
Sort(
EntityA.FieldName,
Descending
),
"SomeValueB",
Sort(
EntityB.'Some other field name',
Descending
)
)
The problem is when I select 'SomeValueA' the list box properly populates with the values from EntityA.FieldName but when I then select 'SomeValueB' from the radio buttons the list box blanks out with empty records. There appears to be items in the list box that I can scroll through and select but not see.
If I put two list boxes on the screen and set their Items event to the specific entity the values show up properly in both list boxes so I know the entity naming/field is correct.
I've tried it without the reset of the list box, I've tried it using collections made out of the entity records.
Has anyone come across this who maybe has a solution. I was going to try to put two list boxes on top of one another and either hide/show or bring to front the active list but that also doesn't want to work.
thanks!

(Received this post from another source, figured I might as well post back here as well)
Got this to work, but it was a bit finicky. The catch seemed to be giving the List a value-pairing table, instead of just a list of values.
First I collected the Option Sets from CDS, and added a column to indicate the source name, for reference. This could easily be combined into a single collection, and then filtered later but I was thinking simple.
ClearCollect(colOptionSet1,AddColumns(Choices('Ownership (Accounts)'),"appSource","Ownership"));
ClearCollect(colOptionSet2,AddColumns(Choices('Preferred Method of Contact (Accounts)'),"appSource","Preferred Method"));
Next added a Radio button identical to yours.
Then added a List control with Items equal to
If( Radio1.Selected.Value = "SomeValueA", colOptionSet1, Radio1.Selected.Value = "SomeValueB", colOptionSet2 )
You may need to use the right-side property pane to toggle between Value and "appSource" (from collections above), but this did allow me to toggle between two separate Option Set fields in a single list.
Patching/writing this back is gonna be another hurdle. 😝

Related

Oracle forms 10, change visible elements depending on query parameters

I have different datablocks to show the results of a query. This query gets the input parameters from two lists selected by the user.
I want to change the view after the query depending on the parameters introduced, so I made different tables and change the properties before showing the results.
Example:
IF :BLOCK.EST_TRAMITA = '1' AND :BLOCK.EST_TIPO = '2' THEN
SET_ITEM_PROPERTY('FEFOR',VISIBLE,PROPERTY_TRUE);
ELSE
SET_ITEM_PROPERTY('FEFOR',VISIBLE,PROPERTY_FALSE);
END IF;
The problem is that I have to put all the tables in the same place so the editor is getting messy. Is there a better way to change the visible elements without overlapping the tables in the editor? Thanks
You can create two canvasses and each canvas on the same place.
And then use show_view to show the canvas you need.
You also have to take in account that you should create on the correct item a key-next-item trigger and key-prev-item and also at block level a key-nxtblk and a key-prvblk trigger. Because otherwise you could get in the items in the other canvas by going over the items or using the key next block.

Hide multiple rows or columns in SSRS report with same Expression at same time

I have a report containing a Tablix/table with sets of rows and columns which I am hiding conditionally using Expressions, via the Column/Row Visibility dialog.
If for example I have 3 columns which I want to all have the same Expression to determine their visibility, is there any way for me to achieve this without opening the Column Visibility dialog for each Column and entering the appropriate Expression?
I've tried selecting multiple columns, but then the right-click context menu no longer offers the Column Visibility option (it's greyed out) and I have also tried out the Hidden property of the columns (which can be amended in bulk by selecting multiple columns), but this only stops the columns from being rendered, leaving a blank space where they used to be (rather than how Column Visibility works, where columns to the right of the hidden columns are moved across to fill the gap, like hiding columns in an Excel sheet).
Is it possible to achieve what I'm after, or will I have to continue opening the Column/Row Visibility dialog for each column/row I wish to conditionally hide/show?
If the columns you want to control the visibility for are next to each other, you can create a Column Group for them and manage the visibility via the Group.
Add a new column group at the appropriate level so that only the relevant columns will be included.
If you already have Column Groups this will likely be a Child Group or an Adjacent Group.
If not, you can create an initial Column Group by dragging a Dataset field from the Report Data into the Groups pane.
Insert new columns inside the new group, and move the data from your existing relevant columns into the group.
The new group does not need to repeat, so in it's properties window set Group on: to a plain text value, e.g. "1".
Input the desired visibility settings into the Visibility page of the properties window.
For each of the individual columns inside the group set the Hidden property to False, to remove any other expressions or settings that might interfere.
Not exactly what you are looking for but perhaps a midway point - and this can apply to many things other than visibility (e.g. background colour, tooltip) - edit the RDL directly using View Code. This has the added benefit of being able to implement changes that are almost identical per column instead of identical with a minimum of mouse usage.
Typically I have set one column up the way I like it in the designer and then copy/paste under the other columns. In the case of visibility look for <TablixColumnHierarchy><TablixMemebers>. You will see a list of empty <TablixMember /> items along with the expanded <TablixMember><Visibility><Hidden>=... block where you have set up one column. Simply copy paste that block over the empty items at the position of interest (you will need to count it out unfortunately as there are no identifiers).
Bonus Tip: If you make a mistake or want to change something later, you can do a replace on all expressions at once (optional regex allowed).
Remember to backup or check in your work first because the designer may not open that report again correctly if you make a mistake :-)
Select the columns you want to conditionally hide and press F4 to see the Properties Window. Look for the Visibility node and use the Hidden property to set the conditionally expression.
The expression should evaluate to True for hiding and False for showing.
Let me know if this helps.

SSRS grouping columns to toggle visibility

I have an SSRS report with several columns - 3 of the columns had visibility set such that it could be toggled by a particular cell. The report was a single tablix with headings at the top and row groups set up below those headings. My toggle item was in the headings - i.e. outside any row groups. There are no column groups - I just want to be able to hide a few columns on demand. It worked fine but...
When a new requirement arose to throw a page within one of the groups, I had to move the headings such that they were within the highest level group. Since then I continue to get the error message:
"Toggle items must be text boxes that share the same scope as the hidden item or are in a scope that contains the hidden item, and cannot be contained within the current report item unless current grouping scope has a parent"
I have tried removing the toggle and starting again from scratch but I continue to get the message. I have also tried viewing the XML in case there is any stray toggle logic hanging around but it appears not. Any suggestions as to how I might resolve this would be greatly appreciated.
The best I could come up with is to add a new row at the very top of the tablix outside any groups and immediately above the headings (themselves within a group) and put the toggle textbox in that row. That seemed to do the trick (for Excel output anyway).

How can I add TextBoxes to an existing Matrix in an SSRS project?

Why is it that a control that appears in the property list in a BIDS project is not represented in the corresponding .rdl file?
Let me step back a bit; I'm having a heck of a time trying to figure out how to add items to an existing report, either via the XML (.rdl viewed as code) or on the design surface. I can click on a rectangle on the design surface and see a column row above it:
And if I click on the "pipe"-separated segements on that column heading row, I see "MatrixColumn4", "MatrixColumn3", "MatrixColumn2", and "MatrixColumn1" in the designer; for example, here's MatrixColumn3:
However, only one of these columns appears at a time in the Property list - if I select MatrixColumn3 on the design surface, MatrixColumn1, MatrixColumn2, and MatrixColumn4 are not there. The same holds true for selecting any of the others - it turns up temporarily in the Properties list but "hides" all the others:
Stranger yet, when I search the .rdl file (viewed as XML) for "MatrixColumn1" (or "2" or "3" or "4") they do not exist there. In fact, the only reference to "MatrixColumn" in the entire file is this:
<Matrix Name="matrix1">
<MatrixColumns>
<MatrixColumn>
<Width>1.67609in</Width>
</MatrixColumn>
</MatrixColumns>
. . .
This seems exceedingly bizarre - shouldn't there be four sets of <MatrixColumn></MatrixColumn> there?
I want to add another column heading, with a Textbox-as-label and a Textbox below that to display dynamic content, but how can I do it without adding another column heading?, or at least making room for this new column?
I can increase the width of the matrix ("matrix1") by dragging it or by increasing its Size.Width value, but its existing contents expand with it, giving me no room to add TextBoxes inside of it.
Maybe I'm approaching SSRS from a completely wrong mental angle, as I don't see much of a connection between what the report generates and what I see on the design surface and in the XML.
To add another column to a matrix right click the column header and Select Insert column. Then choose either inside group (left or right), or outside group (left or right).
A column created inside the group will repeat for every item in the column group
A column created outside the group will only appear the once to the left or right of the grouped columns.
Are you sure you are referring to a matrix (dynamic columns and rows) and not a tablix (dynamic number of rows only)?
The process for tablixes is the same as for matrixes as described above, just without the inside/outside group option.
Either method described above will include a new column with a single text box to label the column with, and another text box underneath to put the detail in.
You can also do this process by dragging a field from your dataset in the Report Data panel to the appropriate location in your existing table.
Please let me know if this helps, or if I've misunderstood your question and you require a different solution.

Labels in fields within an SSRS report

I am attempting to reproduce a form within SSRS and fill it with data. The original form has blocks with small labels inside of each box that identifies the entry requested.
I "thought" I could simply use two different tablixes: one for the blocks with borders and labels, and the other one with the actual datafields or expressions, and align the 2nd tablix directly over the first one so that it appears as though the fields are presenting data inside of the labeled boxes.
It looked as I wanted it in design view, but when I went to preview the report, it pushed the 2nd tablix below the first tablix, in effect creating two tablixes, one stacked on top of the other one (not displaying as how I intended).
So, how do I accomplish the form design in the manner that I am seeking?
You should be using a type other than tablix for your report. Use a 'List' instead and you can free float objects as you need them and also nest a tablix as well. A little explanation on list:
You can float images with text boxes and then even change syntax or draw boxes around them and decorate those.
The call out for a field in SSRS is [(value)] with the [] meaning: "Data Column in recognized Dataset"
You can call out Variables with an '#' in front of them [#Test] would be a variable a user would put in called 'Test'.
Whatever size 'List' element is will determine how large it is when it repeats. If you want a strict form ensure the length and width are set correctly on the properties of that element.
If you want it to break every page you can click on the 'List' > Right Click the top left corner > Properties > 'Add a page break before' checkbox.
My example shows a super simple textbox with a dataset that only has three ideas repeat as many times as there are id's, three times. You can apply this to your form as needed.
It looks like you could reproduce that form header quite easily with a single tablix. If you envisage the form as a set of tablix cells like so:
then all you need to do is set the Border properties for each cell to hide the borders as needed (or you could merge the cells e.g those for Applicant and Location).
You can use a tablix with only Header rows, deleting the detail row. If you need multiple forms per report, then put the tablix inside a List region.