11/25/2024 7:38:51 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 reports for SalesLogix including Crystal, SQL Reports, etc. View the code of conduct for posting guidelines.
|
|
|
|
Passing info to Crystal Reports
Posted: 25 Nov 08 5:36 AM
|
I am really sorry as I am sure this has been answered elsewhere, but I have searched for an hour without finding anything.
Ok, so I am following the instructions at http://www.slxdeveloper.com/page.aspx?action=viewarticle&articleid=100 but I am stuck at the 2nd part, WhenOpened Script.
I am in Architect, I have clicked Manage, Reports. right-clicking on the report there is no Properties option (the guide says "accessible by selecting Properties with a right-click from Manage Reports in Architect").
I am using SLX v7.2 and Crystal Reports 11.5 - is it that there are differences from the guide and these versions?
Any help would be appreciated. |
|
|
|
Re: Passing info to Crystal Reports
Posted: 30 Nov 08 6:29 AM
|
Ok, I have been messing around for a while and getting nowhere, so I appologise for bumping this thread but I really need help!
I have tried placing the WhenOpened Script in the "Filter Conditions" on the Execution tab of the Report Properties, but I am getting no further forward.
I appreciate this is probably a simple question and people may think I should figure itout for myself, but I'm well and truely stuck!!
Please, any help? |
|
|
|
Re: Passing info to Crystal Reports
Posted: 01 Dec 08 3:17 PM
|
Make sure you set the table name as the main table on the filter options where your field you are using as a filter is sitting.
On the filter script get your global variable which you should of set when calling the report and add the condition to the report (in the case below a record based on ID)
strFilterID = Application.GlobalInfo.Item("gstrFilterID") Application.BasicFunctions.ReportAddCondition "MAINTABLE:MAINTABLEID","=", strFilterID , "String", ""
Application.GlobalInfo.Delete "gstrinvoiceid" |
|
|
|
Re: Passing info to Crystal Reports
Posted: 02 Dec 08 2:39 AM
|
Leon,
Thanks for the help, this is what I have so I am clear:
On the Report Properties, I have the following: Report Family: Account Main Table: AccountProduct Master User Field: Accountproductid
On the form I am using I have a button which when clicked runs the script: Sub Asset_cmdPrintClick(Sender)
Application.GlobalInfo.Add "cr_asid", Hidden_Edit_01.Text Application.BasicFunctions.DoInvoke "CrystalReportPreview", "Account:Spec Sheet - PC"
End Sub
Hidden_Edit_01.Text contains the AccountProductID for this product.
The report opens, but it shows all products from all accounts. I can see that I am missing the 'ReportAddCondition' line, but don't know where to put this, as the guide says to have a 'WhenOpened' script, but I can't see when this would run?
Where am I meant to put this, and when does it run?? |
|
|
|
Re: Passing info to Crystal Reports
Posted: 02 Dec 08 5:46 PM
|
You need another script with the code in my previous post that you add to the "When Open" event on the Execution tab of your "Account:Spec Sheet - PC" report (double click on the report in architect and go to Execution tab)
In this script you grab the "cr_asid" from the global collection and use it with the ReportAddCondition.
I try to keep this script generic so you don't have a filter script for every report you want to add a condition to. |
|
|
|
Re: Passing info to Crystal Reports
Posted: 03 Dec 08 5:55 AM
|
Leon, thanks for all this, it really is helping.
I got to this point before, but coudn't figure it out: On the When Open selection I have selected "Active Script", but in the argument box the list appears fixed, how do I add my script to that list, and where do I put the script - on the existing form?
This may sound like a silly question, but this i s the first time I have done this, so I realy am working blind!
Thanks again for the help. |
|
|
|
Re: Passing info to Crystal Reports
Posted: 03 Dec 08 6:24 PM
|
Your filter script should appear in the drop down list in Argument under the family you saved it (e.g. Personal:C_CustomFilterScript) It sounds like you are in the right place so not sure what you are missing.
Just to confirm: - You have a form with button/menu that sets the globalID and calls the report - You have an Active script that gets the globalID and adds the report condition. This is run on the whenopen property on the report as per below Action: ActiveScript Argument: Personal:Personal:C_CustomFilterScript
That should be it. Other than that I could send you a bundle perhaps? Leon
|
|
|
|
Re: Passing info to Crystal Reports
Posted: 04 Dec 08 5:39 AM
|
Now I really feel like a doofus...
I have never made my own scripts; I have only worked with forms. I have now created a new script and put the code I had been putting all over the place into it, and guess what....
So I now have a working report and all I have to do is actually get the data I am really after onto it.
Thanks for your help, I would have been banging on for weeks without it, but Ifeel stupid for not thinking 'outside the box'.
Thanks again, Paul. |
|
|
|
Re: Passing info to Crystal Reports
Posted: 15 Dec 08 12:01 PM
|
Hi all,
I have been asked to trouble shoot a problem a report developer is having with a report in SLX.
Users will access this report from the standard reports selection screen. I want to list all Accounts "owned" by the current user. The current user is assigned to a 'Team' for example a team name is '154'. This team has a number of accounts linked to it. The link is the 'owner' of the account.
We are using the Region field of the USERINFO table to hold the description of the team the user is associated with.
I created a script file to get the description of the team from the USERINFO table. This script then is to send the value into the report as the SECCODEDESC value. The report has the SECCODE table linked in it.
This is meat of the script file. seccodedesc = GetField("REGION", "USERINFO", "userid = '" & application.BasicFunctions.CurrentUserID & "'") With Application.BasicFunctions .ReportClearConditions .ReportAddCondition "SECCODE.SECCODEDESC", "=", "'" & seccodedesc & "'" , "string", "" End With
In the report I set the main table to be SECCODE. Set the Master Userfield to SeccodeDesc and I set When Open to use my script file.
When the report runs, we get all accounts listed not just the one associated with the current user.
Can someone point the error in my ways?
Thanks in advance.
|
|
|
|
Re: Passing info to Crystal Reports
Posted: 15 Jan 09 12:30 PM
|
What if I just wanted to pass a "parameter" not a condition to Crystal from Slx. For example, a topic name or user name just to be printed in the report header or footer?
|
|
|
|
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!
|
|
|
|
|
|
|
|