Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
|
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 11th, 2003, 03:32 PM
Registered User
 
Join Date: Jun 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default CrystalReportViewer paging problem

I've created a product tracking system using ASP.NET that generates reports using the .NET CrystalReportViewer to display reports. When a multi-page report is generated, I click the "next page button", and I'm taken to the second page.

The problem is that's as far as it will go. No matter how many pages are in the report, the viewer won't go past page two. If I click the "last page" button, it takes me to the last page, but if I click the "previous page" button, the viewer takes me back to page two.

I can enter a page number in the "Go to" box, and that will take me to the correct page, but the paging buttons won't go past page two.

I have a custom routine written to export the report to a PDF format which allows proper paging, but that annoys the end-users.

Has anyone encountered this issue before? Any input would be appreciated.
 
Old June 25th, 2003, 06:34 AM
Authorized User
 
Join Date: Jun 2003
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi AVeldkamp!

I have also used CRViewer to create reports in .NET but I'm NOT getting any kind of paging error. I can surf thru the pages of my report without any problem....just check the properties of CRViewer to see if u r missing out something...I never encountered such an error

Cheers
Debsoft

cheers,
debsoft
 
Old June 25th, 2003, 09:57 AM
Registered User
 
Join Date: Jun 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi AVeldkamp,

I am having the same problem.
Don't know if you have solved your problem or not, but here is my situation, any help would be appreciated.
The reports are created by Crystal Reports 8.5.
Going against a sql server 2000 database.

Then loaded using the following code:

        Dim reportDocument As New ReportDocument()
        Dim parameterfields As New ParameterFields()
        reportDocument.Load(report.FilePath + report.FileName)

        Dim crLogonInfo As CrystalDecisions.Shared.TableLogOnInfo
        crLogonInfo = reportDocument.Database.Tables(0).LogOnInfo
        With crLogonInfo
            .ConnectionInfo.ServerName = ConfigurationSettings.AppSettings("CrystalReportSe rverName")
            .ConnectionInfo.UserID = ConfigurationSettings.AppSettings("CrystalReportUs erID")
            .ConnectionInfo.Password = ConfigurationSettings.AppSettings("CrystalReportPa ssword")
            .ConnectionInfo.DatabaseName = ConfigurationSettings.AppSettings("CrystalReportDa tabaseName")
        End With
        reportDocument.Database.Tables(0).ApplyLogOnInfo(c rLogonInfo)

        crystalReportParameterPanel.GetValues(reportDocume nt, parameterfields)

        crystalReportViewer.ParameterFieldInfo = parameterfields
        crystalReportViewer.ReportSource = reportDocument
        crystalReportViewer.DataBind()
        crystalReportViewer.Visible = True

Thanks
jsullivan
 
Old June 25th, 2003, 11:19 AM
Registered User
 
Join Date: Jun 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm really confused by all this. I've written numerous reports in Crystal 8.5 and have never seen anything like all the code below. I use Crystal to connect to the database (it doesn't matter what one, just use the correct ODBC driver). The finished report is uploaded to a Crystal Enterprise 8.5 server where the users log in and run whatever report is needed. What are you doing that you need all the manual connection and login information?



Check out http://www.ASPGuru.US
 
Old June 25th, 2003, 01:55 PM
Registered User
 
Join Date: Jun 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I forgot to mention that this is using the Crystal Report Viewer in a ASP.Net application.
The reports are just sitting in a directory under the website and not added into the project.
The idea being we could just put new reports out in the web folder and not have to recompile the application.
Also use the sql server driver thus the connection information.
We do have Crystal Enterprise 8.5, but are not using it.
 
Old July 24th, 2003, 11:56 PM
Registered User
 
Join Date: Jul 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

the problem is caused by the parameterField.

for some reasons, when you set the parameter, it will reset the currenct page no. to 1, so it will load page 2 again and again everytime you click on "Next" button.

To solve this problem, set the parameter when the page is not posted back.

            If Not (IsPostBack)
                discreteVal.Value = myvalue
            paramField.ParameterFieldName = "MyParam"
            paramField.CurrentValues.Add(discreteVal)
            paramFields.Add(paramField)
            CrystalReportViewer1.ParameterFieldInfo = paramFields
        End If

Hope this is helpful

 
Old July 25th, 2003, 08:30 AM
Registered User
 
Join Date: Jun 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you kevin77! You da man!
 
Old August 13th, 2003, 11:49 AM
Registered User
 
Join Date: Aug 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I was having the same problem. I was also able to solve it by moving the code where I set parameters into a "if not ispostback" chunk, but now I have a new problem.

When I try to print, I get the error "missing parameter values".

My guess is that printing is for some reason NOT a postback but goes through as a "first time post".

So, does anyone have any ideas how to fix this circuitous problem? If I put the parameters so they set on every postback the printing works, but I can't get to page three. If I set the parameters to only set if it's a postback then the paging works properly but the printing breaks.

Thanks in advance -- Mike
 
Old October 14th, 2003, 01:21 PM
Registered User
 
Join Date: Oct 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Are you using Crystal Report or Crystal Report Application Server (RAS)?

I had this error when I was using RAS, I has a sub-report in main report. I think I was getting this error when printing/exporting the report.

Akhtar

 
Old July 13th, 2004, 06:35 AM
Registered User
 
Join Date: Jul 2004
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
Default

AVeldkamp,

I have solved it :) I was getting the same problem.

Move all crystal reporting code from page_load to page_init. It should go through the records then.

Bubmachine

The Following User Says Thank You to bubmachine For This Useful Post:
DBConner (March 4th, 2011)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Paging in CrystalReportViewer rakeshvc Crystal Reports 1 May 19th, 2014 06:18 AM
CrystalReportViewer : page size problem kriangsak Crystal Reports 0 December 20th, 2005 02:52 AM
crystalreportviewer and paging vinki General .NET 0 December 10th, 2004 08:33 PM
crystalreportviewer and paging vinki Crystal Reports 0 December 10th, 2004 08:32 PM
CrystalReportViewer more than one printing problem rajatgupta Crystal Reports 0 September 27th, 2004 09:35 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.