Link to home
Start Free TrialLog in
Avatar of xskydivex
xskydivex

asked on

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

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.
ASKER CERTIFIED SOLUTION
Avatar of matthewrhoades
matthewrhoades

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mike McCracken
Mike McCracken

What code are you using to call the report?

Are you intercepting the NEXT PAGE click?

mlmcc
Avatar of xskydivex

ASKER

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
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.
I have never seen that or even heard about it.

Does this happen on all reports?

mlmcc
What parameters is it prompting for?  
I have never seen that or even heard about it.

Does this happen on all reports?

mlmcc

----
Yes
matthewrhoades:
What parameters is it prompting for?  
----
All of them.
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?
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.