Hot Topic (More than 10 Replies) Reports and attached specs (Read 1175 times)
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Reports and attached specs
Sep 18th, 2007 at 6:22pm
Print Post Print Post  
I can't seem to find the post now, but the other day Erika said that once a spec is attached to a report it is saved with the report and can be removed from the saved specs in spec manager.  I hope my understanding of that is correct.  If so, I have a few questions.

If the spec as saved in Spec Manager is later revised using different criteria, my feeling is that this revision would not be carried along to the report that was using it.  Is that right?  If so, what would be the method to update the report with the new criteria?  Detach and re-attach the spec?  Or is there a quick & dirty method to tell my reports "use the updated spec" in one swell foop?

My Invoice database has a large number of saved reports (over 3 dozen and growing).  Many use the same retrieve and/or sort specs, so if a spec was revised and the detach/re-attach method is necessary, I would have quite a bit of work to do, even in just tracking down the ones I need to modify.  Is there a way to get a list of the specs that are attached to the reports?  I remember using some utilities a while back, on Version 1, which gave me a printout of all my form's elements and their attributes.  Does such a utility exist for reports?
  

**
Captain Infinity
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Reports and attached specs
Reply #1 - Sep 18th, 2007 at 7:31pm
Print Post Print Post  
Hello Scott,

You will need to re-attach the retrieve and sort specs to each report that uses them, if you make a change to them. As far as I know there is no utility that will write out the Retrieve and Sort specs for each report.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Reports and attached specs
Reply #2 - Sep 18th, 2007 at 11:16pm
Print Post Print Post  
Great question Scott!

Horrible answer!  I am sure that I never heard of this before.  Major rethinking, design, and training impacts.  Is there a "where used" list that can list the reports that are using a particular Saved Spec.

What I am hearing here is if a Saved Spec for Retrieval/Sort is modified, then you must go through all reports in that database, check to see if the spec was used, and if YES, then it must be removed, reattached, and then reconciled to the database again.  Users cannot change report specs without access to designer vs. just changing a Saved Spec.

I guess the solution may be to name Saved Specs with a prefix if it is used on a report.  Users should not be allowed to change any specs that start with the special prefixes, which means using programmed pick lists for Retrieve/Sort specs, and disabling the ones that show in the normal Saved Specs list.

Another solution would be to keep a database of Reports and the names of Saved Specs that are attached.  Now you can use that database to make the "where used" list that I asked about earlier.

If not in the manuals, this should be noted very explicitly with the next issue.
Aaargh, maybe I am over reacting, need some time to settle down.  This was a major surprise.

I think the correct method should be that the Spec attached to the report should be changeable by the user, and the report should be affected.  A warning message could come up warning the impact on a list of specific reports, providing the option to continue, or save as a new name before modification and/or deletion.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Reports and attached specs
Reply #3 - Sep 18th, 2007 at 11:33pm
Print Post Print Post  
Saved Specs are not attached to reports. When you attach a Spec to a report, it COPIES the Spec information. There is no relationship to the saved spec to warn you about. When you use the wizard to create a report with a sort, the sort is created and attached on-the-fly. No saved spec ever exists in this case.  The saved spec is a convenient way to specify what you want for the report as the report does not have a form. They are not linked in any way.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Reports and attached specs
Reply #4 - Sep 19th, 2007 at 12:46am
Print Post Print Post  
Quote:
I think the correct method should be that the Spec attached to the report should be changeable by the user, and the report should be affected.

I achieve an effect similar to this by using @LoadRetrieveSpec() and @LoadSortSpec().

All my reports are initiated from a custom main menu. Each report has a command button, which sets a GlobalValue flag, opens the correct form in search mode, loads the retrieve and sort specs, gets the results, then runs the report.

This way, I can simply make changes to the saved spec, and it is used when my report is run. (The process also asks me if I want to make any "temporary changes" to the retrieve specs each time the report is run.)
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Reports and attached specs
Reply #5 - Sep 19th, 2007 at 12:57am
Print Post Print Post  
Good method, Carl.  I agree that is the way to do it with reports that do not have attached specs.

But if reports are designed with attached specs, I don't believe that the Load Specs will override the Specs that were copied when Attach Specs was done.   I have not tested, so going on memory here.  I recall that no matter what your result set it, the embedded attached specs will take precedence.

Hmmm, I just realized that I did know this before, but never thought about it re Saved Specs.  Just knew that the result set would be overridden.  Did not think about changing the same Spec Name that was attached.  Always thought it was one and the same, and changing the spec would alter the report. 

Thanks again Scott, for asking the question ...... grrrrr.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Reports and attached specs
Reply #6 - Sep 19th, 2007 at 1:03am
Print Post Print Post  
Bob_Hansen wrote on Sep 19th, 2007 at 12:57am:
Good method, Carl.  I agree that is the way to do it with reports that do not have attached specs.

But if reports are designed with attached specs, I don't believe that the Load Specs will override the Specs that were copied when Attach Specs was done.   I have not tested, so going on memory here.  I recall that no matter what your result set it, the embedded attached specs will take precedence.

Yes, you remember correctly. But, I just don't attach any retrieve specs to reports (there are a few exceptions). Though, I usually do attach sort specs.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Reports and attached specs
Reply #7 - Sep 19th, 2007 at 10:32am
Print Post Print Post  
Quote:
I achieve an effect similar to this by using @LoadRetrieveSpec() and @LoadSortSpec().

All my reports are initiated from a custom main menu. Each report has a command button, which sets a GlobalValue flag, opens the correct form in search mode, loads the retrieve and sort specs, gets the results, then runs the report.

This way, I can simply make changes to the saved spec, and it is used when my report is run. (The process also asks me if I want to make any "temporary changes" to the retrieve specs each time the report is run.)

This sounds very useful, Carl.  Could you post a sample of some of the code that runs one of your reports this way?
  

**
Captain Infinity
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Reports and attached specs
Reply #8 - Sep 19th, 2007 at 10:38am
Print Post Print Post  
Quote:
Hmmm, I just realized that I did know this before, but never thought about it re Saved Specs.  Just knew that the result set would be overridden.  Did not think about changing the same Spec Name that was attached.  Always thought it was one and the same, and changing the spec would alter the report. 

Thanks again Scott, for asking the question ...... grrrrr.

Yeah, a little flag went off in my head when Erika mentioned the report/saved spec disassociation.  As you know, my project is in a tumultuous period right now, and I've got requests for changes coming at me from every direction.  My Invoice reports in particular are being changed left and right, and it occurred to me that what if, suddenly, the boss wanted everything sorted in the opposite direction, or something like that?  Yikes.

Carl's idea of loading a spec on the fly is definitely something I need to look into.
  

**
Captain Infinity
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Reports and attached specs
Reply #9 - Sep 19th, 2007 at 11:10am
Print Post Print Post  
Quote:
I guess the solution may be to name Saved Specs with a prefix if it is used on a report.

That's a great idea for changes going from Spec Manager to Report Designer, but what if it's the other way around?  The problem there is that the Spec Viewer in report designer does not show you the name of the spec that was attached, just its criteria.  I was looking into changing some of my reports that use @Date manipulations in their retrieves (I planned to use the piping method Erika mentioned) but I cannot tell, from looking at the report's spec viewer, which spec I need to edit, detach and re-attach.  Naming a spec with the report it's attached to would help when coming at it from the other way, but what if a spec is attached to a whole bunch of reports?  How would you name it then?

A couple of things would make this process easier:
1) If the spec viewer noted the name of the spec that was used.  I use very detailed names for my specs, so when I use Spec Manager I know exactly what they're doing.  But that doesn't carry through to the report spec viewer.
2) If the report designer allowed direct manipulation of the attached specs.  In fact, this really seems like a necessity, if you think about it.  The whole process would be greatly simplified if you could click on the spec criteria as presented in the spec viewer and edit the attached spec.

Just brainstorming.
  

**
Captain Infinity
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Reports and attached specs
Reply #10 - Sep 19th, 2007 at 11:39am
Print Post Print Post  
I've found that one thing that makes this much easier to manage is to have fewer reports. This is one of the things that not attaching retrieve specs can provide.

The complaints you have about having to find and reattach many specs also applies to having to add/delete an element or change a column header or change a calculation. If you have a bunch of copies of what is essentially the same invoice report, changes become a hassle.

If you have one invoice report which does not have an attached retrieve, and you use any one of the various methods available to run it against the records for this month, last month, last year, etc. then you have only one report to maintain instead of a dozen.

There are always several options for approaching any given problem, but this one has worked very well for me, so I thought I'd share it with you, in case you might find it useful.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Reports and attached specs
Reply #11 - Sep 19th, 2007 at 11:48am
Print Post Print Post  
Thanks Erika.  This is certainly one area where my project needs cleaning up.  I carried over a good number of reports from Q&A and redesigned them to work in Sesame, and a lot of them are the same report with just different retrieve criteria.  I'm hoping to learn some more from Carl and through study about loading specs on the fly, and if I can master that I'll just create some buttons that perform that function all on the same report, and prune them down sharply.
  

**
Captain Infinity
Back to top
IP Logged
 
Alec
Lanticans
*****
Offline



Posts: 200
Location: Ascot, England, UK
Joined: Nov 22nd, 2002
Re: Reports and attached specs
Reply #12 - Sep 19th, 2007 at 12:03pm
Print Post Print Post  
Inside Sesame subscribers will find an article about this technique (running one report with multiple saved retrieve specs) in the November 2005 edition of Inside Sesame (page 1). The article is named "Why make 10 reports when one will do?".

Those who would like an attached report retrieve spec to be dynamically linked to the saved retrieve spec should bear in mind that retrieve specs can be modified and saved by users, so you could not reliably run report XYZ with predictable results - a very unsatisfactory situation.
Furthermore, saved retrieve specs are stored in the DB file, not the DSR, and this would cause uncertainties in a scenario where updated DSRs are reconciled.
  

Alec
Back to top
IP Logged