displaying results in column based on code in other column - reporting-services

hello, i have a table with three columns (TEL, MOBILE, EMAIL) after the column "Contact Type". I'm trying to figure out how to show/hide the results in the 3 columns based on the code that is in the Contact Type field.
for example if the contact type = MBL then the results would only show in the column labelled Mobile,
if the code in contact type was "TEL" then only results would only display in the column labelled TEL.
the other two columns would remain blank. the code for the last column is EML.
can this be done as an expression?
thanks in advance for the help
regards

You can use an expression in each of the three columns. For example in the "Tel" column would be something like this.
=IIF(Fields!ContactType.Value = "TEL", Fields!Tel.Value, "")
You'll just need to replace the text string and field names in each column as required.

Related

How to split the text and date into 2 columns in google sheet?

Hi everyone,
I want to split the data in screenshot above into 2 columns. Currently the text and the date are combined in one column, my goal is to split the column into 2, so one column will be *AMC or *BMO and another column will be the date. For those cells without text (*AMC/*BMO), then the text column will be just empty.
I tried to use SPLIT function but there is no delimiter between the text and date, so I'm not sure how to split them. May I know is there any other way that I can use to split the column into 2? Any help will be greatly appreciated!
Assuming the data in column A, you could try
=ArrayFormula(if(len(A2:A), TRIM(regexextract(" "&to_text(A2:A), "(.+?|\s)(\d+\/\d+\/\d+)")),))
Change range to suit.
Alternatively, you can also try
=ArrayFormula(if(len(B2:B), {iferror(regexextract(" "&to_text(B2:B), "[A-Z*]+")), --regexextract(" "&to_text(B2:B), "(\d+\/\d+\/\d+)")},))
The latter option will make it possible to format the date as you wish.

How to display parts of value from database with different font size in SSRS report?

One of my columns has a value that looks like this -> "$5.95 (Park costs)"
and I need to display the value in column in SSRS report like this:
$5.95
(Park costs)
but font size of "(Park costs)" must be smaller than the price.
Is something like that even possible? To somehow make text that does not contain a number, dot or dollar sign smaller?
You can do this. You'll need to split up each component of the text column and then place each half in a placeholder. You can then format each placeholder individually.
This solution assumes that your column always contains a "(". If not you should be able to modify it to suit.
I Generated some test data and and placed it in a normal table (tablix) control.
I then added some new columns for testing that each part was working as expected.
The expression for "Cost" column is
=TRIM(LEFT(Fields!MyColumn.Value,InStr(Fields!MyColumn.Value, "(") -1))
The expression for the "Caption" column is
=TRIM(RIGHT(Fields!MyColumn.Value, LEN(Fields!MyColumn.Value) - InStr(Fields!MyColumn.Value, "(") + 1))
Once this was working OK I added the "Final Column".
To add a placeholder, click inside the textbox so the cursor appears then right-click and choose "Create Placeholder"
I added two placeholders with a space between then and set the values to the expressions above respectively. I then right clicked the placeholders chose "Placeholder Properties" and formatted each individually.
The final output looks like this. (I left the test columns in for clarity)

SSRS - Display a text based on first row value

I am trying to write an expression, If the result-set's first row values is equal to 1 then display a text. I am not sure how to get first rows value. Can someone help me out to achieve the same.
=IIF(Fields!IsAccessAvailable.Value=1, "You have full access to this page","")
=IIF(First(Fields!IsAccessAvailable.Value, "YourDatasetName")="1",You have full access to this page","")
You could also add the same expression as Textbox Visibility, so that if Fields!IsAccessAvailable.Value = 1 then and then only this textbox will be shown else it will hide it.

How to generate numbers for showing sequence in SSRS also it should get rearrenge when any field inbetween is missing

I am facing problem in SSRS report for showing sequense numbers as given in image.
when I searched for this issue I got solution as -- RowNumber("DataSetName")
but problem with this is, it generate numbers like 1,2,3..., but I want these numbers in following forms- 1.1, 1.2 or 1.1.1, 1.2.1.
And another problem for me is above function will work if I am having multiple rows in dataset and that dataset is bind with table to show its data, but In my case I am getting all data in single row and out of that I am showing values in textbox using expressions and if that value is empty I am hiding that textbox.
so I am not getting any solution to show sequence number in textbox along with text and how I can rearrenge that numbers if my inbetween textbox is hidden because of no data.
Please provide me solution for above probem.
Image for reference -
Example of data is :
From above table values from "Subheading1" And "Subheading2" will show inside "Heading first" and "Subheading3" And "Subheading4" will show inside "Heading second".
You can concatenate row numbers as strings as follows:
=RowNumber("HEADING") & "." & RowNumber("SUBHEADING")
To ensure numbers are consecutive remove the relevant rows in the source dataset instead of hiding them in the tablix.

Autofilling my form in Access with the use of a Combo Box

I'm having a problem when I want to autofill my form in Microsoft Access. The idea is that I use a combo box to select a name. Then the onChange code of my Combobox automaticlly inserts all the other data in the proper field. I use this code on the Combo Box.
Private Sub cmbName_Change()
Me.tbPersonalNumber = Me.cmbName.Column(0)
Me.tbEmailadress = Me.cmbName.Column(2)
Me.tbBirthday = Me.cmbName.Column(3)
End Sub
This methode works fine for the personalnumber and the emailadress. But it doesn't work for the birthday date, it returns a null value but when I check my table there is is a date in the proper field.
Am I missing something? I tried everything but it wont work.
I was thinking that the problem is related to the birthday column being the last in the table. Or having the date type.
Thank you in advance for your time and efford!
Edit; The .Column(1) is missing because this is the name that is already inserted with the ComboBox.
There is some confusion caused by the wording of the question, I'll try to state back how I've interpreted and if I have it right it may lead you to an answer.
You have combo box called cmdName that is pre-populated with data from a table. The content of the combo box could look as below (you may have set column widths to zero to hide the data)
0001|Gary Evans|gary#email.com|01/Jan/1970
0002|J Rommers |JR#email.com |02/Jan/1970
When the user selects J Rommers Me.tbPersonalNumber is populated with Me.cmbName.Column(0) (0002) and Me.tbEmailadress is populated with Me.cmbName.Column(2) (JR#email.com) but Me.tbBirthday is not being populated with Me.cmbName.Column(3) (02/Jan/1970).
Assuming Me.tbBirthday is a text box with no code that might clear it out, I suspect the issue is within the combo box. Not being sure how your combo box is set up, I would suggets the following checks:-
In the combo box properties, does the Column Count equal 4?
In debug, with a breakpoint on Me.tbBirthday = Me.cmbName.Column(3), does it show you the date you are after?
If it is not there does the query that populates the combo box have it in?
Edit based on comments to help further: -
Change the query to SELECT Personel.PersonalNumber, Personel.Emailadress, Personel.Birthday, Personel.Name FROM Personel ORDER BY Personel.Name; this puts all the fields you want hidden at the front.
Change the column widths property of cmbName to 0,0,0, this first the ones you want hidden and leave the last one to fill the width of the combo box.
Ensure the column count property is still 4 as per the answer
Change your code as per below and Gustav's answer
Replacement code:-
Me.tbPersonalNumber = Me.cmbName.Column(0)
Me.tbEmailadress = Me.cmbName.Column(1)
Me.tbBirthday = DateValue(Me.cmbName.Column(2))
This accounts for the fields moving in the query and ensure the date shows as a date like you wanted.
Comboboxes (and Listboxes) always return a string, so convert that to a Date value:
Me!tbBirthday.Value = DateValue(Me!cmbName.Column(3))