This is dedicated in assisting others on developing and non-developing matters. It is also the official home of ssUltimate Library.
Thursday, September 13, 2012
Proper Fonts for dot-matrix printers
I have been wrestling with finding a proper font for quite a while now for my dot-matrix printing needs utilizing a POS printer which I decided to use for our Trip Ticket and Fuel Voucher issuances. The usage of a POS printer appeals to me because it saves money, paper, ink and time because there is never a need to cut a paper into several portions anymore, but the fonts I used to print those do not appeal to me.
Here is the output using Tahoma:
While the output is clear, simply looking at the colons you can immediately notice the alignment is not proper, and that is because Tahoma is a graphical font. Not to mention that it prints slower because it has more DPIs (Dots Per Inch) than the DOS fonts.
Thursday, September 6, 2012
ssExcelPivot Enhancements
ssExcelPivot class is among my underrated or maybe I can say the most underrated class of _ssClasses library. But this is in fact one of the best and useful class I have created so far. After I created this class, creating top managerial reports has never been soooo easy for me. What does this class do?
ssExcelPivot class is that simple small insignificant looking button as shown below (ssButton4) that can create instant pivot reports in excel with ease. Its power lies with creating these reports with just a few switch, which is what you cannot do with any crosstab utilities or even when designing reports via .frx way. Shown is the sample form given to subscribers, data coming from VFP Samples directory:
It creates 12 sample pivot reports in Excel (in my sample) just to show how things can be easily done. However, you can create more than that, even hundreds of different format, styles, etc. At the very bottom is Create Your Own Report which allows user the ability to create a pivot report in excel of their own choosing.
I said it is easy to use this. So I will show below codes inside the sample form I give to subscribers. First of all, create a cursor to serve as its recordsource:
ssExcelPivot class is that simple small insignificant looking button as shown below (ssButton4) that can create instant pivot reports in excel with ease. Its power lies with creating these reports with just a few switch, which is what you cannot do with any crosstab utilities or even when designing reports via .frx way. Shown is the sample form given to subscribers, data coming from VFP Samples directory:
It creates 12 sample pivot reports in Excel (in my sample) just to show how things can be easily done. However, you can create more than that, even hundreds of different format, styles, etc. At the very bottom is Create Your Own Report which allows user the ability to create a pivot report in excel of their own choosing.
I said it is easy to use this. So I will show below codes inside the sample form I give to subscribers. First of all, create a cursor to serve as its recordsource:
Tuesday, September 4, 2012
Capture Portion of Image from Webcam
Are you interested in having something like a small application that captures an image from a webcam? Just like when we get our driver's license where we simply stand on one side then the operator says "hold still..." then later gives a thumbs up sign? When the driver's license card is presented to us, we see that our face is snapped and cropped so it fits properly on said license.
Is this hard to do with VFP? Not if you know where to look for tools already shared to us by others.
Wednesday, August 29, 2012
ListBox Trick # 1 - Files with Filtering
This again is based on a query inside Foxite. The question goes:
While GetFile() is yet another easy way to get a fullpath(), it is not flexible on the filename part; only on the extension part where you can use wild characters. You cannot do this:
thisform.text1.value=getfile("month*.dbf")
As the asterisk there will be construed by VFP as part of the filename, and not as a wildcard. Same goes with LOCFILE() and PUTFILE() where you cannot also use a wild character on the filename.
Ordinarilly, the immediate thinking goes to these steps:
However, while that is one of the best ways to do those, there is yet simpler way which is using the highly unutilized feature of listbox known as RowSourceType = 7. It involves less coding and actually is very easy to use. For the sake of this example, I will simply filter the list of files with all dbf:
I need to get tables only have or start names as month1,month2.....
thisform.text1.value=getfile("month.dbf")
thisform.text1.value=getfile("month*.dbf")
As the asterisk there will be construed by VFP as part of the filename, and not as a wildcard. Same goes with LOCFILE() and PUTFILE() where you cannot also use a wild character on the filename.
Ordinarilly, the immediate thinking goes to these steps:
- Use ADIR() to gather filenames starting with the word "Month" and with extension "dbf":
- Create a cursor to hold the result and perform INSERT INTO .. FROM ARRAY laMyFiles
- Create a grid to show the result, then put some more codes either on AfterRowColChange or Click events to transfer the result into the textbox
However, while that is one of the best ways to do those, there is yet simpler way which is using the highly unutilized feature of listbox known as RowSourceType = 7. It involves less coding and actually is very easy to use. For the sake of this example, I will simply filter the list of files with all dbf:
Saturday, August 25, 2012
Combobox Tricks - Part I
I actually posted this or some of this in the defunct www.junblogs.com and has intentionally did not forwarded it in this blog thinking it is already read before by most of my followers, so they know this now. But several times I am still seeing some quires regarding comboboxes that I decided to revive this plus add some more tutorials in the near future.
So let us start again on combobox tutorials with this trick, hiding columns and some other things.
The way some developers do to hide let us say the 2nd column from view is to change that 2nd column's width to zero. While it is good, there will still be a space alloted and shown for that zero-width column:
loTest = Createobject("frmCombo")
loTest.Show(1)
Define Class frmCombo As Form
AutoCenter
=
.T.
Add Object combo1 As ComboBox With ;
RowSourceType= 6,;
RowSource = 'junkcbo',;
Value = 0,;
BoundColumn = 2,;
BoundTo =.T.,;
Style = 2,;
top = 50,;
left = 10,;
Width = 200,;
ListIndex = 1,;
ColumnCount = 2,;
ColumnWidths = '200,0'
Procedure Load
Create
Cursor junkcbo (xName c(30), xCurrency c(3))
Insert Into junkcbo Values ('Philippines','PHP')
Insert Into junkcbo Values ('Papua New
Guinea','PGK')
Insert Into junkcbo Values ('Australia','AUD')
Insert Into junkcbo Values ('United
States','USD')
Insert Into junkcbo Values ('Indonesia','IDR')
Insert Into junkcbo Values ('India','INR')
Endproc
Enddefine
So to fix that problem, you have to hide the column lines to make it appear that column1 and column2 are just one. Under combo1 settings, you have to add this line:
Friday, August 17, 2012
Spell Checking & Correcting Form Captions
Here is a little something that is asked just now inside foxite forum, i.e., how to get the captions of each objects inside a form, use Word's Spell Checking feature to correct those, and then update the object's captions with the corrected one.
While I do not know why this is needed, well we try to give what they request. So here is a sample of how to do exactly just that via word automation:
While I do not know why this is needed, well we try to give what they request. So here is a sample of how to do exactly just that via word automation:
Tuesday, August 14, 2012
Drag & Drop III - Moving Borderless Forms
I know there are already lots of samples shown by experts on how to drag a borderless form. But just in case you wanted to see another simple way, here it is. If you will be simply allowing dragging via the form's surface itself, then you can simply do this as shown in my codes below. If there are lots of objects where you need to bind the dragging, like a fake title bar, the caption on that fake title bar, etc.; then you need to use BindEvent().
The reason why I am sharing this is because my earlier approach is to use MouseDown() first to perform validation whether left mouse button is clicked, then call another user defined method like MoveMe(). What I wanted to show here is a more direct usage of an object's MouseMove() event. You drag (move) things via the left mouse button, so use MouseMove.
Here are the codes:
The reason why I am sharing this is because my earlier approach is to use MouseDown() first to perform validation whether left mouse button is clicked, then call another user defined method like MoveMe(). What I wanted to show here is a more direct usage of an object's MouseMove() event. You drag (move) things via the left mouse button, so use MouseMove.
Here are the codes:
Subscribe to:
Posts (Atom)

