m.alin wrote:

Hello guys,

I have a table tblBOM (Bill of material) where I need to enter an article and the consumption.
I;ve selected the field quantity as type Real, but I have values of 0.00004 pieces which in my application (table grid) are shown as 4E-5.
When i open the record to edit it, the value 4E-5 us shown...so....how could I get the entire value as 0.00004?
i tried also to replace the dot (.) with comma (,), but then my shown value is zero.

thank you.
Best regards,
Alin


Please, download latest beta version, fixed
https://www.dropbox.com/s/vyne4lvinpjzl … a.zip?dl=0


Also set property NumberOnly = True for Edit component.

Сворачивающиеся/разворчивающиеся панели


http://myvisualdatabase.com/forum/misc.php?action=pun_attachment&item=6414&download=0


procedure Form1_Panel1_OnClick (Sender: TObject); // для всех панелей присваивается данное событие
begin
  Form1.Panel1.height := 30;
  Form1.Panel2.height := 30;
  Form1.Panel3.height := 30;
  TdbPanel(Sender).height := 200;
end;

procedure Form1_OnShow (Sender: TObject; Action: string);
begin
  Form1.Panel1.align := alTop;
  Form1.Panel2.align := alTop;
  Form1.Panel3.align := alTop;
  Form1.Panel1.height := 30;
  Form1.Panel2.height := 30;
  Form1.Panel3.height := 30;
end;

проект с примером:
http://myvisualdatabase.com/forum/misc. … download=1

procedure Form1_cbGroup_OnDropDown (Sender: TObject);
begin
    Form1.cbGroup.Tag := Form1.cbGroup.dbItemID; // запоминаем выбранный ID
end;

procedure Form1_cbGroup_OnCloseUp (Sender: TObject);
begin
    if (Form1.cbGroup.dbItemID <> -1) and (Form1.cbGroup.dbItemID <> Form1.cbGroup.Tag) then
    begin
        // SQL запрос
    end;
end;

по поводу пустого значения, а что если необходимо присвоить значение NULL? в этом случае можете убрать из условия (Form1.cbGroup.dbItemID <> -1)

129

(2 replies, posted in General)

1. Action "ShowForm" just makes form visible. May be you should use action "NewRecord"


2. Unfortunately, I can't figure out what the relationship is between "Show Record" and sqlValue

Да.

  Form1.Edit1.dbTable := 'tablename';
  Form1.Edit1.dbField := 'fieldname';

например так

var
   s: string;
   i1, i2, i3: integer;
begin
  s := IntToStr(i1)+IntToStr(i2)+IntToStr(i3);
  ShowMessage(s);

например так

var
   s: string;
   i1, i2, i3: integer;
begin
  s := IntToStr(i1)+IntToStr(i2)+IntToStr(i3);
  ShowMessage(s);

133

(20 replies, posted in Russian)

Кнопка уже выбрана по-умолчанию, но это не работает, когда используется многострочный текстовый редактор, в котором вы пишете выч. поле, т.к. нажатие на enter необхдимо, чтобы перейти в данном редакторе на новую строку.

Сделайте три кнопки.


1 кнопка с действием Печать, в которой выбраны компоненты для фильтравции, кроме TableGrid
2 кнопка с действием Печать, в которой выбран только компонент TableGrid


данные две кнопки сделайте невидимыми (Visible = False)


3. кнопка со скриптом

procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
begin
    if Form1.TableGrid1.dbItemID =-1 then Form1.Button2.Click else Form1.Button3.Click;
end;

после этого необходимо обновить грид

NameOfYourForm.YourTableName.dbUpdate;

а эту строку лучше записать так

NameOfYourForm.YourTableName.dbLimit:= Trunc(NameOfYourForm.Edit1.Value);

136

(15 replies, posted in General)

radsoft wrote:

Hello Dmitry,
sorry to go on about this but do you have any time frame for adding the gauge components to the charting please.
Thanks,
David

Hello.

Like this?
http://myvisualdatabase.com/forum/misc.php?action=pun_attachment&amp;item=6402&amp;download=0

SQLEXecute('UPDATE tablename SET id_foreignkey='+frmNote.ComboBox5.sqlValue+' WHERE id='+frmMain.TableGrid1.sqlValue);

138

(2 replies, posted in Russian)

Версия 6.4
http://myvisualdatabase.com/download/myvisualdb.exe



Что нового?

• Новая документция: http://myvisualdatabase.com/doc_ru/


• Добавлен метод AddPngFromDatabase для класса TImageList, таким образом можно загружать иконки для кнопок из БД.
Проект с примером: http://myvisualdatabase.com/forum/viewt … ?pid=35334

http://myvisualdatabase.com/forum/misc.php?action=pun_attachment&amp;item=6398&amp;download=0


• Теперь в свойстве Filter компонента ComboBox можно использовать вычисляемые поля

{calculated_field}=1

также в свойстве Filter компонента TableGrid, но с обязательным указанием имени таблицы, в котором находится вычисляемое поле.

{tablename.calculated_field}=1


•  Для класса TWord добавлен метод FindAndInsertPicture

Word.FindAndInsertPicture('{photo}',  'c:\picture.jpg');

139

(0 replies, posted in General)

Version 6.4
http://myvisualdatabase.com/download/myvisualdb.exe



What's new?


- Added method AddPngFromDatabase for TImageList class, so you can store icons for button in the database.
Example: http://myvisualdatabase.com/forum/viewt … ?pid=35334

http://myvisualdatabase.com/forum/misc.php?action=pun_attachment&amp;item=6398&amp;download=0



- Now you can use calculated fields in property Filter of the ComboBox:

{calculated_field}=1

and property Filter in the TableGrid

{tablename.caluclated_field}=1

- Added method FindAndInsertPicture for class TWord

Word.FindAndInsertPicture('{photo}',  'c:\picture.jpg');

140

(4 replies, posted in FAQ)

Works from version 6.4


var
    ImageList: TImageList;

begin
    ImageList:=TImageList.Create(Form1);
    ImageList.Masked:=false;
    ImageList.ColorDepth:=cd32bit;

    // size of images
    ImageList.Width := 24;
    ImageList.Height := 24;

    ImageList.AddPngFromDatabase('icons', 'pngfile', 1);
    ImageList.AddPngFromDatabase('icons', 'pngfile', 2);
    ImageList.AddPngFromDatabase('icons', 'pngfile', 3);

    Form1.Button1.Images := ImageList;
    Form1.Button2.Images := ImageList;
    Form1.Button3.Images := ImageList;
    Form1.Button1.ImageIndex := 0;
    Form1.Button2.ImageIndex := 1;
    Form1.Button3.ImageIndex := 2;
end.


Project example:
http://myvisualdatabase.com/forum/misc. … download=1

Работает начиная с версии 6.4


Загрузка иконок в кнопки из базы данных


var
    ImageList: TImageList;

begin
    ImageList:=TImageList.Create(Form1);
    ImageList.Masked:=false;
    ImageList.ColorDepth:=cd32bit;

    // size of images
    ImageList.Width := 24;
    ImageList.Height := 24;

    ImageList.AddPngFromDatabase('icons', 'pngfile', 1);
    ImageList.AddPngFromDatabase('icons', 'pngfile', 2);
    ImageList.AddPngFromDatabase('icons', 'pngfile', 3);

    Form1.Button1.Images := ImageList;
    Form1.Button2.Images := ImageList;
    Form1.Button3.Images := ImageList;
    Form1.Button1.ImageIndex := 0;
    Form1.Button2.ImageIndex := 1;
    Form1.Button3.ImageIndex := 2;
end.


Проект с примером:

Если вы установили для кнопки свойство Default = False, затем зашли в настройки для данной кнопки с действием "Сохранить запись" и нажали ОК, тогда свойство Default будет снова установлено в True. Другой причины для подобного поведения быть не должно.

143

(2 replies, posted in Russian)

Проект с примером
http://myvisualdatabase.com/forum/misc. … download=1

144

(6 replies, posted in Script)

Hello.


Yes, you can, example:

sql := 'SELECT fieldname ' +
           'FROM tablename';

145

(1 replies, posted in Database applications)

Supports only SQLite and MySQL.

Пример

procedure frmEmployee_bOK_OnClick (Sender: TObject; var Cancel: boolean);
begin
    frmEmployee.bOK.TagString := frmEmployee.dbAction;
end;


procedure frmEmployee_bOK_OnAfterClick (Sender: TObject);
begin
    if frmEmployee.bOK.TagString = 'NewRecord' then
    begin
        Form1.GridEmployees.dbItemID := frmEmployee.bOK.dbGeneralTableId;
        Form1.GridEmployees.ScrollToRow(Form1.GridEmployees.SelectedRow);
        if Form1.GridEmployees.CanFocus then Form1.GridEmployees.SetFocus;
    end;
end;

147

(16 replies, posted in Script)

just change this line

if add_file.ComboBox2.dbItemID = -1 then add_file.DBFile1.Enabled := True else add_file.DBFile1.Enabled := False;

to

if add_file.ComboBox2.dbItemID = -1 then add_file.DBFile1.Enabled := False else add_file.DBFile1.Enabled := True;

Что именно вы имеете ввиду под последней? Просто последняя строчка в компоненте? или последняя созданная запись?

Надо будет заняться этим, купить сертификат.

150

(2 replies, posted in General)

Your project folder already ready for distribution, just copy whole folder to any other PC.