Sort shared array using method from mlmcc

I would like to sort the attached report using this method. Is this possible ?
sort order should be the following:
date
client matter
amount

The formula GetShipType uses a shared NumberVar Array.
shared NumberVar Array shipType;
shipType[Int(ToNumber(Right({SOP10200.SOPNUMBE}, 3)))]

Shared variables are evaluated in the last pass ad cannot be used for sorting.

There is a trick that should work.
Make a copy of this report
Edit the copy
   Delete the report header
   Delete the subreport
   Delete the information in the page header
   Save the report as FG-Inventory-Sub

Open the original report
Add a formula to the main report header A
shared NumberVar Array shipType;

Delete the group and all the information in the detail section

Add a formula
Name - @Group1
WhileReadingRecords;
' '

Add a group to the report using that formula
Insert FG-Inventory-Sub report as a subreport in the group header or footer

Suppress the detail section of the main report

mlmcc
report.rpt
mowitAsked:
Who is Participating?
 
mowitConnect With a Mentor Author Commented:
I was thinking. Look at subreport "gather check details" that's populating my arrays, if I change the sort within that subreport will the arrays populate in the correct order ?
0
 
mlmccCommented:
Did it work?

What is your question?

mlmcc
0
 
mowitAuthor Commented:
How do I implement your solution using the attached report is my question.
0
Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

 
James0628Commented:
Maybe mlmcc can figure it out, but, FWIW, what you posted doesn't really make sense to me.  You've apparently quoted some post that was referring to another report, but without the report, or at least more information, it doesn't really make sense.

 There are formulas using an array variable named shipType, but no indication of how/where/what values are put into that variable.  Then again, the variable isn't actually used anywhere either (in the lines that you posted), so I guess it doesn't matter what's in it.

 There are instructions to make a copy of a report, delete some stuff and use that as a subreport, but without seeing the report, I have no idea what that was supposed to accomplish (What was deleted?  What was left behind?).

 Then it says to create a group in the main report on a formula that only seems to produce one value (""), which seems pretty pointless, and put the subreport in the group header, but without any kind of link between the main report and subreport, so the subreport would presumably produce the same information that the main report used to, minus the deleted things, so that doesn't really seem to accomplish anything.

 So, after all my complaining :-), the upshot is that you really should have included a link to the question that that post came from.  If a solution had been accepted for that question, there should be an "ask a related question" link just above the Comment box at the bottom of the page.  You could use that to create a new question that included a link back to that question for reference.

 As for your report, I looked at it briefly and my first question would be, do you really need those subreports?  The main report and subreports appear to be reading the same tables.  Why do you need the subreports?  Just wanted to ask, before you spend too much time trying to figure out how to sort the report by values stored in shared variable arrays.  If nothing else, it will help us understand how your report works.

 James
0
 
mlmccCommented:
Here is the link.  It is from 3 years ago
http://www.experts-exchange.com/Database/Reporting_/Crystal_Reports/Q_23520519.html

I haven't looked at it detail but I honestly can't recall what I was thinking when I provided that answer.

mlmcc
0
 
James0628Commented:
Thanks for the pointer.  I looked at it and I don't get it.  :-)  The whole idea is to sort based partly on the values from a shared array variable, but your post doesn't include anything about creating a sort.  It does create a group, but that's based on a formula that only produces one value, so no sorting there.  The only thing I could think of was that maybe the intent was to put the bulk of the main report in a second subreport, and sort the second subreport based on the values put in the array by the first subreport, but that wouldn't work either, would it?

 James
0
 
mlmccCommented:
As I recall that was the idea.  

The idea does work so long as the array values can be associated with a particular record.  It is the same basic idea that is used for graphing/charting on running totals.

mlmcc
0
 
James0628Commented:
OK.  I was thinking that you probably couldn't sort on shared variable values in a subreport either.

 So, getting back to the question at hand, do you think that mowit can use that idea in his report?  I think he's got 3 different arrays that he wants to sort on (date, matter and amount).

 James
0
 
mowitAuthor Commented:
worked.
0
 
James0628Commented:
Were you actually trying to sort the main report, or just sort the values in the arrays?  If you were just trying to sort the arrays, you could use a formula to sort them after the subreport is run, or, as you found, apply the sort in the subreport so that the values are added in the order you want.

 James
0
All Courses

From novice to tech pro — start learning today.