cancel
Showing results for 
Search instead for 
Did you mean: 

Parameter prompt shows after report is loaded

Former Member
0 Kudos

Greetings,

I am testing CR XI R2 to be used with our current Visual FoxPro 8.0 environment application.

I am able to view the reports and pass parameters to the report with no problem, but the Parameter Prompt continues to show after the report has loaded up.

So the reports loads and is viewable, then immediately after it loads up, the Parameter Prompt shows up. I am not sure how this continues to happen, could someone please help me. All this was working perfectly fine under Crystal Reports 10 but in testing the runtime for CR 11 R2, the prompt continues to show after the report is loaded. I am attaching as much relevant code as possible, in hopes someone can help me pin point this weirdness.

Thanks in advance,

Albert

This is my _SetupReport() method

=======================================

    • Define variables

LOCAL oCRApplication AS CRAXDRT.Application

LOCAL oCRReport AS CRAXDRT.Report

WITH This

    • Instantiate the Crystal application object to the class's property

oCRApplication = CREATEOBJECT("CrystalRuntime.Application")

oCRReport = oCRApplication.OpenReport(._oParams.cReportPath)

oCRReport.DiscardSavedData()

    • Set up the report's database data

._SetupReportData(oCRReport)

    • Set up the report's parameters

._SetupParameters(oCRReport)

    • Assign the report to the control

.oleCrystalViewer.ReportSource = oCRReport

    • Turn on the flag to indicate that the class is set up

._lSetup = TRUE

ENDWITH

=======================================

This is my _SetupParameters() Method

=======================================

LPARAMETERS oCRReport AS CRAXDRT.Report

LOCAL aParameters[1] AS Variant

LOCAL cParamName AS String

LOCAL lFound AS Boolean

LOCAL nParam AS Integer

LOCAL nValueType AS Integer

LOCAL oErr AS Exception

LOCAL oParameter AS CRAXDRT.ParameterFieldDefinition

LOCAL oParamsCollection AS CRAXDRT.ParameterFieldDefinitions

LOCAL vDefaultValue AS Variant

LOCAL vParamValue AS Variant

WITH This

    • Copy the parameters array off the param transport object to

    • a local array

ACOPY(._oParams.aryParams, aParameters)

    • Get a reference to the parameter collection off the report

oParamsCollection = oCRReport.ParameterFields()

    • Loop once for each parameter

FOR nParam = 1 TO ALEN(aParameters, 1)

    • Turn on the found flag

lFound = .T.

    • Get the param name and value from the array

cParamName = aParameters(nParam, 1)

vParamValue = aParameters[nParam, 2]

TRY

    • Try to get the parameter

oParameter = oParamsCollection.GetItemByName(cParamName)

CATCH TO oErr

    • If here, the parameter was not found

lFound = .F.

ENDTRY

    • If the parameter was found...

IF lFound

    • Determine the param's data type and its default value

nValueType = oParameter.ValueType

vDefaultValue = oParameter.DefaultValue

    • If the parameter is a logical True...

IF VARTYPE(vParamValue) = 'L' AND vParamValue

    • Reset the parameter to its default value

oParameter.SetCurrentValue(vDefaultValue)

ELSE

    • Set the parameter to the array's value

oParameter.SetCurrentValue(vParamValue)

ENDIF

ENDIF

ENDFOR

ENDWITH

RETURN

=======================================

This is my ShowReport() method

=======================================

LPARAMETERS oParams AS Object

WITH This

    • If a parameter was passed in...

IF PCOUNT() > 0

    • If the parameter is an object...

IF TYPE('oParams') = 'O' AND NOT ISNULL(oParams)

    • Store the parameter to the class's property

._oParams = oParams

    • Call the routine to set up the report

._SetupReport()

WITH .oleCrystalViewer

    • Display the report

.ViewReport()

    • Pause to allow the report to finish getting data

DO WHILE .IsBusy

**DOEVENTS

oEnvision.oCommon.ProcessEvents()

ENDDO

.Visible = TRUE

ENDWITH

ELSE

ERROR 11 && Function argument value, type, or count is invalid

ENDIF

ELSE

ERROR 1229 && VFP - Reports

ENDIF

ENDWITH

=======================================

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member183750
Active Contributor
0 Kudos

I suppose the fist place to start will be with the latest Service Pack. That can be downloaded from here;

https://smpdl.sap-ag.de/~sapidp/012002523100006255422008E/crxir2_sp4_inc.exe

Next, I have to point out that VF is not on the supported platforms list. Meaning:

1) I do not have and thus can note test the issue in VF.

2) When the RDC was fully supported, if I could reproduce the issue on a supported platform, I could submit the issue for a fix.

Also, the RDC has been retired in CR 2008 and patch support has terminated (e.g.; no fixes accepted by R&D).

Anyhow, given all of the above, try the SP. Let me know if that does not help, and we'll see what we can do from there.

Ludek

Former Member
0 Kudos

Thanks Ludek,

I need to install CR XI R2 SP2 and SP3 before I can install SP4 from the link you sent me. I will let you know how it turns out.

-- Albert

former_member183750
Active Contributor
Former Member
0 Kudos

Ludek,

Is there a Service Pack 1 as well, I do not see it in the business objects downloads under service packs for CR XI R2, apparently I need this SP before I install Service Pack 2.

Sorry for the inconvenience.

Thanks for your help.

Albert

former_member183750
Active Contributor
0 Kudos

Not a problem. Try this link:

http://resources.businessobjects.com/support/communitycs/FilesAndUpdates/boXIR2win_sp1.zip?recDnlReq...

On the other hand, it may not be a bad idea to just download the full CR XI r2 from here:

https://smpdl.sap-ag.de/~sapidp/012002523100006008462008E/crxir2.zip

Install it, throw SP 4 on it (I believe the SP 3 is part of the SP 4) and you're done.

If you'll go down this path, uninstall what you have now, download the CR XI r2, install that (make sure you have the keycode saved - if not I can show you where to find it), apply SP 4 and you're as current as it gets.

Ludek

Former Member
0 Kudos

Ludek,

I tried installing service pack 2/3/4 and it did not want to install. I only have the runtime available on this test box, so I am going to try the SP3/SP4 merge modules install.

Thanks,

Albert

Former Member
0 Kudos

Ludek,

I continue to have the same issue as before, none of the service pack updates have resolved the issue.

As a test, I put the oCRReport.EnableParameterPrompt = False, now I know this will suppress parameters from being passed to the report.

Even when I did this, I did notice that the report stored procedure is being called twice.

This is from the SQL Profiler:

=========================================================

exec glBatchNumbersRP;1 'ENG', '20080101', '20080925 11:59:59 pm', 0

go

exec glBatchNumbersRP;1 NULL, NULL, NULL, NULL

go

=========================================================

The first call has the parameters, even though the EnableParameterPrompt = FALSE, and it displays the reports, then a split second afterwards, the report runs again with empty parameters and displays a blank report.

Let me know if this is proper behavior. I do not have anything checked in the reports that would cause the report to refresh or verify on load.

Albert

former_member183750
Active Contributor
0 Kudos

Wait, wait. I want to return to your previous post where you say:

"I tried installing service pack 2/3/4 and it did not want to install. I only have the runtime available on this test box, so I am going to try the SP3/SP4 merge modules install."

For me, the first thing to do is to make sure the app works on the development computer. That is why the Service packs. SPs are designed to not install on runtime machines. SPs can only be applied to computers that have CR installed...

So, the obvious question; does the app work on the development computer? Let's get it working there, with the SPs, then move on to runtime boxes.

Ludek

Former Member
0 Kudos

Ludek,

Sorry, the forum website has been down for quite some time. The app works in the test machine with the SP4 CR XI R2 runtime. I am now able to trace through fox code now to see where the report somehow calls the parameter prompt again. My question is would a "refresh()" of the CRViewer object cause the report to show the parameter prompt?

If so, what could I do to ensure, that the report object does not display the parameter prompt?

Thanks,

Albert

former_member183750
Active Contributor
0 Kudos

It should not. We actually normally have the opposite issue. E.g.; how to refresh the parameter, once it is set? In that case we have to force a clear of the current parameters, then set them and refresh:

Report.ParameterFields(1).Clearer

' Pass a new parameter value

Report.ParameterFields(1).Adducer "New Value"

'Refresh the report

Reviewer False

Ludek

Former Member
0 Kudos

Greetings Ludek,

Ok, I created brand new forms within Foxpro that have the Crystal REports Viewer 11.5 ActiveX object on them. When I hard code report parameters to be passed to the report, I do not get the parameter prompt. However, when I dynamically pass parameters, I get the prompt. What confuses me, is that the same code it used in both cases, to pass parameters to the report. I am going to try your code changes next, hopefully.

Albert

Former Member
0 Kudos

Could something like setting

Application.Interactive = False

help? That is from VBA, I don't know which is the correct form for your SDK

former_member183750
Active Contributor
0 Kudos

Alexey, please create a new post specifying as many details of your issue as possible - including version of CR and Service pack level...

Ludek

Former Member
0 Kudos

I'm sorry, Ludek, but you misunderstood. I made a suggestion which could give Albert an idea about what to look for. I'm nowhere near a pro in BO or FoxPro, so I'm not sure if he didn't try. Just a suggestion.

former_member183750
Active Contributor
0 Kudos

oops. apologies

Ludek

Former Member
0 Kudos

Let's forget it and delete the four offtopic messages?

Former Member
0 Kudos

Greetings,

I apologize for not being able to respond as I had to work on some other issues up until today.

Unfortunately, I do not have a Interactive property which I can set in foxpro.

So here is the issue as it stands now. In the code I have provided below, there are 2 instances in which the parameter prompt shows up. The first occurs right after the OpenReport() method and the other occurs after the ViewReport() method. Now I can see in my code that my parameters are being passed into the report as I can see the SQLQueryString get updated with the values and the 2nd time the parameter prompt comes up, it has all the values I passed to it. I am not sure what can cause this, especially when since it takes place right after the oCRReport object is instantiated.

Please feel free to share your thoughts on this issue.

I am also using the latest CRXI R2 SP4 RDC merge module install for this testing.

Thank you for your time.

Albert

======================================================

    • Define variables

LOCAL oCRApplication AS CRAXDRT.Application

LOCAL oCRReport AS CRAXDRT.Report

SET STEP ON

WITH This

    • Instantiate the Crystal application object to the class's property

oCRApplication = CREATEOBJECT("CrystalRuntime.Application")

oCRReport = oCRApplication.OpenReport(._oParams.cReportPath)

    • Parameter Prompt shows up

    • Set up the report's data

._SetupReportData(oCRReport)

IF oCRReport.HasSavedData

oCRReport.DiscardSavedData()

ENDIF

    • Set up the report's parameters

._SetupParameters(oCRReport)

    • Assign the report to the control

.oleCrystalViewer.ReportSource = oCRReport

.oleCrystalViewer.ViewReport()

.oleCrystalViewer.Visible = .T.

    • after ViewReport() - Parameter Prompt shows up again

    • Turn on the flag to indicate that the class is set up

._lSetup = .T.

ENDWITH

==========================================================================