1,601

(6 replies, posted in General)

Hi,
Can you attach your project with the 'report sql' button placed on the form so the error can be reproduced?
Derek.

1,602

(5 replies, posted in General)

Hi,
See the attached screenshot.  Set the combobox 'filter' property as shown and also make sure that the 'sort' property is 'false', otherwise this will override the 'filter' property.
But I'm not sure if this is what you mean by 'without hard coding'.
Derek.

Привет Dmitry,,
Это работает именно так, как мне нужно сейчас.
Спасибо,
Derek.

Hi EHW,
Well, don't I feel a fool - LOL!
I could swear I'd tried that first of all with no success before going on to try various cell enabling combinations (none of which worked).  I'll put it down to a 'senior moment'.......
Thanks for the help.
Derek.

Hello Dmitry,
I am using an editable grid with 3 columns (please see attached).
However, I want Column 0 to be read-only, Column 1 to be editable and Column 2 to be editable.
I have tried various options but have been unsuccessful so far.
Can you think of any way to do this?
Thanks,
Derek.

1,606

(2 replies, posted in General)

Hi,
A few different ways depending on exactly what you want to do, but you could try it like this.
Derek.

1,607

(2 replies, posted in General)

Hi Didier,
Please have a look at the attached.
Even though the form object has a property of 'autoscroll', this does not seem to work even when ticked (at least on my configuration) and so you need to explicitly code for it in a script. 
Also (again in my configuration), if your form object has a 'borderstyle' property of 'bsdialog', this will disable the scrollbar (perhaps a couple of small bugs that Dmitry could have a look at).
Regards,
Derek.

1,608

(1 replies, posted in General)

Hi Kees,
Try putting this code in the final section of your script
begin
  form1.tablegrid1.dbpopupmenu.items[0].Enabled := false;   //** where items[0] is the 1st item in the popup list, items[1] is the 2nd item etc etc
end.
If you prefer not to see 'Show Record' grayed out, you can make it invisible like this -
begin
  form1.tablegrid1.dbpopupmenu.items.items[0].Visible := false;
end.
Another way of doing it is to find the text of the item you're trying to disable rather than by using items[0]
begin
  form1.tablegrid1.dbpopupmenu.Items.find('Show Record').enabled := false;
end.   
Please see attached.
Derek.

1,609

(14 replies, posted in General)

Hi,
You just need to add a check in your calculated field to see if any of the fields that are being concatenated are blank.
Try it like this:
ifnull(firstname,'')||' '||ifnull(lname,'')||' '||ifnull(oname,'')
Regards,
Derek.

1,610

(14 replies, posted in General)

Hi,
Perhaps try it like the attached - it seemed the simplest, but I'm sure there are other ways too.
I added a new form just so you can check that the inserts into the 'stdfee' table are working correctly.
Regards,
Derek.
(also just added a check to stop rows being inserted into stdfee table if either 'fee' or 'class' not selected)

1,611

(4 replies, posted in General)

Hi Dynapta, Hi Jean,
Just to expand a little on Jean's reply, you can autofit columns depending on
1.  the header (bfheader),
2.  the data in the column ()
3.  both the data and the header (bfboth). 
You can also specify, for discrete columns
4.  a specific initial column width which can be manually altered,
5.  lock the column width so that the User can't change it.
All of the above are done using a script.  Please see the attached example - in the script, each option is commented out - just remove the '//' against each option then run the example to see the effect. 
You can also use these options in combination - for example, let the data interactively adjust the column by using form1.tablegrid1.bestfitcolumns();  but prevent the User from adjusting, for example, Column0, by using form1.tablegrid1.columns[0].options := form1.tablegrid1.columns[0].options - cofixedsize;
I've probably made that sound way more complicated that it actually is - just play around with the attached example and all will be revealed (I hope - LOL!)
Derek.

1,612

(4 replies, posted in General)

Hello Dynapta,
Please see the attached screenshot.
To sort on multiple fields, select 'Order By' from the 'Sort' drop down box and then enter the tablename.fieldname that you want to sort on (separated by commas). 
'Ascending' is assumed, if you want to change the order, enter 'desc' after the relevant fieldname.
Regards,
Derek.

Hi,
As I understand it, setting 'keypreview' to true basically allows you to process an action (in this example, using the 'enter' key) AT THE FORM LEVEL instead of writing code for each individual object on that form.
Derek.

You have changed the name of the procedure in the script to 'registrationpanel' but you haven't changed the name of the edit field to match this (and it should be 'form1.registrationpanel).
I would strongly advise leaving the names of objects (and the generated names of procedures associated with those objects) as the defaults to avoid these sorts of problems.
I have corrected and simplified what you're trying to do (please see the attachment).
Derek.

Hi,
Perhaps the easiest way is to reformat the date using a calculated field and then just pass it through to the report and not use ReportSQL at all (see attached).
Thanks to DBK for the example.
Derek.

Hi,
Attached is an example of using the 'enter' key to simulate the 'tab' key.
Derek.

1,617

(4 replies, posted in General)

Hi Adam,
From your attached example, I'm not sure why you want to save each change of label as a new record in the 'label' table (unless you're going to subsequently refer to them).
Anyway, in the attachment are two suggestions.  In the first option, each label change is saved as a new record (as per your example).
In the second option, it inserts a record into the 'label' table only if that table is empty and subsequently just overwrites the record with whatever you want the changed label to be.
I'm sure there are other ways as well.
Derek.

Try this (see attached).
Derek.

Hi,
Try putting something like this into your script:
procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
begin
  showmessage(towords(form1.edit1.value));
end;

procedure Form1_Button2_OnClick (Sender: TObject; var Cancel: boolean);
begin
  form1.edit1.Text := towords(form1.edit1.value);  //*** USD is the default currency - it can be changed as per the example below
//  form1.edit1.text := replacestr(form1.edit1.text,'dollars','pounds');
//  form1.edit1.text := replacestr(form1.edit1.text,'dollar','pounds');
//  form1.edit1.text := replacestr(form1.edit1.text,'cents','pence');
//  form1.edit1.text := replacestr(form1.edit1.text,'cent','pence');
end;

See attached example,
Derek

1,620

(32 replies, posted in General)

Hi Adam,
Just seen your post about adding multiple projects.
Using the example that EHW and I put together, I'd bolt another table onto the structure and then just modify the forms, where relevant.
See attached (the icon top left displays available projects and allows maintenance).  After that, task maintenance is done within each quadrant.  Re-assigning priorities is now done solely by drag-and-drop).
Derek.

1,621

(1 replies, posted in General)

Hi Dustin,
It's possible to import data into MVD either directly from Excel or as a CSV saved from Excel.  How easy it is depends on your data structure but it's a one-off set up and after that, you just click a button.
But it might be worth you investigating MVD a bit further - entering data directly into MVD doesn't have to take any longer than Excel (it could just be the familiarity of Excel over something new).
You can actually use MVD rather like Excel with an editable tablegrid (but you wouldn't really be playing to its strengths).  Depending on how you structure your application and how you design your forms, data input can be quick and data validation is relatively easy to set up.
Attached is a dummy project that I knocked up to give you a quick feel for things you can do with MVD.  Just open the .vdb file in MVD and then run it.
I've arbitrarily shown a left hand tablegrid with School Weeks and a right hand tablegrid with Pupils.  Click on rows in either tablegrid to display the relevant information in the middle tablegrid.
I've chosen to enter data by school week no' - to add a record, just click the 'add' button and select from the comboboxes (which are all searchable so, for example, just typing a couple of characters quickly finds the relevant entry).
Hopefully, this gives you some ideas,
Regards,
Derek.

1,622

(32 replies, posted in General)

Hi EHW,
I couldn't work out how you were doing the 'dragging' (but in effect, you're not!) - it's taking whatever row is highlighted in whichever grid and then using the 'on mouse up' to work out your current location - then you change the priority status accordingly and allow the filter in each grid to do the moving.  Conceptually (and in practise), it's really effective.  Nice one.
The only 'extra' I could think of is, on mousedown, to change the cursor from 'crdefault' to 'crdrag', but it's purely cosmetic.
Thanks for your input,
Derek.

Hi Jean,
Glad to be of help.
You can also do the same thing in a script - for example 
sqlexecute('select firstname||" "||lmiddlename||" "||lastname||" "||email from people where id ='  etc etc) which can avoid lots of 'selects' and then joining fields together.
Of course, if you use this to output to a tablegrid, you then need to loop through the tablegrid, so a calculated field is often simpler.
Derek.

1,624

(32 replies, posted in General)

Hi Adam,
Must be quite a few ways of creating an Eisenhower Matrix.
The simplest would probably be just a form with 4 memo fields, each one corresponding to a field in a table.
In the attached, I've used 4 tablegrids as it's easier to separate out discrete tasks and you can then just move them from one quarter to another by changing their priority;  the script is purely for cosmetic stuff / ease of use so you could get away without it.
I haven't done so (as you don't usually specify dates in an Eisenhower Matrix, from what I remember) but it would be easy enough to add date/time fields to the 'tasks' table and show these on the grids.
Derek.

Hi,
The easiest way is to use a calculated field to concatenate the first and last names (see attached)
Derek.