?
Solved

Embedded Crystal Report Viewer Pops Up Enter Parameter Values After User Clicks Next Page in Viewer

Posted on 2008-11-13
11
Medium Priority
?
907 Views
Last Modified: 2013-11-25
Crystal Report Viewer embedded in Visual Basic 6 always promps the user for parameters after user clicks on next page in the viewer at run time.
0
Comment
Question by:xskydivex
  • 6
  • 3
  • 2
11 Comments
 
LVL 6

Accepted Solution

by:
matthewrhoades earned 2000 total points
ID: 22954156
This could be a lot of different things.  If it is an issue that happens not when you load, but when you change records it sounds like there is something in the load event that supplies the initial variable, but is lost when the page changes.  

Check the form that calls the report viewer for the missing parameter and see how it is supplied when the form is loaded.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 22954625
What code are you using to call the report?

Are you intercepting the NEXT PAGE click?

mlmcc
0
 

Author Comment

by:xskydivex
ID: 22954859
Select Case gsReportName
Case "BBUP"
      'Set and pass the parameter field to the report.
        'Cycle through the ParameterFieldDefinitions collection for report
        Set Report1 = Nothing
        Set crpParamDefs = Report1.ParameterFields
   
   
    'Change the location of each DatabaseTable in the Reports DatabaseTable Collection
     
        For Each crxDatabaseTable In Report1.Database.Tables
            crxDatabaseTable.SetLogOnInfo "10.1.1.55", "master", "BC_Reports", "PondL@ke"
        Next crxDatabaseTable
       
        Report1.EnableParameterPrompting = False
        For Each crpParamDef In crpParamDefs
            With crpParamDef
                Select Case .ParameterFieldName
                    Case "@ForeCast"
                         gsForecastPeriod = Me.CboPeriod.Text
                        .SetCurrentValue gsForecastPeriod
                    Case "@DeptNo"
                         .SetCurrentValue gsDeptNo
                    Case "@CompanyID"
                        .SetCurrentValue glCurrCpnyID
                    Case "@CFiscYr"
                        .SetCurrentValue gsCurrCpnyNextBudgetYr
                    Case "@CBLedgerID"
                        .SetCurrentValue gsCurrCpnyNextBudgetLedgerID
                    Case "@PFiscYr"
                        .SetCurrentValue gsCurrCpnyCurrBudgetYr
                    Case "@PBLedgerID"
                        .SetCurrentValue gsCurrCpnyCurrBudgetLedgerID
                    Case "@PALedgerID"
                        .SetCurrentValue gsCurrCpnyCurrActBudgetLedgerID
                    Case "@F1LedgerID"
                    .SetCurrentValue gsCurrCpnyCurrProjForecast_1BudgetLedgerId
                    Case "@F2LedgerID"
                       .SetCurrentValue gsCurrCpnyCurrProjForecast_2BudgetLedgerId
                    Case "@F3LedgerID"
                      .SetCurrentValue gsCurrCpnyCurrProjForecast_3BudgetLedgerId
                    Case "@PPLedgerID"
                        .SetCurrentValue gsCurrCpnyCurrProjBudgetLedgerID
                End Select
            End With
        Next
     
        Report1.Database.Verify
        iRpt = 1
        Screen.MousePointer = vbHourglass
        frmRptPrev.CRViewer1.ReportSource = Report1
        'Enables the SCR Animation Control
        frmRptPrev.CRViewer1.EnableAnimationCtrl = True
        'Shows Report1
        frmRptPrev.CRViewer1.ViewReport
        Screen.MousePointer = vbDefault
        Unload Me
        frmRptPrev.Show 1
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:xskydivex
ID: 22954908
Are you intercepting the NEXT PAGE click?
------
I am not intercepting the NEXT PAGE click.  Click next the enter parameters box appears.  If I enter the parameters the report moves to page 2 from 1.

Now if I go to previous page(1) and then click on next.  The next page appears without prompting for parameters again.  

Then if I click on next page from 2 to go to 3 I am prompted again for parameters

and so on and so on till I get to the end of the report.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 22955200
I have never seen that or even heard about it.

Does this happen on all reports?

mlmcc
0
 
LVL 6

Expert Comment

by:matthewrhoades
ID: 22955218
What parameters is it prompting for?  
0
 

Author Comment

by:xskydivex
ID: 22955418
I have never seen that or even heard about it.

Does this happen on all reports?

mlmcc

----
Yes
0
 

Author Comment

by:xskydivex
ID: 22955422
matthewrhoades:
What parameters is it prompting for?  
----
All of them.
0
 
LVL 6

Expert Comment

by:matthewrhoades
ID: 22955448
If it is prompting for all of the field values on the report than you have an issue with your data source connection.

1.  Are there multiple records?
2.  What event is the above code being run under?  Is that a report load event or a current event of some sort?
0
 

Author Comment

by:xskydivex
ID: 22955466
matthewrhoades:If it is prompting for all of the field values on the report than you have an issue with your data source connection.

1.  Are there multiple records?
2.  What event is the above code being run under?  Is that a report load event or a current event of some sort?
--------

1.  Yes there are mult. records.
2.  Command Button Click Event.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question