Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, June 20, 2025 
 
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!
 Architect Forums - SalesLogix Scripting & Customization
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.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Dynamic Parameter to Crystal Report
Babu G
Posts: 1
 
Dynamic Parameter to Crystal ReportYour last visit to this thread was on 1/1/1970 12:00:00 AM
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.
[Reply][Quote]
Jason Buss
Posts: 382
 
Re: Dynamic Parameter to Crystal ReportYour last visit to this thread was on 1/1/1970 12:00:00 AM
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
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Dynamic Parameter to Crystal ReportYour last visit to this thread was on 1/1/1970 12:00:00 AM
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.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Dynamic Parameter to Crystal ReportYour last visit to this thread was on 1/1/1970 12:00:00 AM
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
[Reply][Quote]
 Page 1 of 1 
  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!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 6/20/2025 3:11:59 PM