Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 982
  • Last Modified:

Last Page Navigation problem with CR Viewer in ASP.NET 2.0

I have a Crystal Reports viewer on an ASP.NET 2.0 web page.  If the report is more than 1 page, the last page navigation button displays a blank report.  If I go through the pages with the next page button, it works fine.  After I have reached the last page with the next page button, the last page button works, too.  

It's as if the viewer cannot find the end of the report without paging through.

This same .rpt file works fine on a viewer in my ASP.NET 1.0 page.  I am upgrading my application to 2.0.  I have Crystal Reports 10.

Any help would be greatly appreciated.
0
barnesgj
Asked:
barnesgj
  • 5
  • 4
1 Solution
 
mlmccCommented:
What happens if you

Open the report
Click LAST PAGE
Click BACK ONE PAGE

mlmcc
0
 
barnesgjAuthor Commented:
The back page button is disabled.  
In fact all the page buttons are disabled because the report appears to be empty.
0
 
barnesgjAuthor Commented:
Am not sure if it matters, but I have had to change the way the reports are instantiated for 2.0.  

In my 1.0 code I instantiated each report.  
For example, if I had a report file named myReport.rpt, I would instantiate the object as
dim rptObj as new myReport
and Visual Studio 2003 would recognize them as class objects.

Visual Studio 2005 does not recognize my report files as class objects, so for 2.0, I am instantiating like this
dim rptObj as new ReportDocument
rptObj .Load(strRptFile)  'Where strRptFile is the path to the .rpt file.

Would that make a difference?  This seems to be the only difference that I can see between the two IDEs.

Thanks.
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
mlmccCommented:
I don't know.  I am not that familiar with the .Net arcchitecture.

One thing though.  I have seen in this forum where it was stated that Crystal had to be installed after VS for it to work correctly.  If you just installed VS 2005 you might want to uninstall CR then reinstall it to see if anything changes.

mlmcc
0
 
barnesgjAuthor Commented:
I uninstalled/reinstalled CR and downloaded and installed SP-4, but no luck.  The last page button is still displaying a blank report (unless I use the next page button to access the last page first).

Thanks for the suggestion.
0
 
barnesgjAuthor Commented:
Am still working this, and have finally been able to get the report to generate an actual error.  
'The rowset column could not be found.'
I'm still confused about why it works when I 'next page' through the report and not when I try to go the the 'last page' first.  I'll look at how I'm building the SQL for the report, but would still appreciate any clues about this.

Here's the stack trace:
[COMException (0x800002d2):
Error in File C:\DOCUME~1\GLORIA~1.BAR\LOCALS~1\Temp\rpt6RPage2ByHoursID {A3D0FB73-DD41-499A-A976-93E68D2F87AE}.rpt:
The rowset column could not be found.]
   CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.GetLastPageNumber(RequestContext pRequestContext) +0
   CrystalDecisions.ReportSource.EromReportSourceBase.GetLastPageNumber(ReportPageRequestContext reqContext) +242

[InternalException:
Error in File C:\DOCUME~1\GLORIA~1.BAR\LOCALS~1\Temp\rpt6RPage2ByHoursID {A3D0FB73-DD41-499A-A976-93E68D2F87AE}.rpt:
The rowset column could not be found.]
   CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e) +700
   CrystalDecisions.ReportSource.EromReportSourceBase.GetLastPageNumber(ReportPageRequestContext reqContext) +255
   CrystalDecisions.CrystalReports.Engine.FormatEngine.GetLastPageNumber(ReportPageRequestContext reqContext) +44
   CrystalDecisions.ReportSource.LocalReportSourceBase.GetLastPageNumber(ReportPageRequestContext reqContext) +201
   CrystalDecisions.Web.ReportAgent.get_LastPageNumber() +108
   CrystalDecisions.Web.ViewerToolbar.ShowLastPage() +13
   CrystalDecisions.Web.ViewerToolbar.OnNavigateInternal(CommandEventArgs e) +418
   CrystalDecisions.Web.ViewerToolbar.OnBubbleEvent(Object source, EventArgs e) +188
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
   System.Web.UI.WebControls.ImageButton.OnCommand(CommandEventArgs e) +86
   System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +173
   System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4882
0
 
mlmccCommented:
That doesn'tlook particularly like a Crystal error.  Not sure what is causing it.

mlmcc
0
 
barnesgjAuthor Commented:
Finally, I have isolated the source of my problem.  When the table's tableLogOnInfo and ConnectionInfo are set after the report's parameter values, I get the error.  The table values must be set first.  Am not sure why the report will allow me to single page through it, but this fixes it.

Thank you for your help and will award the points for effort.
0
 
mlmccCommented:
Interesting answer.  Not sure if I would have figured that out or not.

Glad to help

mlmcc
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now