2,501

(4 replies, posted in Script)

Hi Dmitry,
Thank you again for your help;  it works perfectly now.
Derek.

2,502

(4 replies, posted in Script)

Good Afternoon, Dmitry,
I have a form with a tablegrid (tablegrid1),  a sub-tablegrid (tablegrid2) and a memo field.
I use a script to automatically highlight the first row of tablegrid1 but this does not automatically retrieve the related rows for tablegrid2 (screenshot1).  The related rows for tablegrid2 are only displayed once the User has clicked inside tablegrid1.
Is it possible to retrieve the related rows for tablegrid2 as soon as the first row of the tablegrid1 is highlighted by the script  so that the form displays like this (screenshot2) and the User does not have to click inside tablegrid1?
I have enclosed a zip file of my project so you can see the problem.
Thankyou,
Derek

2,503

(3 replies, posted in General)

Hi Rob,

I had a similar issue but am using 1.45 so i don't have the option of a currency field type. 
If it helps, here's the relevant part of the script that i ended up with.

var
    i,c: integer; s_amount,s_famount,s_fpa: string; Cancel: boolean;
// format columns for £, thousand seperator and 2 dps
c := form1.grid1.RowCount - 1;
    for i := 0 to c do
    begin
        s_amount := form1.grid1.Cells[10,i];
        if ValidFloat(s_amount) then
                form1.grid1.Cells[10,i] := '£'+FormatFloat('#,###,###,##0.#0', StrToFloat(s_amount) );
    end;

// format column footers for £, thousand seperator and 2dps
    for i := 0 to c do
    begin
        s_famount := form1.grid1.Columns[10].Footer.Caption;
        if ValidFloat(s_famount) then
                form1.grid1.Columns[10].Footer.Caption := '£'+FormatFloat('#,###,###,##0.#0', StrToFloat(s_famount) );
    end;

I'm sure it's not pretty but, hey, it works for me!
Derek.

2,504

(2 replies, posted in Script)

Dmitry. 
It's working exactly how i want it to now.  I've also added cell colour highlighting so the exceptions are very easy to see.
Thanks as always for your help and your quick response.
Derek.

2,505

(2 replies, posted in Script)

Good Afternoon Dmitry,

I have a field (DOCUMENT_FLAG) defined as boolean;  it's purpose is to show if there are any missing documents for a selected record. 
At the moment, in the tablegrid the values in the DOCUMENT_FLAG column show as either 'Yes' or 'No' but I would like it to show as either 'Yes' or ' ' (blank)  because it is then much easier to see the exceptions.
All of the combinations I have tried in my script come back with errors such as 'incompatible' TCell', 'String'.  What is the correct syntax? 
Thanks,

Derek.

2,506

(4 replies, posted in General)

Hi Rob,
Thanks for your suggestion - yes, it was an outdated version i was using. 
And thanks for the pointer to the scroll bars script.  I had had a quick look around in case it had already been addressed but must have missed it (it was very late, in my defence!).
Derek

2,507

(4 replies, posted in General)

Hello Dmitry,
As you said, the problem is fixed when using the latest version of the software.
I have written a script to let the user use both mouse and arrow(up) and arrow(down) in the tablegrid and have the memo text display automatically instead of having to double-click.  But in adding this script, it has also fixed the original problem of not making a visible window modal in Version 1.45.  Very unexpected!
Thanks as always for your help.
Derek.

2,508

(4 replies, posted in General)

Hi Dmitry,
I have a simple application (1 table, 2 fields) with a tablegrid and a form to show the record together on the same form.
I can successfully view all records in the tablegrid and add, edit and delete records but every time I do this, i get an error message "Cannot make a visible window modal".  However, I am able to click past the error message and then continue.
Is there some way of getting round this?
The effect that I was trying to achieve was to be able to see each form record as I scrolled down through the tablegrid.
I have attached the project so you can see the problem for yourself.
Also, is there a way of attaching scroll-bars to a memo field?
Thanks,
Derek.

2,509

(6 replies, posted in General)

Hi Dmitry,
My tablegrids are now fully formatted exactly as I wanted.
1. Numeric columns (and footer totals) are right-hand justified
2. Footer totals display in a different colour
3. Numeric columns (and footer totals) have a ',' thousand separator
4. Currency columns (and footer totals) display a '£' sign and round to 2 decimal places
5. Numeric column headers are right-hand aligned
6. Conditional formatting (colour highlighting) is working on individual cells.
Thanks again for your advice and the quick responses.
Derek.

2,510

(6 replies, posted in General)

Hi,

I have a calculated field that contains currency values that i need to display in a tablegrid column in a specific format.
Example:
     VALUE                          VALUE
   £324.35             not    324.35341
£4,356.67             not  4356.66845

Can you tell me the best way to
a) format the column with a '£' currency sign
b) format the column using a ',' as a thousands separator
c) format the column to 2 decimal places.

Thanks,
Derek.

2,511

(5 replies, posted in General)

Hi Dmitry,
Tablegrid columns and tablegrid footers and now both aligned to the right - perfect!
Thanks again.
Derek.

2,512

(5 replies, posted in General)

Hello Dmitry,

1. The script  to prevent all rows showing in the tablegrid when no search criteria entered works very well.

2. The multi-line editor for Caption of component label is great - very easy now to add help messages and instructions.  I hope other users will find it useful too.

3. Numeric columns in the tablegrid are now aligned to the right - excellent.  Is there a way of aligning the tablegrid totals at the bottom of the columns as well?  That would be even better but if it's a big change, it's not so important - my project is already much better than before.

Thanks for your help and the very quick response.

Derek.

2,513

(5 replies, posted in General)

Hi,

I am new to MVD and just trying it out but i am really impressed so far.  I have 3 questions and apologies if they've been answered elsewhere (i have gone through the forum topics and couldn't find anything similar).

1.  I have a tablegrid (set to 'no auto execution of the query' so that it initially displays zero rows), a search criteria and a search button.  However, the user can simply press the search button without entering any search criteria to retrieve all the data table rows which is not what i want.  I am trying to force the user to enter something in the search criteria, retrieve only the relevant sub-set of data rows and then when the selection criteria are cleared, the tablegrid should again display zero rows. 
I have tried using 'incremental search' which works for the first time but when the search criteria is cleared, the tablegrid again shows all rows.  I have also tried using a filter on the field i am searching on and a filter in the tablegrid but neither works.  Is there something i am not doing correctly?

2.  I have an area of one screen where i have written some brief Help notes for the user.  However, i have only been able to achieve this by using multiple text labels!  Although it looks ok, it is difficult to maintain.  Is there a better way to achieve this?

3.  Is it possible to align numeric fields to the right in a tablegrid?

I have attached project details in case this makes it easier to understand what i'm trying to achieve.

Sorry for writing in english but i only know a few words of russian!  Thanks in anticipation and congratulations on a great piece of software.
Derek.