Rownumber function returns the number of the row of the dataset
EMP_NAME
Emp1
Emp2
Emp3
Emp3
Emp3
Emp4
If we would like to groupby EMP_NAME and show the row number beside each row, the result will be :
Row number EMP_NAME
1 emp_1
2 emp_2
3 emp_3
6 emp_4
As you can see the row number value is not correct, actually it is correct because the rownumber function returns the number of row inside the dataset not inside the grouped data in the report
Now we need to display the row number for what we see in the report instead of what is inside the dataset
I am going to use runningvlaue function for the grouped data inside "table1"
=runningvalue(Fields!EMP_NAME.Value,countdistinct,"table1")
Result:
Rownumber EMP_NAME
1 emp_1
2 emp_2
3 emp_3
4 emp_4
Runningvalue function: accumulates the result of any aggregate function except for rownumber and runningvalue.
Database Analysis & development tools, issues & solutions including ORACLE, SQL Server,MS ACCESS & VB.NET
Showing posts with label RDLC Report. Show all posts
Showing posts with label RDLC Report. Show all posts
Tuesday, March 10, 2009
Row number for grouped data
Monday, March 9, 2009
Next line command
How to display data in the next line inside the same data field
=Fields!EMP_Name.Value & System.Environment.NewLine() & Fields!EMP_Address.Value
Result:
EMPNAME
ADDRESS
=Fields!EMP_Name.Value & System.Environment.NewLine() & Fields!EMP_Address.Value
Result:
EMPNAME
ADDRESS
Friday, March 6, 2009
Report page footer
Add page number to Reprot Page Footer
="Page " & Globals!PageNumber
Result: Page1, Page2,…..etc
To display the total number of pages you can use “Globals!TotalPages”
="Page " & Globals!PageNumber & "of " & Globals!TotalPages
Result: “Page1 of 2”, “Page2 of 2”
="Page " & Globals!PageNumber
Result: Page1, Page2,…..etc
To display the total number of pages you can use “Globals!TotalPages”
="Page " & Globals!PageNumber & "of " & Globals!TotalPages
Result: “Page1 of 2”, “Page2 of 2”
Wednesday, March 4, 2009
Report image
How to add image to RDLC report
1st step: open your RDLC report add image from report items to your report.
2nd step: Report main menu select REPORT then Embedded Images click new image then select the image you would like to add.
3rd step: go to image properties Source select Embedded.
4th step: go to image properties Value you will find the image name you just embedded, select it.
Now you can see the image inside the report
1st step: open your RDLC report add image from report items to your report.
2nd step: Report main menu select REPORT then Embedded Images click new image then select the image you would like to add.
3rd step: go to image properties Source select Embedded.
4th step: go to image properties Value you will find the image name you just embedded, select it.
Now you can see the image inside the report
Tuesday, March 3, 2009
Field format
Replace null values with 0 inside the RDLC report
The following statement replaces the null value with 0 else it keeps the default value
place the code inside the field expression
=iif(Parameters!emp_salary.Value like "",0,Parameters!emp_salary.Value)
Aslo you can replace a specific string with another one
For example if the string begin with “REJ” replace it with “Rejected”
=iif( left(Fields!EMP_ENROLLMENT.Value,3) like "REJ","Rejected",Fields!EMP_ENROLLMENT.Value)
The following statement replaces the null value with 0 else it keeps the default value
place the code inside the field expression
=iif(Parameters!emp_salary.Value like "",0,Parameters!emp_salary.Value)
Aslo you can replace a specific string with another one
For example if the string begin with “REJ” replace it with “Rejected”
=iif( left(Fields!EMP_ENROLLMENT.Value,3) like "REJ","Rejected",Fields!EMP_ENROLLMENT.Value)
Subscribe to:
Posts (Atom)