6/20/2025 9:35:43 AM
|
|
slxdeveloper.com Community Forums |
|
|
|
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!
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
|
|
|
|
Dynamic Parameter to Crystal Report
Posted: 22 Sep 07 5:32 AM
|
Folks, Please suggest me how to proceed to resolve the below issue.
Issue is : Sales Logix user id to be passed to Crystal report to filter out record contents. In crystal I have set a parameter to receive SLX User id, question is how to implement this in sales logix. According to the parameter setup in crystal, slx is launching Parameter screen but I need to load one of the listbox based on the sales logix logged in userid. eg. When manager logged in his subordinate names should be loaded in the listbox, how can we achieve this.
Anybody can show light on this..I really appreciate your help.
Thanks Babu Gopal. |
|
|
|
Re: Dynamic Parameter to Crystal Report
Posted: 27 Sep 07 8:00 AM
|
I wrote this up a while ago using legacy scripts, but this will work with active scripts as well (you would have to add Application.BasicFunctions. before the Global, invoke and ReportAddCondition functions). Basically, this involves a script to define a global variable containing the value you want to pass as well as launching the report, and a script attached to the report which adds the condition. The parameter in the report isn't needed using this process.
There are two Scripts involved: one to set a global variable for the record to report on, and one to get that global and assign it to a report.
This first script happens to be setting the global to an opportunityid. You’d need to somehow get the ID for the Record you were looking at.
The variable containing that record ID would replace ‘CurrentOpportunityID’ below. Also, the invoke function would need to be modified in order to reflect the family and name of the report you were using.
sub main GlobalInfoSet "gOppID", CurrentOpportunityID Invoke "CrystalReportPreview", "Opportunity:zOpp Detail Status Report" end sub
The second script would be attached to the WhenOpen Event of the report. That event is available from the ‘Execution’ Tab of the Crystal Report properties in the Manage Crystal Reports area of Architect.
First, the script looks to see if the global variable exists. This is in case the report is run via the standard report functionality, so it doesn’t restrict records unnecessarily. Next, it assigns the Global Variable (gOppID) to a string Variable (sOppID). The ReportAddCondition function is then called to set the recordID for the report. Finally, the global variable is cleared.
sub main Dim sOppID If GlobalInfoExists("gOppID") Then GlobalInfoFor "gOppID", sOppID ReportAddCondition "OPPORTUNITY:OPPORTUNITYID", "=", "'" & sOppID & "'", "String", "" GlobalInfoClear "gOppID" End If end sub
Let me know if you have any questions.
-Jason |
|
|
|
Re: Dynamic Parameter to Crystal Report
Posted: 28 Sep 07 12:56 AM
|
Just to clarify:
- The Parameter itself isn't needed because the condition is added to the Report Condition. - If you had planned on displaying the Parameter on the Report, then this method doesn't quite work, but still the best way to pass conditions to the report. - If you have other Conditions set on the Report's condition, you may see some issues. There are cases where extra empty lines cause problems. - Of course, the condition is being applied as an SQL value, so if you were planning to use the Parameber for other purposes (e.g. to dynamically hide a section based on a given value passed from SLX) you may have to look for alternatives. |
|
|
|
Re: Dynamic Parameter to Crystal Report
Posted: 28 Sep 07 11:52 AM
|
Moved thread from Announcements forum to an more appropriate forum, SalesLogix Scripting and VBScript.
Ryan Farley slxdeveloper.com |
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|