Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to manually sort the columns data in the grid
Message
From
24/05/2004 12:58:32
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
24/05/2004 11:12:21
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00906538
Message ID:
00906594
Views:
13
>How to manually sort the columns data in the grid after the select query is executed.
>
>when the data is appearing in the grid the first coulumn is filename, then proj_no and then ID
>
>Is it possible for me to show first the proj_no, then filename and then ID in the grid.
>
>
>***********************
>LcSQL = [select distinct(a.filename), b.proj_no, b.id from ocrdata a, docudeck b ;
> WHERE UPPER(b.file_name) = UPPER(a.tiffile) ;
> and a.OCDATA like "%] + alltrim(thisform.text1.value) + [%" ;
> order by a.id into Cursor lcSource]
>
>
>&LcSQL
>
>with thisformset.frmocr.grid1
> .RecordSource = ""
> .RecordSourceType = 1 &&1 - Alias &&4 - SQL
> .RecordSource = "lcSource"
>endwith
>
>***************
>
>Thank you very much in advance.

Raj,
1) Despite the suggestions you're still constructing a string and using macro substitution. AND not dividing the string into pieces.
2) If you're constructing such a string to show in grid then better you directly make that string grid's recordsource.
3) To show the columns in the order you want instead of playing with column properties (you might do of course) select the fields in that order from the start.
lcSQL = [select distinct b.proj_no, a.filename,  b.id]+;
        [  from ocrdata a, docudeck b]+;
	[  WHERE UPPER(b.file_name) = UPPER(a.tiffile)] +;
	[     and a.OCDATA like "%" + alltrim(thisform.text1.value) + "%"] ;
	[  order by a.id]+;
        [  into Cursor lcSource]

with thisformset.frmocr.grid1
	.RecordSource = "" && Keep if you want to preserve formatting
	.RecordSourceType = 4 &&1 - Alias &&4 - SQL
	.RecordSource = m.lcSQL
endwith
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform