Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameters and refresh
Message
General information
Forum:
Visual FoxPro
Category:
Crystal Reports
Miscellaneous
Thread ID:
00838351
Message ID:
00842726
Views:
14
>I have a report in which I've created a parameter, which is then used in the group header and the detail header to control whether shading is applied (users like to see it in previews; but don't like to use up their colored ink when printing). Data is supplied through OleDB from a VFP DBC.
>
>The parameter is a BooleanVar in Crystal terms, so the defaults appear automatically, range isn't allowed, etc.
>
>Using the ParameterFields collection, I'm setting the value of the parameter and the EnableParameterPrompting thusly (using the Report Object, not the activex control):
>
>loRpt.EnableParameterPrompting = .F.
>loRpt.ParameterFields.GetItemByName("llColor").AddCurrentValue(.F.)
>
>When viewing the report in the viewer, the report and detail tree show fine, no prompt, no color (without setting the CurrentValue to .F., the color shows). But, the report refreshes itself, and when it does so, the color shows. If EnableParameterPrompting is not set to .F., the parameter dialog will appear during this refresh (but not during the initial display).
>
>There is what seems to be a related bug, which is Patched by ID# 35370170; and this is included in SP2, which has been applied. No joy, however.
>
>Any ideas appreciated,
>
>Hank Fay

Hi Hank,

I created a small test, and saw this issue. My made some changes to my code, and got the auto-refresh to stop.
But I'm able to reproduce it still when thisform.refresh() or the object is refreshed from right-click menu or refresh button on toolbar
PUBLIC loC as CrystalRuntime.Application, ;
       loR AS CrystalRuntime.Report
LOCAL  loV AS CrViewer.CrViewer
#DEFINE loV

loC = CREATEOBJECT('CrystalRuntime.Application')
loR = loC.OpenReport('c:\people.rpt')
*- With this being false, Refresh Report to see issue
loR.EnableParameterPrompting = .F. 
*- Testing with Crystal Reports 8, doesn't have GetItemByName
loR.ParameterFields.Item(1).AddDefaultValue(.T.)
loR.ParameterFields.Item(1).AddDefaultValue(.F.)
loR.ParameterFields.Item(1).AddCurrentValue(.F.)

loCrystal = CREATEOBJECT('CrystalViewer')
*- Make the form visible, show will return Ole error
loCrystal.Visible = .T.
WITH loCrystal.oleCRViewer
*- Load the report
loV.ReportSource=loR
*- Makes form visible if it isn't already
loV.ViewReport()
ENDWITH
*- If loCrystal.Show() here, it refreshes report
*- Closing the form clears events
READ EVENTS 

DEFINE CLASS CrystalViewer AS Form

Left = 0
Height = 300
Top = 0 
Width = _Screen.ViewPortWidth - (SYSMETRIC(3) * 2)
WindowType = 1

ADD OBJECT oleCRViewer as OleControl WITH ;
    Left = 0, ;
    Height = 280, ;
    OLEClass = 'CrViewer.CrViewer', ;
    Top = 0, ;
    Width = _Screen.ViewPortWidth  - (SYSMETRIC(3) * 2)

ADD OBJECT chkEnableParameterPrompting AS CheckBox WITH ;
    AutoSize = .T., ;
    Caption = 'EnableParameterPrompting', ;
    ControlSource = 'loR.EnableParameterPrompting', ;
    Top = 282
    
PROCEDURE Destroy
   RELEASE loC, loR
   CLEAR EVENTS
ENDPROC

PROCEDURE RightClick
   *- Rightclick under the viewer on the right side of
   *- of the form to see report refresh
   This.Refresh()
ENDPROC
 
ENDDEFINE
Tracy
Previous
Reply
Map
View

Click here to load this message in the networking platform