Last post Jan 10, 2011 09:11 AM by ranjan_suvidhaa
Jul 13, 2007 03:22 AM|grifoxx|LINK
Hi I have created a web app which displays some reports. My problem is when click on the next page button that comes with the crystal report viewer control. It works fine until it get to page number 2, after that it does not update my report and it has
more than 2 pages.
Does any body have a suggestion?
Thanks a lot?
Jul 17, 2007 12:09 PM|dsteinweg|LINK
I am having this exact problem as well. Anyone have any answers?
Jul 17, 2007 12:14 PM|pontupo|LINK
I haven't seen this particular issue before, but could it perhaps have something to do with Session persistence? Are you two using sessions to persist the report object across page load? Would be something like this:
If (Session(sessionString) Is Nothing) Then
pipelineFullYear = New ReportDocument()
'code for all your initial setup here
Session(sessionString) = pipelineFullYear
pipelineFullYear = CType(Session(sessionString), ReportDocument)
This would be wrapped around your normal code in either your Page_init function or whatever function you are calling from page_init. Not sureif this is really related, but a thought anyway....
Jul 17, 2007 12:26 PM|dsteinweg|LINK
Nope, don't have anything like that in any page loading functions. I wouldn't rule out session persistence as a possible cause, though.
Interestingly enough, when you're on page 2 and hitting the arrow does nothing, you can type "3" in the text box, hit enter, and you can successfully navigate to page 3, 4, and so on. It's like the arrow decides to stop working, but the pages are still
there and available.
Thanks for your reply, Pontupo. Got any other ideas? [:)]
Jul 18, 2007 03:35 PM|pontupo|LINK
Check this post from today, sounds like the same deal with a further suggestion: http://forums.asp.net/t/1134906.aspx
Jul 20, 2007 02:55 PM|dsteinweg|LINK
Thanks for the reference Pont, but unfortunately, all of my stuff already was in the OnInit function, not the page_load function. Also, I don't check for PostBacks at all.
But it's good to see others are having the problem; a solution must exist out there!
Jul 21, 2007 02:25 AM|krisamigo|LINK
well i have the same problem and i tried as copying the code from Page_Load to
OnInit funtion then navigation working properly let u try once this
but we have one problem with this we can navigate all the pages by hitting the next button on the page navigation but when the report loads at first time it wont display the total number of pages in the report once we hit the last button and
if we hit the first button then onwards it shows total number of pages
if u found solution for this plz let me know also
Jul 23, 2007 09:39 AM|dsteinweg|LINK
Unfortunately, all my code is already in the OnInit function. I'm doing nothing in Page_Load, but it still doesn't work.
With your problem of not seeing the total number of pages, I suspect that is just a quirky Crystal thing. In my experience, even when you run a report inside the Crystal report designer, you still won't see how many pages are in the report until you actually
reach the last page. I can see how this could be annoying for certain reports, but I don't know if there's anything you can do about it.
Oh, and Pont, I did end up saving our ReportDocument into the session. So if the document exists in there, it will pull from the session state -- if it doesn't, it will save it to the session state. This didn't really change anything, though, about how
the report acts inside the viewer. The arrow navigation problems are still there. A co-worker of mine is looking into using the ActiveX viewer, but we would still rather use the DHTML viewer if possible (and if we can get the arrows to function properly)!
Jul 23, 2007 11:37 AM|pontupo|LINK
Krisamigo: as stated above, I think this is just the way Crystal is. A bit odd, I'll admit, but that is pretty much just the way it works. You certainly have access to how many pages there are at runtime so if you're really concerned about it, you could
- 1) place the total number of pages in the report by, for instance, placing a page number at the bottom of the form <current page> of <total pages>. Shouldn't be too hard =) or 2) Maybe there's a way to set that "total pages" property of the viewer. Poke
around and see if you can find a way to set that. Then you can get the total pages from the report document and set the viewer to reflect that. It's a bit stupid that it works this way... especially when I know that it has access to the total number of pages
dsteinweg: Your problem is really weird =) I can't think of anything that would be doing that other than some random setting that is getting in your way. It's possible, for instance, to export only certain page ranges, so maybe you accidentally set that
somewhere? Though there are some great folks on these forums, if you haven't already, try cross-posting on these forums:
http://www.tek-tips.com/threadminder.cfm?pid=768&page=1 When I've failed to get an answer to a problem here at asp.net, I often ask over there. They may have some ideas =)
Jul 23, 2007 12:02 PM|dsteinweg|LINK
Ah yes... I have used Tek Tips before, but I don't think I have looked there for this particular problem. I'll poke around.
Jan 10, 2011 09:11 AM|Ranjan_Suvidhaa|LINK
It is very simple , Just Put Your Crystal Report into Updatepanel and when you want to call the crystal Report on a button click , just Update this UpdatePanel .
it will work fine .