Reporting services display data format help
I have a Tablix and my query returns 5 records. Here is my query results. Please let me know how to display them. I appreciate any help. Thank you.
2 Test1 20
3 Test2 30
4 Test3 40
5 Test4 50
I have to display in the following format on the report.
Title
-------------------------------------
obj1: Test1 Percentage: 20
obj2: Test2 Percentage: 30
obj3: Test3 Percentage: 40
obj4: Test4 Percentage: 50 开发者_开发问答
Here is one way you can do this. The example was created in SSRS 2008 R2.
The example assumes that you have created a data source and created a report using the wizard with the help of a query.
This is the table structure I have used for this example.
Following query was used in the report and also the table records are shown.
Now, you have a report like this with each of your columns displayed separately in the report.
Right-click on the first column and select Expression...
Enter the expression ="Obj" + Cstr(Fields!Id.Value) + ":" + StrDup(10, " ") + Fields!Obj.Value + StrDup(10, " ") + "Percentage: " + CStr(CInt(Fields!Percentage.Value))
This query uses CStr
to convert integers to string. I have used CInt
for the numeric field to drop off the decimals. The function StrDup
is to duplicate the space 10 times. You can specify the number to determine how many spaces you need.
Right-click on the column Obj and select Delete Columns
.
Right-click on the column Percentage and select Delete Columns
.
Expand the column Id and change the title text to Title. Run the report and here is the output.
Hope that helps.
精彩评论