Thursday, 10 October 2013

SSRS: sorting in data

Question: How to apply sorting on columns in SSRS?
Answer: To apply sorting on columnss in SSRS, there are following steps -

Step 1 - Select whole table, right click on the top-left corner then select tablix properties. 














Step 2 - Once click on tablix properties a dialog will appear, select sorting vertical tab. Add filters by and corresponding order(ascending or descending)as below screen shot.







































I hope it should work.























SSRS: Decimal places

Question: How to remove decimal point in SSRS cell's data?
Answer: In SSRS if it is required to remove decimal point from cell's data then need to set the format of number.

Example - If cells data is having the format like 2034.152. Then it would be 2034 after formatting.

or If cells data is having the format like 2034.652.Then it would be 2035 after formatting.

Follow the below steps -

Step 1 - Go to the cell's expression by right click and select expression.

Step 2 - Do the round of in to expression -









Now check your report preview,  I hope it should work.


Question: How to place two decimal places in SSRS cell's data?
Answer: In SSRS if it is required to place decimal points till two places in cell's data. Then need to set the format for cell's data.

Example - If cells data is having the format like 2034.1. Then it would be 2034.10 after formatting.

or If cells data is having the format like 2034.667.Then it would be 2034.67 after formatting.

Follow the below steps -

Step 1 - Go to the cell's expression by right click and select expression.

Step 2 - Set the format and round of in to expression -










Now check your report preview,  I hope it should work.

Sunday, 6 October 2013

How to pass logged in user name as SqlParameter in ASP.NET

In the scenario i have a gridview, which should contain the data based on current logged in user. The main challenge, i was facing how to pass current login user name to the Sqlparameter. After a little research i got a wonderful solution which is worked - 

Step 1- Defined select parameter in "<asp:SqlDataSource" as 








Step 2- In page load write the below code -















This work perfect for me, Please provide your comment if you got something better.