How to add variable length ending to SSRS textbox in tablix - reporting-services

I have a tablix where the first column is a description and the 2nd column is a value. I would like the first column to contain: [description] followed by periods to the end of the column so that the report shows the following:
Description Value
Item 1 ............... 3.00
Another Item ......... 5.00
Some other Item ...... 1.00
Thanks in advance.

In order to achieve it you have to do the following:
Set textbox CanGrow to false and size your column to fit your largest string in one line. You should also fix the row heigh to display only the first row of data.
Concatenate your expression with a string of dots, containing as enough dots to cover your smallest string length
=Fields!s.Value & "................................................"

Related

SSRS - Return to the line with column group

I've got a problem about SSRS design.
I need to make a report to display a list of item size.
I need to have 1 line per item with all the size of this item (and the quantity) on the same line
SSRS Design
The "Row group" have a grouping on the "Item No" field.
Actual result
Expected result
How can you put line 2 back to the beginning?
Thanks everyone for your help !
Data :
Item No
Size
Qty
1896-S
T32
4
1896-S
T34
3
1906-S
T32
2
1906-S
T34
4
1906-S
T36
5
You can do this easily with a matrix control.
Drop a Matrix control onto your report and then drag Item_No to the 'Rows' placeholder, Size to the 'Columns' placeholder and Qty to the 'Data' placeholder.
this will will give you a basic matrix, the design looks like this...
And it will look like this when rendered..
This is not quite what you wanted but we can soon change that.
All you need to do is change the expression in the 'Data' cell from [Sum(qty)] to something like this ...
=FIRST(Fields!Size.Value) & " " & Sum(Fields!Qty.Value)
Now when we render we get this...
If you want to put line breaks in etc then you can just edit the expression to suit. Alternatively you can use placeholders in the cell to have even more control of the layout and formatting.

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.

Creating a percentage in an expression

Would like to have some text in my report like the following where the percentage is based on an expression. I would like to know how to work out the percentage.
60% of letters were sent with a first class stamp
This is an example of the figures I'm working with
First Class 300
Second Class 150
Other 50
The fields used are 'StampType' and 'RefNo'. The totals are gathered by a count on the 'RefNo'
To do this, do the following steps.
First, add a new Text Box to the report. Click inside the text box so the cursor shows inside. Right-click and choose Create Placeholder.... Enter the following expression for the Value field.
=Lookup("First Class", Fields!StampType.Value, Fields!RefNo.Value, "ReportMain") / Sum(Fields!RefNo.Value, "ReportMain")
This assumes the dataset name that is returning your data is named ReportMain. Change this if needed.
This looks up the First Class RefNo value from the dataset, and then divides that by the total of the RefNo in the dataset.
Go to the Number section of the dialog, change the Category to Percentage. Adjust the Decimal places to your liking. Click OK.
Type the text you want to follow that value after the placeholder (not in the placeholder) in the text box. Like this:
Preview the report, and you should have what you need.

Referencing list boxes in Access

I'm new to Access so this might be a simple question.
I have a form in Access 2013. There is a subform displaying a table from an SQL server, like so.
Company Product
-----------------
CompanyA Product1
CompanyA Product2
CompanyB Product1
CompanyB Product2
Using ListIndex in a list box, I can display the index of any row I click on. For example if I click on the second row (CompanyA, Product2) the list box shows a ListIndex of 1. If I click on the third row the ListIndex is 2.
How do I get a list box to display the value of a column instead of the ListIndex?
What I am trying to do is that, when I click on a row in the subform, I'd like to display each column value for that row in its own list box.
However, I cannot seem to use ListIndex as a variable in a larger function. I've attempted the following:
Typing only the column name into the list box. Does not update the value if I click on a different row.
Column property does not update the value if I click on a different row.
Controls property gives an error.
Value property displays the correct row but only works for the first column.
Combo boxes circle back to the problem that I need to use ListIndex as a variable.
Is there a different property I should be using? Am I missing something in the properties I tried?
There seems to be a little confusion with terminology. Your List3 is a list box, not a subform.
The fields Company and Product look like text boxes, but if the first one has the control source =[List3].[ListIndex], and shows a text and not a number, it seems to be a listbox with height = one line.
I suggest using text boxes for Company and Product, with these control sources:
=[List3]
for the bound column. Alternatively, for consistency: =[List3].Column(0)
=[List3].Column(1)
for the second column.
These text boxes update themselves automatically when you click on an item in the listbox.
To get the value of a listbox, and if you allow multi-select, use the following example:
For Each varItem In Me.lstHierarchy.ItemsSelected ' Loop through the items selected (if multi-select allowed)
strPrint = ""
For i = 0 To iCols ' Loop thru each column in a row
strPrint = strPrint & "|" & Me.lstHierarchy.Column(i, varItem)
Next i
Debug.Print "Selected Value: " & strPrint ' Display the row; columns are delimited with '|'
Next

how to do column grouping in table or list

I have a problem in SSRS reporting.
I have a data like this
BILLNO | AMT
----------+--------
123 | 1000.00
1223 | 2000.00
I need to show in table or list in following way
123:1000.00 1223:2000.00
I tried by applying column and row grouping on two unique keys but it didn't work for me
So you need to show both the values in the same cell?
Firstly, assuming that you want to display this in a vertical list, you can simply add both values to a single text box.
Add BillNo to the cell
Add a colon in plain text
Create a new placeholder in the textbox (by right clicking), and set the Value of this to =Fields!Amount.Value
The design looks like this
And the output like this
Alternatively, if you want them side by side, create a matrix with column groupings on BillNo (you can always delete the column header, but not the associated groupings to improve your layout if you wish)
--->