Get previous,current and Next Record in ssrs report in a page

半腔热情 提交于 2019-12-10 20:55:30

问题


I am creating a report Which Show Previous,Current and Next id on Report. We can get Previous id via Preveious(Fields!Id.Value) but how can get next Id. Here is no function as Crystal report Next(Fields!ID.value) in ssrs. I am new in SSRS .Please suggest me solution ?

Here is screenshot to related this question


回答1:


I've created a sample dataset with the row number by category, in your case it should be by ID.

Add a tablix and use this expressions.

For the Next column use.

=Lookup(Fields!Row.Value+1,Fields!Row.Value,Fields!Category.Value,"DataSetName")

It produces:

Note that for the row number 1 there is no previous category so the cell is blank, the same condition is present for last row number which doesn't have a next category.

For your dataset it should be:

=Lookup(Fields!Row.Value+1,Fields!Row.Value,Fields!ID.Value,"DataSetName")

Replace DataSetName by your actual dataset name.

Let me know if this helps.



来源:https://stackoverflow.com/questions/39385975/get-previous-current-and-next-record-in-ssrs-report-in-a-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!