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!
 Reporting & Notification Forums - Reporting
Forum to discuss reports for SalesLogix including Crystal, SQL Reports, etc. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to Reporting | New ThreadView:  Search:  
 Author  Thread: New report not linking to AccountID
Mark Hanford
Posts: 131
 
New report not linking to AccountIDYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Oct 08 6:17 AM
Greetings all,

Something odd is happening with a new Crystal Report I've created, and I can't for the life of me work out why. I've created loads in the past with no problem, so I'm guessing it's something daft I've missed.

The new report is moderately complex, it contains several linked tables (ACCOUNT, ADDRESS, CONTACT, HISTORY, USERINFO and three custom tables) as well as three quite simple sub-reports.

Now, the thing is, it runs fine in CR, and when run from SLX with the [All Records] looks fine. The problem lies with the linking of [Current Record] or [Current Group]. I've looked using SLXProfiler, and for some reason on this one report, SLX isn't injecting the "ACCOUNT.ACCOUNTID='............'" clause into the query.

No errors or anything (like you'd get with the "tables in group not present in report" issue), just silently returns all records for all accounts.

Any ideas?

(SLX version 7.2.1.1672, CR version XI Release 2)
[Reply][Quote]
Mark Hanford
Posts: 131
 
Re: New report not linking to AccountIDYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Oct 08 8:21 AM
Oh, In case it's of use, the SQL as shown by CR can be seen at http://cylindric.net/bin/6

I forgot to mention, but if it's relevant, the report has several parameter fields to prompt the user for some options. (Three boolean and a date-range)
[Reply][Quote]
Carla Tillman
Posts: 290
 
Re: New report not linking to AccountIDYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Oct 08 9:52 AM
The statement doesn't look like it but, did you force SQL at the report level?
[Reply][Quote]
Dan Carvin
Posts: 227
 
Re: New report not linking to AccountIDYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Oct 08 3:42 PM
If you're filtering by the current account, then you probably have a script set to run then the report opens. Post it here and we'll take a look.
[Reply][Quote]
Mark Hanford
Posts: 131
 
Re: New report not linking to AccountIDYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Oct 08 4:54 AM
There aren't any scripts set up on the report in Architect. I just leave them as they are, and usually "it just works". I was assuming that the client somehow injects the ACCOUNTID clause into the SQL statement.

Oddly enough it works fine on a test report I made, which used the same tables and type of parameters.
[Reply][Quote]
Dan Carvin
Posts: 227
 
Re: New report not linking to AccountIDYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Oct 08 10:14 AM
If the user enters parameters that limit the report to a single record, that's what you'll get. Otherwise, you'll get all of the the records that fit the paramaters and the join structure you put in the report.

If the report should always include the current record only, you need to create a script that uses ReportAddCondition to limit it to the current record, using a global variable or CurrentAccountID to obtain the ID value.

Next, set the script as the WhenOpen when the report opens.
[Reply][Quote]
Mark Hanford
Posts: 131
 
Re: New report not linking to AccountIDYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Oct 08 10:27 AM
Hmm, okay, I think I'm missing something then.

The parameters chosen when the report starts only change the records on some sub-reports, and shows/hides a couple of sections. It's basically a company-profile report, where the type of contacts can be filtered from a parameter, and the type of History etc.

The parameters don't affect the main records selected at all.

I'll do some more test reports, the one I made before with all the same tables and fields didn't have sub-reports, so I'll try a couple of those
[Reply][Quote]
Dan Carvin
Posts: 227
 
Re: New report not linking to AccountIDYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Oct 08 11:14 AM
Opps - never mind what I said then open script doesn't run when you launch from the Reports View anyway. I'm not sure why setting the group filter to current record wouldn't work - though I would specuate that sub reports might throw it off.

If so, launching the report from a button or menu item using an open script might be a good workaround.
[Reply][Quote]
Mark Hanford
Posts: 131
 
Re: New report not linking to AccountIDYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Oct 08 11:17 AM
Heh, thought I'd been missing something for years there :D

I think I found the root of the problem. When I set the report option "Replace Database Nulls with default values", it works!
I'm still having trouble with it showing all accounts when the sub-report is active, so I think there might be something else too.
[Reply][Quote]
Belinda Zenk
Posts: 8
 
Re: New report not linking to AccountIDYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 Oct 08 1:50 PM
Hey all,

Not sure if this is your problem or not, but I had a similar problem and it turned out I had a record selection criteria in my crystal report for testing. I had it commented out, but when SLX 'added' the 'current record' selection criteria on to the end of my criteria (which was commented out) the whole criteria was commented out....

I removed the commented criteria and it worked fine. Also, I had another report with commented out criteria and it worked fine because there was non-commented out criteria AFTER and the 'current record' criteria was added on to the end...

Hope that helps someone!
Belinda
[Reply][Quote]
Mark Hanford
Posts: 131
 
Re: New report not linking to AccountIDYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Oct 08 5:21 AM
Unfortunately I'm not sure exactly how I fixed the problem now, I changed several things that may have resolved the issue.

1. Moved some of the record selection filter's logic from the filter, to a custom function, and then just used that in the filter (so an @IsContactCurrent function for example, then the filter just had "and @IsContactCurrent
2. Changed a few report options so that DB nulls return default instead of null

[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 10:34:07 AM