Click here to Skip to main content
15,881,898 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi guys,

i have created one stored procedure,
in which i have union all two tables for students,
where i have student info order by busno's.

n

i have created crystal report for this n it is with sub reports.
if i have 21 buses then the report will generate for 21 buses in subreport.


now the problem is, i have to show serial numbers in the report for each bus.

plz help me to get.

thanks
Posted
Comments
OriginalGriff 26-Jan-15 4:39am    
And?
What have you tried?
Where are you stuck?
What help do you need?
Sinisa Hajnal 26-Jan-15 6:11am    
What is preventing you from getting bus SN in the query?
ZurdoDev 26-Jan-15 8:17am    
Just add the field.

1 solution

Hi

You can use below text as column in your sql stored procedure to prduce serial no in out put of sql server stored procedure.

SQL
ROW_NUMBER() Over (order by id) as SrNo


You need to change your identity columns name instead of "id" column in above syntax.

Now you can use SrNo column in crystal report to show srNo. in report.

Please mark as answer if you will get as you want.

Thanks,
Vipul
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900