How to determine the Last line/rownumber/record on the current page
Hi , Need some quick help . Thanks in advance. I am designing a report (sql server reporting services 2005) wherein i have to change the Border style based if it is the Last line/rownumber/record on the current page . I am not sure how to programmatically determine the last line. Any help is highly appreciated.
July 14th, 2010 7:54pm

Hi Is your no-of records in a page is fixed ? Then one workaround is 'if no-of-rows is 20 then you can give expression in the row's border property like 'if current row_number is multile of 20 then display bottom-border. I think there is built in parameter in RS to identify row number. Another option is adding a table in footer with same structure as main table and give top border. HTH Thanks Bipin. P | ERNST & YOUNG SSC
Free Windows Admin Tool Kit Click here and download it now
July 14th, 2010 9:52pm

Hi Bipin, Thanks for the quick response. I have no way of knowing the number of records per page hence i was looking for some way to dynamically determine that. I have also tried adding th extra footer with top border set to "solid" but it did not work. Still stumped. I have been trying different variations without avail. Also, it does not help that i am new to designing reports using sql reporting services. I am primarily a DBA with some crystal reports experience in th past.Any additional assistance will be greatly appreciated.If i come up with a solution , i will post it.
July 14th, 2010 10:27pm

Ok Vijay I will also check.. Now RS is not in front of me!Bipin. P | ERNST & YOUNG SSC
Free Windows Admin Tool Kit Click here and download it now
July 14th, 2010 10:47pm

Hi vijayrangak, If we have a hard pagebreak based on a group, we can follow these steps to get the last row of the group(It will be last row of the page), and then change the border style: 1. Add a group to the table, break page at the end of each group. 2. Select the detailed row, and in the Border style property, change the value to be: =IIF(ROWNUMBER("Group1") = COUNT(Fields!field.Value, "Group1"), "Solid", "None") The expression means if the current row's number is equal to the total rows in the group, it is the last row, then change its style to be "Solid". For more information, please see: Grouping Data in a Report: http://msdn.microsoft.com/en-us/library/ms155903(sql.90).aspx Expression Examples in Reporting Services: http://msdn.microsoft.com/en-us/library/ms157328(sql.90).aspx If you have any more questions, please feel free to ask. Thanks, Jin ChenJin Chen - MSFT
July 15th, 2010 12:16pm

Hi, just give fixed no of rows for a page.. Say for example 25 records per page =ceiling(RowNumber(nothing)/25), then in border style property , give the expression =iif(rownumber(nothing) = 25,"Solid","Dotted"). Regards, Gayathri devi P.S. : Please click the 'Mark as Answer' button if a post solves your problem! :)
Free Windows Admin Tool Kit Click here and download it now
July 15th, 2010 12:36pm

Hi Jin, Thanks for the reply. The records per group tend to be small since each group represents a package of items sold or an individual item for an order. The solution would result in lot of empty space on the page and a drastic increase in pagecount.If the client attempts to print a hard copy that would be lot of paper.Also , the report may not look aesthetically appealing. The idea is to fit as many groups as possible per page . There will be a solid line at the end of every group(this, i was able to accomplish) and another solid line at the end of the page. There will not be any solid lines between the items in a package/group.
July 15th, 2010 4:51pm

Hi, Were you able to find a resolution? Does this help: http://social.msdn.microsoft.com/forums/en-us/sqlreportingservices/thread/92DF2906-B958-4B32-8964-6E2B263710F1 Thanks, Cathy Miller Microsoft Online Community Support
Free Windows Admin Tool Kit Click here and download it now
July 29th, 2010 6:48pm

Hi , i have to change the Border style based if it is the Last line/rownumber/record on the current page. I followed bipin's suggestion of adding a footer and that helped me; but i need a different border only on the last page. Thanks Bipin. - arjun www.tavant.com
October 27th, 2010 6:15am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics