26

(9 replies, posted in General)

1.  See attached.
2.  form1.menu := nil is one way to prevent the standard windows menu from appearing on the start form. 
Derek.

27

(3 replies, posted in General)

Hi Adam,
Perhaps try something like this (see attached).
Derek.

28

(9 replies, posted in General)

To add the 'day of the week' as text in FastReport directly, you could
1.  add a memo field and place it on the report layout  (see the screenshot in the attachment).
2.  create a 'before print' event for the Master Data band (see the screenshot in the attachment)
3.  insert the code that Sparrow gave you in a previous post or use the code already there (see attachment).
There may be other (better) ways to do this - I don't use FastReport very much so I'm probably not the best person to ask.
Derek.

29

(9 replies, posted in General)

To use a calculated field:
1  create a new field in your table with a field type of 'calculated field'
2. add the code (exactly as already detailed by Sparrow)
3. display the calculated field in the tablegrid (optional)
4. add the calculated field to the field selections in the 'report' action.
5. the calculated field can be referenced in 'FastReport' like any other field type.
Have a look at the attachment and the included screen shot.
Derek.

30

(9 replies, posted in General)

Hi Samtom, Hi Sparrow,
Personally, I would probably use a calculated field as suggested by Sparrow.
However, if you are not yet familiar with how to create a calculated field, another option is to hold the days of the week in a look-up table (see attached).
You also need to be careful viewing and creating records on the same form (Form1);  it is very easy to inadvertently create duplicate records if you have not added a bit of 'script' to prevent this.
Derek.

31

(1 replies, posted in General)

Hi,
Sorting in the tablegrid is disabled on a column by column basis

procedure Form1_TableGrid1_OnChange (Sender: string);
begin
    Form1.TableGrid1.Columns[0].Options := Form1.TableGrid1.Columns[0].Options - coCanSort; 
end;

Then repeat this code for all the columns that you want to disable sorting on.
Derek.

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

  form1.edprice.Text := form1.GridPartsUse.columns[3].footer.caption;

Derek.

33

(1 replies, posted in Script)

Hi Sonixax,
Try using a calculated field that concatenates all the individual fields that you wish to search on.
Please be aware that you need to use 'ifnull' in the syntax of your calculated field, otherwise a row that contains an empty field (ie first name is blank or middle name is blank or last name is blank) will not show in the search results.
Alternatively, if the fields you use in your concatenation are all mandatory, then this is not an issue and the syntax of the calculated field is simpler.
Have a look at the attachment as an example,
Regards,
Derek.

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

Извините, я забыл переустановить переменные в скрипте! sad
Если вам нужно добавить или изменить фактические диапазоны дат, просто внесите соответствующие изменения в скрипт.
Derek.

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

37

(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.

38

(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

48

(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.

49

(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.

50

(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
.