Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get multi-line captions in grid header?
Message
From
03/11/1999 00:13:17
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
02/11/1999 14:01:00
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00285620
Message ID:
00285942
Views:
18
>I guess my title says it all. Any ideas?
>
>Thanks,
>
>
>-JT


Jeff,
There is another relatively simple way to do it. If you don't have general field type (I don't know how to do if it has) you could use MSDataGrid control. It has a property HeadLines. You can set it to be multipl lines. Below is a sample. First create a new form and drop MSADOControl (name ADOControl), MSDataGrid (Name OleGrid) on it and a commandbutton :
* ADOControl.init && Write correct testdata path
#Define TESTDATALOC C:\ddrive\TEMP\testdata.DBC

strCn =	[Provider=MSDataShape.1;Persist Security Info=False;]+;
  [Data Source="Data Provider = MSDASQL;]+;
  [DSN=Visual FoxPro Database;UID=;SourceDB=TESTDATALOC;]+;
  [SourceType=DBC;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;Null=Yes;]+;
  [Deleted=Yes;";Data Provider=MSDASQL ]


strShp =	[SHAPE { select customer.cust_id, Company, ]+;
  [   orders.order_id, order_date, order_net, shipped_on, ]+;
  [   line_no, prod_name ] +;
  [ from customer ]+;
  [      left outer join orders ]+ ;
  [        on customer.cust_id = orders.cust_id ] +;
  [      inner join orditems ]+ ;
  [        on orditems.order_id = orders.order_id ] +;
  [      inner join products ]+ ;
  [        on orditems.product_id = products.product_id } ]

With this
  .CommandType = 1
  .ConnectionString = strCn
  .RecordSource = strShp
Endwith

* Commandbutton.click
With Thisform.OleGrid
  .Datasource = Thisform.ADOControl.Recordset
  .RowDividerStyle = 4
  .Headlines = 4
  For ix = 0 to .Columns.Count-1
    With .Columns(ix)
      .Caption = .Caption + " Other lines of header"
      .DividerStyle = 4
    Endwith
  Endfor
  .Caption = "Invoices"
Endwith
Pls note that SHAPE command is not a hierarchical one. If you write a hierarchical one you can use MSFlexGrid to get a nice hierarchical (treeview like) grid too ;) For your convenience below is a hierarchcal version :
strShp =	[SHAPE { select cust_id , Company from customer } ]+ ;
 [ APPEND (( SHAPE { select cust_id, order_id, order_date, order_net, shipped_on from orders } ]+;
   [     APPEND ( { select order_id, line_no, prod_name from orditems inner join products on products.product_id = orditems.product_id } ]+;
        [ AS rsOrditems RELATE order_id TO order_id )) ] +;
    [ AS rsOrders RELATE cust_id TO cust_id )  ]
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