Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, August 25, 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: problems with application.BasicFunctions.DoInvoke "CrystalReportPreview"
John Crumpton
Posts: 26
 
problems with application.BasicFunctions.DoInvoke "CrystalReportPreview"Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 09 Apr 07 5:52 PM
I need to run a report for only the current record and without using the Reports MainView...from a button, toolbar, etc..
My code is below. Basically, set two globals for field and value then launch the report using doinvoke. The report's when open script reads the globals and sets the filter; the When close clears the globals.
It works exactly as intended... the first time. After that, it does nothing at all (until I reopen SLX). When I close SLX, it get a runtime error.
I learned the hard way (working with Crystal in a .NET app) that it's a complete PITA to work with the Crystal objects...
I'm pretty sure that an object is getting instantiated somewhere and then never released, but I don't know what, where, or how to fix it...
Any advice would be much appreciated!

Code to invoke the report...
Sub Button1Click(Sender)
application.GlobalInfo.Add "RFilterField", "Account:AccountID"
application.GlobalInfo.Add "RFilterValue", application.BasicFunctions.CurrentAccountID

application.BasicFunctions.DoInvoke "CrystalReportPreview", "Account:Account Summary - Sample"
End Sub

Report's When Open script...
option explicit
sub Main

if application.BasicFunctions.GlobalInfoExists("RFilterField") then
application.BasicFunctions.ReportClearConditions
application.BasicFunctions.ReportAddCondition Application.BasicFunctions.GlobalInfoFor("RFilterField"), "=", Application.BasicFunctions.GlobalInfoFor("RFilterValue"), "string", vbNullString
end if
end sub

Report's When Close script...
option explicit
sub Main
application.GlobalInfo.Delete("RFilterField")
application.GlobalInfo.Delete("RFilterValue")
end sub
[Reply][Quote]
Robert Levine
Posts: 132
 
Re: problems with application.BasicFunctions.DoInvoke "CrystalReportPreview"Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Apr 07 8:00 AM
John,
You might try the "Application.BasicFunctions.PrintDetail" instruction without having to use a report When Open script. Since you are invoking a report which uses a main view table ("Account") it should work.

I have a similiar problem, but in my case, the table from which I wish to report on a single record is not a main table. The Print Detail instruction doesn't seem to work for such situations.

Bob Levine
[Reply][Quote]
John Crumpton
Posts: 26
 
Re: problems with application.BasicFunctions.DoInvoke "CrystalReportPreview"Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Apr 07 8:14 AM
Bob,
does it work other than filtering for a single record?

The When Load script seems to be fine...
If I use doinvoke to open the report (with or without the When Open script applying filters), it runs once, then will not run again until I close SLX...and it throws a runtime error when I close SLX.

edit.... I just looked at the PrintDetail function... I had no idea... What do you think they mean by "Caution: Reserved" in the documentation?

edit... I just tried it... same issue as doinvoke... runs once, but not again (this function does at least throw an error... "Error! Unable to print current view". throws runtime on SLX close.


John
[Reply][Quote]
Robert Levine
Posts: 132
 
Re: problems with application.BasicFunctions.DoInvoke "CrystalReportPreview"Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Apr 07 8:21 AM
John,
I think the "caution" relates to only working on reports which have the primary view tables (ie: Account, Contact, Opportunity) as their detail record sources.

I'm not sure why you are getting an error. What is the error? And to see what might happen, you could also try not using the When Close script.

Bob Levine
[Reply][Quote]
John Crumpton
Posts: 26
 
Re: problems with application.BasicFunctions.DoInvoke "CrystalReportPreview"Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Apr 07 8:27 AM
I'm going to try it on a different machine...hopefully it's just a problem with my Crystal install.
I get the same problem using PrintDetail...
it works once, then every time after that, no report and I get "Error! Unable to print current view"
When I close SLX, I get the standard Windows "SalesLogix has ancountered a problem and needs to close..."
and then "Runtime error 216 at 00404D4E"
[Reply][Quote]
Robert Levine
Posts: 132
 
Re: problems with application.BasicFunctions.DoInvoke "CrystalReportPreview"Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Apr 07 8:30 AM
John,
That's a good one. And I don't have an answer. I hope the crew at SalesLogix SDK is listening. Ryan, any ideas?
Bob
[Reply][Quote]
John Crumpton
Posts: 26
 
Re: problems with application.BasicFunctions.DoInvoke "CrystalReportPreview"Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Apr 07 8:45 AM
OK, confirmed!! The problem is just with my machine...probably a Crystal problem, not SLX.
both functions work fine.

Thanks for the help...the PrintDetail function is a lot easier to use...I had never seen it before.

john
[Reply][Quote]
Ina Nortje
Posts: 57
 
Re: problems with application.BasicFunctions.DoInvoke "CrystalReportPreview"Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Aug 08 5:35 AM
Hi John,

I get this exact problem on 3 of my 6 remote clients, and I have to somehow get the problem clients to work. I also had filters with global variables in the button code and initially thought that may have been the cause, but then to test I created a button called "cmdTest" and added the following code:

Sub cmdTestClick(Sender)
Application.BasicFunctions.DoInvoke "CrystalReportPreview", "Opportunity:Sales Process Stage Analysis"
End Sub

Even with this I still get the same problem. Second time I click the button nothing happens, and when I close SLX, I get the Windows error.

Any idea what we can do to get our problem clients to work?

Regards

Ina
[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): 8/25/2025 1:08:41 AM