Saturday, June 25, 2005
Foxfire! Sort Orders: Hidden Data Items or Unselected
I was working on a Sort problem in build 397 and wanted to ensure this was written down as it's an interesting issue to deal with.
In Foxfire! 8.0, build 396, if you build a report that uses a sort order by an unselected data item, you'll get an error. The SQL being generated doesn't include the column and as a result, bombs out. This was the bug that I was trying to fix.
First some background:
When you do a sort in Foxfire!, you can choose to sort by three different choices:
a) a regular data item that you have included in your request (like Cars Make)
b) a calculated data item like Avg of Cars Mile
c) an unselected item (for example, if your report showed States and cities but was sorted by a State order column that went from West to East)
One of the ways to do the third option is to include that State Order column in your data items and simply hide it.
I personally prefer this option because it makes it OBVIOUS the way you are sorting the data. But Foxfire! has always let users also create sort orders on items that are NOT in the request's data items (referred to as Unselected).
Although the new object model now handles this scenario with some basic code:
loReq = loff.requests.additem("Detail")
loReq.DataItems.AddItem("Cars Make")
loReq.DataItems.AddItem("Cars Model")
loReq.Sorts.AddItem("Cars Mileage")
It may be useful to think about the internal arrays being used:
srt_ord( ) holds the sort order (A or D) but if the data item was not a selected data item, it would say "A[Unselected]"
If it WAS a valid data item, it would just say "A"
This also shows up in the Object model
loSort = loReq.Sorts.Items(1)
? loSort.Order && might say "A" or it might say "A[Unselected]"
Comment
In Foxfire! 8.0, build 396, if you build a report that uses a sort order by an unselected data item, you'll get an error. The SQL being generated doesn't include the column and as a result, bombs out. This was the bug that I was trying to fix.
First some background:
When you do a sort in Foxfire!, you can choose to sort by three different choices:
a) a regular data item that you have included in your request (like Cars Make)
b) a calculated data item like Avg of Cars Mile
c) an unselected item (for example, if your report showed States and cities but was sorted by a State order column that went from West to East)
One of the ways to do the third option is to include that State Order column in your data items and simply hide it.
I personally prefer this option because it makes it OBVIOUS the way you are sorting the data. But Foxfire! has always let users also create sort orders on items that are NOT in the request's data items (referred to as Unselected).
Although the new object model now handles this scenario with some basic code:
loReq = loff.requests.additem("Detail")
loReq.DataItems.AddItem("Cars Make")
loReq.DataItems.AddItem("Cars Model")
loReq.Sorts.AddItem("Cars Mileage")
It may be useful to think about the internal arrays being used:
srt_ord( ) holds the sort order (A or D) but if the data item was not a selected data item, it would say "A[Unselected]"
If it WAS a valid data item, it would just say "A"
This also shows up in the Object model
loSort = loReq.Sorts.Items(1)
? loSort.Order && might say "A" or it might say "A[Unselected]"
Comment
Tuesday, June 21, 2005
Foxfire! 8.0 - Build 396
Build 396 is now available with updates to the output generation so you can correctly generate Word documents, Excel output, HTML and more by selecting it in the Output area.
Other updates are more cosmetic in the toolbar and startup screen areas.
Full Install
Refresh
Comment
Other updates are more cosmetic in the toolbar and startup screen areas.
Full Install
Refresh
Comment
Thursday, June 09, 2005
Foxfire! 8.0 - Build 395
Just up before DevCon (although we'll likely have another one around Monday)
Full
Refresh
IF you are installing on top of an existing directory, please be sure to ERASE the contents of that file. The install may not overwrite data files if you have recently revised them)
Lots of visual changes in this one so be sure to download the full install.
1. A new right-click option is available called Show / Hide workbench that lets you quickly hide or roll-up the workbench as needed. This is available from most of the labels in the design area.
2. You can now change Summary calculations properly. Previously the y weren't saving.
3. The number of items you've selected is now displayed on the Data Item tab. This makes it easier to know how many columns you will be displaying.
4. When changing the Color of a data item, it now appears properly.
5. In the Sort / Group tab, the Available Data Items list doesn't keep disappearing in VFP 8. (bug in VFP)
6. When upgrading, if you have the same preference names as the sample data sets, they will not appear. This is by design so that you don't overwrite the main sample data.
7. A variety of updates in text output. The files are now created properly and the output correctly goes to the right file extension.
8. You are no longer able to copy an empty filter.
9. Some sample data items have been corrected that were causing problems.
10. Hiding columns no longer conflicts with the groups.
11. Hidden fields are now not shown automatically in the Browse output.
12. The Cross -tab workbench now resizes properly.
Comment
Full
Refresh
IF you are installing on top of an existing directory, please be sure to ERASE the contents of that file. The install may not overwrite data files if you have recently revised them)
Lots of visual changes in this one so be sure to download the full install.
1. A new right-click option is available called Show / Hide workbench that lets you quickly hide or roll-up the workbench as needed. This is available from most of the labels in the design area.
2. You can now change Summary calculations properly. Previously the y weren't saving.
3. The number of items you've selected is now displayed on the Data Item tab. This makes it easier to know how many columns you will be displaying.
4. When changing the Color of a data item, it now appears properly.
5. In the Sort / Group tab, the Available Data Items list doesn't keep disappearing in VFP 8. (bug in VFP)
6. When upgrading, if you have the same preference names as the sample data sets, they will not appear. This is by design so that you don't overwrite the main sample data.
7. A variety of updates in text output. The files are now created properly and the output correctly goes to the right file extension.
8. You are no longer able to copy an empty filter.
9. Some sample data items have been corrected that were causing problems.
10. Hiding columns no longer conflicts with the groups.
11. Hidden fields are now not shown automatically in the Browse output.
12. The Cross -tab workbench now resizes properly.
Comment