The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
| |
| |
|
Re: passing parameters to crystal reports
Posted: 20 Feb 08 4:55 PM
|
After much testing and frustration it seems that when the report is run from the "Reports" window that the 'When Open' script doesn't run. I tried using the method described in the article and things are fine if I lauch the report from a button, but when I run the report from the "Reports" window the script doesn't appear to run. I put a msgbox popup in the script and I don't see it when I run from the "Reports" window. |
|
|
|
Re: passing parameters to crystal reports
Posted: 12 Mar 08 11:45 AM
|
What is t hat you want to do when the cr is opened?
You can always use app.bf.getcrystalreport and then assign that rpt object to a CRviewers datasource. But if slx security is involved , then you have to control the data with appropriate recselectionformulas i think. And this is what those slx report mv does. depending on who is logged on.
My point is if you script it out this way you can control the execution of script and do what needs to be done before calling the reports....
not sure if i am of any help here...but this is what i would try |
|
|
|
Re: passing parameters to crystal reports
Posted: 05 May 08 10:18 AM
|
I followed your instructions, but I have a problem. I have a where clause that I created using the "Select Expert" in Crystal. I had to create this where close becase I have a lot of records. My problem is: when I hard coded a value in the where clause, crystal ignores the condition from saleslogix, and use the hard coded value. when I create a variable and assign to the where clause, it takes the condition from saleslogix, but ask me for the value of the variable anyway, even though, it ignores it in the report. I need my report to take the condition from saleslogix and not ask the user for a value. Can anyone help?
thank you |
|
|
| |
| |
|
Re: passing parameters to crystal reports
Posted: 30 May 08 12:16 PM
|
Honestly....do not know.
But i know that 72 uses cr 11 for reporting. So get the components and open that in a object viewer and then look for yurselves if there is a methd like that. If not , search CR site for these as these are defnitely not slx methods.
Also a 2 min google search got me this code(i think this is in 11) , So yes , that should work!
' Typical Variable Declarations dim crApp as New CRAXDRT.Application dim crRept as New CRAXDRT.Report dim crParamDefs as CRAXDRT.ParameterFieldDefinitions dim crParamDef as CRAXDRT.ParameterFieldDefiniton dim crDBTab as CRAXDRT.DatabaseTable
' Open Report File set crRept = crApp.OpenReport("WHATEVER.RPT")
' Disable Parameter Prompting for the end user crRep.EnableParameterPrompting = FALSE
' Gather the list of available parameters from the report set crParamDefs = crRep.ParameterFields
' Loop through all parameters in the report by name, filling in the
appropriate parameter with the right value foreach crParamDef in crParamDefs select case crParamDef.ParameterFieldName case "SubTitle" crParamDef.SetCurrentValue "My Report Subtitle Goes Here" case "@BeginDate" crParamDef.SetCurrentValue datevalue(txtBeginDate) case "@EndDate" crParamDef.SetCurrentValue datevalue(txtEndDate) case "@IntegerParam" crParamDef.SetCurrentValue val(int(txtIntegerParam)) end select next
crViewer1.ReportSource = crRept crViewer1.viewReport
|
|
|
|