Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: steve sheridan
  Where is steve sheridan?
 hayward
 California - United States
 steve sheridan
 To: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 Tags
Subject: RE: Changing sort orders on cursors in a rep
Thread ID: 253976 Message ID: 310707 # Views: 29 # Ratings: 0
Version: Visual FoxPro 9 Category: Reports and Printers
Date: Thursday, June 23, 2011 5:26:58 PM         
   


> >
> > Thanks Anders.
> >
> > I found the data table used for a cursor (I'm just learning vfp language so please excuse me if I'm writing nonsense) and now have a new question that's related. In our software program there is a form that triggers 4 reports. The same form is used for different purposes, such as receiving items or vendor invoices. Depending upon what data is in the table and what is entered in the form, the corresponding report runs while the others trigger a message saying there's not data to report. My question is if there is a way to sort one report, such as the vendor invoice report, while not changing the sort order of another report like a received item report. The code now reads SET ORDER TO TAG ordnum IN Poordedt_r so all the reports sort on that one field. I want to sort one report by "name" and not "ordnum". Is this possible and how?
> >
>
> Yes, it is. Details would depend on how the data are currently prepared, i.e. what approach among those Anders mentioned already is being used.
> As a guess, your description sounds as if there are table(s) being open having certain alias name(s).
> So that if there is a "Set Order To ..." line probably right before the four "Report Form ..." lines, you can change each report data order by adding three additional "Set Order To ..." lines:
>
>
* assumed the current code looks like:
> ...
> Set Order To indexTagA
> Report Form reportA ...
> Report Form reportB ...
> Report Form reportC ...
> Report Form reportD ...
> ...
> 
> * ... the modified code might look like
> ...
> Set Order To indexTagA
> Report Form reportA ...
> Set Order To indexTagB
> Report Form reportB ...
> Set Order To indexTagC
> Report Form reportC ...
> Set Order To indexTagD
> Report Form reportD ...
> ...
> 

>
>
> (If the ordered alias is being used elsewhere too, as opposed to a temporary report-only data result, there might be an additional "Set Order To previousOrder" at the bottom.)
>
>
>
> hth
> -Stefan

I got it to work Stefan, thank you! I had to add another line of code that I copied from earlier in the form so it looked like this:

INDEX ON invnum TAG invnum
SET ORDER TO TAG invnum IN Poordedt_r
THISFORM.ReportName='podtljnl.frx'

I couldn't get it to sort by vendor name as the column containing the data is entitled "name" and I'm assuming there is a command by the same word as I got an error message when I tried this:

SET ORDER TO TAG name, invnum IN Poordedt_r

The report works as is because vendor invoice numbers have different sequences but I'd still like to learn more, of course.

ENTIRE THREAD

Changing sort orders on cursors in a rep Posted by Neil Phelan @ 2/18/2010 1:28:40 PM
RE: Changing sort orders on cursors in a rep Posted by ho me @ 2/18/2010 2:44:57 PM
RE: Changing sort orders on cursors in a rep Posted by Stefan Wuebbe @ 2/18/2010 4:57:08 PM
RE: Changing sort orders on cursors in a rep Posted by ho me @ 2/19/2010 6:48:14 AM
RE: Changing sort orders on cursors in a rep Posted by Anders Altberg @ 2/19/2010 11:56:11 AM
RE: Changing sort orders on cursors in a rep Posted by steve sheridan @ 6/21/2011 6:31:14 PM
RE: Changing sort orders on cursors in a rep Posted by Anders Altberg @ 6/21/2011 6:50:20 PM
RE: Changing sort orders on cursors in a rep Posted by steve sheridan @ 6/22/2011 1:20:23 AM
RE: Changing sort orders on cursors in a rep Posted by Stefan Wuebbe @ 6/22/2011 9:35:23 AM
RE: Changing sort orders on cursors in a rep Posted by steve sheridan @ 6/22/2011 8:00:15 PM
RE: Changing sort orders on cursors in a rep Posted by steve sheridan @ 6/23/2011 5:26:58 PM
RE: Changing sort orders on cursors in a rep Posted by Anders Altberg @ 6/23/2011 8:04:10 PM
RE: Changing sort orders on cursors in a rep Posted by Stefan Wuebbe @ 6/24/2011 5:56:54 AM
RE: Changing sort orders on cursors in a rep Posted by steve sheridan @ 7/13/2011 11:17:42 PM
RE: Changing sort orders on cursors in a rep Posted by Stefan Wuebbe @ 7/14/2011 5:58:41 AM