Suppose on Screen it shows 1 to 5 but in pdf it shows 6 to 10
That means "rownumber" variable persist and you are calling WriteRow() again while exporting to PDF.
Have a close look on your code [May be you are calling this method on PageLoad() and while export it called PageLoad() again, If so then do If(!Page.IsPostBack) and call WriteRow() method - Just an assumption]
Member
504 Points
1776 Posts
Sr No
Jul 14, 2018 06:17 AM|JagjitSingh|LINK
Hi
In expression i have written
=Code.writeRow() . In Code i have written below code
Dim rownumber = 0
Function writeRow()
rownumber = rownumber + 1
return rownumber
End Function
When i run report it shows correct Sr No . When i export to PDF it shows wrong number . Suppose on Screen it shows 1 to 5 but in pdf it shows 6 to 10
Thanks
All-Star
28988 Points
7251 Posts
Re: Sr No
Jul 14, 2018 06:47 AM|Rajneesh Verma|LINK
That means "rownumber" variable persist and you are calling WriteRow() again while exporting to PDF.
Have a close look on your code [May be you are calling this method on PageLoad() and while export it called PageLoad() again, If so then do If(!Page.IsPostBack) and call WriteRow() method - Just an assumption]
www.rajneeshverma.com
All-Star
54508 Points
14111 Posts
Re: Sr No
Jul 14, 2018 11:33 AM|mudassarkhan|LINK
In the PDF export function first line set
So it will again start from 1.
Blog: ASPSnippets | Forum: ASPForums | Company: Excelasoft