Привет Новичок
В ваших диапазонах дат есть пропуски: как насчет сотрудников от 0 до 30 дней, а как насчет сотрудников от 31 до 60 дней? Поэтому я сделал предположения.
Посмотрите вложение, чтобы узнать, как раскрасить сетку таблицы, а затем можно изменить сценарий в соответствии с вашими требованиями.
Альтернативно, вместо того, чтобы раскрашивать сетку таблицы, вы можете использовать вычисляемые поля для обозначения срочности (например, !, !!, !!!); возможно, это не так привлекательно визуально, но это означает, что их легче сортировать или фильтровать по категориям срочности.
С уважением,
Derek.

27

(4 replies, posted in Script)

An 'onchange' event is automatically triggered when you open any form. 
But at that stage, no row has actually been selected (ie, the 'selectedrow' is still at -1) which is why you get the error.
You could amend your code to test for this:

procedure Form1_TableGrid1_OnChange (Sender: TObject);
begin
  if form1.tablegrid1.selectedrow > -1 then form1.label1.caption := form1.tablegrid1.cells[1,form1.tablegrid1.selectedrow];
end;

If you subsequently make a change to the underlying data, the even will be triggered and the label.caption should display correctly.
Derek.

28

(4 replies, posted in Script)

Hi Lara.0080,
As always, attaching your project helps enormously in trying to debug any problems.
You have not specified what event you have attached your code to but I suspect that you are using 'OnMouseDown';  try attaching the code to 'OnMouseUp' instead.
Derek.

Привет Serenada
Программа будет отображать только те строки данных, размеры которых больше или равны измерениям поиска, введенным вами в качестве критериев фильтра.
Пожалуйста, взгляните на снимки экрана во вложении, чтобы показать, как должна работать программа.
Скриншот 1: без фильтров
Снимок экрана 2: отображаются только строки, в которых одно из измерений больше или равно введенному значению.
Снимок экрана 3: отображаются только строки, в которых оба размера больше или равны одному или другому введенному значению.
Снимок экрана 4: отображаются только строки, цвет которых равен выбранному цвету.
Сообщение об ошибке, которое вы получаете, связано с «интернационализацией»; в некоторых странах используется '.' в качестве десятичного разделителя в других странах используется «,»; программа написана так, чтобы принимать '.' как десятичный разделитель, потому что я живу в Англии. К сожалению, я не могу повторить проблему.
Хотя это не решение, попробуйте программу, используя '.' вместо ',' и это должно работать.
Для постоянного решения, возможно, кто-то, кто также использует «,» в качестве десятичного разделителя, может предложить некоторую помощь.
С уважением,
Derek.

Привет Serenada, Konstantin, Sparrow,
Возможно, вы также можете добиться этого, используя стандартную функцию поиска вместе с вычисляемыми полями.
Во вложении, как и в других «фильтрах поиска», вы можете ввести минимальные необходимые размеры (неважно, вводите ли вы сначала высоту или ширину).
Возможно, это даст вам больше идей.
С уважением,
Derek.

Hi Sonixax,
Perhaps you can take a simpler approach (providing I understand your problem correctly).
Can you not just use two calculated fields (one for 'month' and one for 'year') formatted using 'strftime'?
Have a look at the attachment.
Regards,
Derek

There are a number of ways to achieve this.
One of the simplest is to display in your message the contents of a column that you specify in your script depending on the row you have clicked on (see the script in the attachment).  In this example, clicking on a row show the 'city' field.
Also you can be totally flexible and show the contents of any cell (any column, any row);  see the commented out code in the script.
Maybe this helps.
Derek.

As I already wrote in my previous answer

 replace 'fkcount' with 'fksum' in the script

See new attachment.
Derek.

Hi,
From your post, I assume that you are not currently using standard MVD functionality to display tablegrid footer values.
In that case, have a look at the attached example and simply replace 'fkcount' with 'fksum' in the script and adjust the column number to be the column that contains 'hoursmissed'.
However, if you are already using standard MVD functionality to display tablegrid footer values, you do not need lines 3-4 in the script.
Derek.

Привет Константин,
Я не знал, что вы можете назначить поле таблицы в интерактивном режиме — это будет очень полезно.
Спасибо за это.
Derek.

Привет Новичок,
Взгляните на BRD1 во вложении, который, я думаю, делает все, о чем вы просили.
Я не был уверен, почему вам нужно использовать отдельные формы (Form3 и Form4) для ведения учета и поиска дней рождения по месяцам.
Возможно, вы могли бы упростить это и просто сделать все на Форме 1 (см. BRD2 во вложении).
Кроме того, мне понравился ваш код для определения дней рождения на сегодня и завтра.
С уважением,
Derek.

Привет,
Возможно, попробуйте что-то вроде этого
Derek

38

(3 replies, posted in SQL queries)

Hi,
You can use 'sql query' but for something straightforward like filtering by month / year, it is much easier to use the 'search' option.
Have a look at the attachment to see how you could do it.
Please be aware that MVD is no longer being developed;  however, the software is fully functional and help is available through this Forum.
Regards,
Derek.

39

(10 replies, posted in General)

Hi,
I'm not sure from your messages and attached code whether you want to update 'works' every time a new record(date) is inserted into 'tempx' or whether you want to just insert into 'tempx' one record(date) at a time and then update 'works' in batch mode.
Attached are both options.
Regards,
Derek.

40

(4 replies, posted in General)

Hi MS2014, Salut Jean, Привет Konstantin,
What sort of changes have you made?
1.  added new fields?
2.  changed existing fields (changed field names, field definitions)?
3.  deleted existing fields?
4.  added new tables (what relationships with existing tables)?
5.  changed existing relationships?
6.  deleted existing tables?
The type of changes has a big impact on the size of task and the approach that you take.
Also, how many data rows do you have in tables that you've changed.
Depending on the answers to the above points, you may be able to simply copy and paste your data using something like SQLiteStudio
Just make sure you back up your database first!
Derek
.

41

(7 replies, posted in General)

Hi Adam,
I wasn't ignoring you ( big_smile ) - I just didn't see your post.  Sorry.
I think the 'page cannot be displayed' message is simply because I was using hard coded links to example documents rather than using relative links.
Obviously you wouldn't usually use 'hard coded' links but I was just experimenting with various things.
Regards,
Derek.

42

(10 replies, posted in General)

COUNT(id)    what this do ???
<> 0) then Cancel := True;  --   this to check that date picker not empty , right  ???

and how to save from DateTimePicker1 to table direct as date , do you have idea ???

1.  COUNT(id) FROM tempx WHERE Date='+ Form1.DateTimePicker1.sqlDateTime) <> 0)
This checks to see if the date you are entering already exists (<> 0) as you don't want to allow duplicates.  You could write count(id) or count(*) or use any mandatory field - it's just to use something that will always be present in the record.
2.  <> 0) then Cancel := True;
This cancels the 'save' action if a duplicate date exists (ie <> 0) - if it is 0 then the record is saved.  If you want to prevent an empty date from being saved, then specify it as mandatory in your data schema.
3.  SQLite does not have a native 'date' format - dates are stored as strings and converted by the program into any date format that you specify at run time.
Derek.

43

(12 replies, posted in General)

Salut Jean,
Glad everything is working okay now.
I had a quick look last night and also noticed the 'delete action' on form1.button23 but removing it still didn't fix the problem.  I was going to have a look this afternoon but you've beaten me to the finish line big_smile.
You mentioned the splash screen - I put a bit of 'animation' on mine (there are various styles you could use);  attached is an example using a 'fade in - fade out' effect if it's something you're interested in looking it.
Regards,
Derek.

44

(10 replies, posted in General)

Hi Lara0080, Vladimir,
What exactly are you trying to do by copying dates from 'tempx' to another table? 
It always concerns me when I read something like this because it often indicates that the data schema is not optimised or correctly designed which can cause problems as you develop your application.
Also, try to avoid using field names such as 'date' (use 'mydate' or 'tempdate' for example);  the word 'date' might be used in a script to perform some operation and therefore clash (apart from being a bit confusing).
Derek.

Привет
Попробуйте вот так
Derek.

46

(12 replies, posted in General)

Salut Jean,
Yes, I think that should work.
But a couple of things to be careful about.
1.  using your example, you would need to make sure that there were no transactions dated prior to 01/01/2023 (but it's a simple test to check for this).
2.  when you create a line with a new starting balance, you might also need to bring forward the balances of 'depenses' and 'recettes' (otherwise doesn't this make your tablegrid.footer calculation of 'Solde' incorrect?).
I was also wondering whether holding 'tpaidin' and 'tpaidout' as absolute values in two discrete fields rather than simply using a single field (tvalue) and signing it positive or negative doesn't start to make things more complicated than it needs to be (and yes, I appreciate the irony of suggesting this as it was me who used absolute values in the first place roll )!!  I must have thought it was a good idea at the time but I can't remember why!
Can I ask why you want to delete transactions in the first place rather than use something like a filter?
Derek.

47

(7 replies, posted in General)

Yes, simple and straightforward.
Thanks for the extra information.
Derek.

48

(7 replies, posted in General)

Hi Sparrow,
Everything's working well now.
Thanks for your help.
Derek.

49

(7 replies, posted in General)

Hi All,
Some help if anyone has any ideas please.
I have an application that holds information about .pdf files.
When you run the application, if you click in Column 2 (View) the .pdf file is opened in a TWebBrowser container (see screenshot1 in the attachment). 
When you click on a new row, a new .pdf is displayed.
The problem is when there is a row of data with no associated .pdf;  in this case, the previously selected .pdf is still displayed (see screenshot1 in the attachment).
What I am trying to do is clear the TWebBrowser container when there is no associated .pdf but have not had any success so far.
I'm using MVD 6.5 with SQLite and running Windows 10.
Thanks in advance for any help,
Derek.

50

(12 replies, posted in General)

Salut Jean,
Hope you and the family are doing well.
I think the specific issue you had with your project should be fixed now.
Basically, the export to Excel will take all of the rows in form1.tablegrid1 that are displayed.
So the extra step that you need to insert is a filter that displays only those rows that have been checked (filter by tflag = 1 (form1.button22).
I've put this as the 'on click procedure for form1.button21
Then the 'on after click' procedure for form1.button21 performs the export to Excel and deletes the checked rows from the database.
I hope that's clear.
Sorry but I messed up your script a bit - I needed to keep various panels and buttons visible while I was testing and it was driving me crazy when they kept disappearing smile.  But if you search within the script for '//derek', I have commented the lines that I've changed so it should be fairly easy to change things back.
One thing I'm not sure about is what happens to the 'running balance' if you delete records - doesn't it mean that the 'running balance' is going to correct only for those records that remain in the database?  Or will you add a new row with some sort of 'carried forward' amount (a bit like you do when you initially created the application and the very first row you add is an 'opening balance'?
Anyway, hope this helps,
Regards,
Derek.