Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, November 25, 2024 
 
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: CrystalReportPreview
JJE
Posts: 20
 
CrystalReportPreviewYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Oct 08 12:17 PM
Hi All,

I'm currently working on SLX 7.2.2. and I have a problem with my crystal reports:
I use to call reports with the following command behind a button:
Application.BasicFunctions.DoInvoke "CrystalReportPreview", sReport

I put the ID of the report maintable in a global variable and on the report opening script (in Manage report properties) I add the following condition:
Application.BasicFunctions.ReportAddCondition "TABLE:TABLEID", " = ", ID, "String", ""
I worked well in SLX 6 but since I'm on SLX 7 it works only once.

I put a 'stop' in the onopenreport script just after the add condition line. It stopped the first time I call the report, the report works well, then I close it and click on the report button one more time. It never goes on my stop...and the report never fired...

Do you know what the problem could be?
[Reply][Quote]
Khevna Mehta
Posts: 34
 
Re: CrystalReportPreviewYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Oct 08 3:49 PM
Have you tried using Application.BasicFunctions.GetCrystalReport ? You can also pass parameters using object.ParameterFields.Item(1).SetCurrentvalue

[Reply][Quote]
Kris Halsrud
Posts: 88
 
Re: CrystalReportPreviewYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Oct 08 9:39 AM
Maybe also try to add the reportclearconditions to your script to ensure the previous condition is not retained? Alternativly you can use the Crystal RDC to directly set conditions in the report rather than using the exposed SLX APIs
[Reply][Quote]
JJE
Posts: 20
 
Re: CrystalReportPreviewYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Oct 08 12:00 PM
Hi,

Thank for your clues, but can't make it work. So I interested myself in what was done in SLX Report Manager.
And here is what I've done:

I've changed my launch script like this (Example for Contact):
Dim oCR
Dim oCond
Dim oConds
Dim oMV

'id = Application.BasicFunctions.CurrentContactID

'Application.GlobalInfo.Add "g_ContactID", id
'Application.BasicFunctions.DoInvoke "CrystalReportPreview", "Contact:Contact Detail"

GlobalReportController.Init

Set oCR = GlobalReportController.CrystalReport
oCR.Family = "Contact"
oCR.Name = "Contact Detail"
oCR.PluginID = ""
oCR.Reload

Set oCond = New SLXReportCondition
oCond.Table = "CONTACT"
oCond.Field = "CONTACTID"
oCond.Value = Application.BasicFunctions.CurrentContactID

Set oConds = oCR.ReportConditions()
oConds.Add oCond

oCR.ReportConditions = oConds

Set oMV = Application.MainViews.Add("System:SLX Loading Dialog", 0, False)
oMV.DetailsView.Script.Init GlobalReportController.CrystalReport.Name
oMV.Caption = "Loading..."
oMV.Show

GlobalReportController.ExportReportTo "Preview", ""

oMV.Hide

Set oCond = Nothing
Set oConds = Nothing
Set oCR = Nothing
Set oMV = Nothing

You'll need to include the two following scripts:
SLX Report Condition
SLX Report Controller

And finally I've removed the OnOpenReportScript and OnCloseReportScript on the Manage Report Properties.

It works pretty well, now I'll have to try it with more than one condition.

I've also Add the following to the SLX Crystal report Script (Line 432) on the Condition.Operator Case Else.
If Not IsNumeric(aCondition.Value) Then
strValue = "'" & aCondition.Value & "'"
Else
strValue = aCondition.Value
End If

To avoid going in the Case Else code you can also change the default operator from
mstrOperator = "=" 'Default
to
mstrOperator = " = " 'Default
in the SLXReportCondition (Class_Initialize) in the script SLX Report Conditions (Line 192)

I've also change the Global Script : Global Reports (Line 33) and remove an m in the strReportFammily var.

I hope this will help those in my case
[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 © 2024 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): 11/25/2024 1:01:37 AM