Hello everybody
is there way to add pdf pages imported from database as embedded inside printable report ?
Please see this screenshot as example


My Visual Database → Posts by FMR
Hello everybody
is there way to add pdf pages imported from database as embedded inside printable report ?
Please see this screenshot as example


Hi derek,
Your script work like magic, simple and accurate
Hello,
I need round up to number without fractions, I create this script but I believe there is much butter way to rounding up numbers.
Anyone will be welcome to optimize the script (the Project in Attachment)
Var
Correction : Real;
procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
begin
Correction := Form1.Edit1.Value - Trunc(Form1.Edit1.Value); // Find fraction value
If (Correction < 0.5) And (Correction <> 0) Then Correction := 0.5 Else Correction := 0;
Form1.Edit2.Value := Round(Form1.Edit1.Value + Correction);
end;29/01/2000 - 01/03/2025
30/01/2000 - 01/03/2025
31/01/2000 - 01/03/2025
01/02/2000 - 01/03/2025???
Hi sparrow
29/01/2000 - 01/03/2025 = 25y-1m-0d
30/01/2000 - 01/03/2025 = 25y-0m-30d
31/01/2000 - 01/03/2025 = 25y-0m-29d
01/02/2000 - 01/03/2025 = 25y-0m-28d
This is correct ? if wrong please write the correct answer.
Hi sparrow,
Thanks for your feedback, I make change in script to make the required correction as bellow
Var
AllDays, Year, Month, Day, RemDay : Int;
procedure Form1_ButtonCalculate_OnClick (Sender: TObject; var Cancel: boolean);
begin
AllDays := DaysBetween(Form1.DateTimePicker1.DateTime, Form1.DateTimePicker2.DateTime);
Year := Trunc(AllDays / 365.25); // Get Years.
RemDay := Trunc(AllDays - (Year * 365.25)); // Remining days from Year.
Month := Trunc(RemDay/30.4167); // Get Months.
Day := Trunc(RemDay - (Month * 30.4167)); // Get Days.
Form1.EditYear.Value := Year;
Form1.EditMonth.Value := Month;
Form1.EditDay.Value := Day;
end;
Approval Source https://www.calculatorsoup.com/calculat … ulator.php
By the way, the 1st way to find the Earth is Round: Eratosthenes (Died 194 BC and measured the circumference of the Earth with good accuracy at that time by using simple tools without lasers and satellites).
Hi jean.brezhonek, derek, sparrow,
I used deferent type of calculation (From old school) please test it and give me a feedback.
Var
AllDays, Year, Month, Day, RemDay : Int;
procedure Form1_ButtonCalculate_OnClick (Sender: TObject; var Cancel: boolean);
begin
AllDays := DaysBetween(Form1.DateTimePicker1.DateTime, Form1.DateTimePicker2.DateTime);
Year := Trunc(AllDays / 365); // Get Years.
RemDay := Trunc(AllDays - (Year * 365)); // Remining days from Year.
Month := Trunc(RemDay/30); // Get Months.
Day := RemDay - (Month * 30); // Get Days.
Form1.EditYear.Value := Year;
Form1.EditMonth.Value := Month;
Form1.EditDay.Value := Day;
end;Hi derek
Thanks, your script is amazing, that what I looking for.
Dear Friends,
I create apps that can calculate Years, Months and Days between 2 date, can any one improve the script ? I believe do some mistake or there is much butter way to calculate the date.
Any suggestion will be welcome.
The easy way by using Search option
I hope this will helping you
Bold as Active / Regular as InActive
procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
begin
If (Form1.Button1.Font.Style = fsBold) Then
Begin
Form1.Button1.Font.Style := 0;
Form1.Label1.Caption := 'Button 1 : InActive (Regular)'; // Replace with InActive Scenario code.
End Else
Begin
Form1.Button1.Font.Style := fsBold;
Form1.Label1.Caption := 'Button 1 : Active (Bold)'; // Replace with Active Scenario code.
End;
end;The only effect can do on button is font style (Bold, Italic, Underline and StrikeOut)
I used a Bold for button feature as (Active / Inactive)
Hello derek,
Thank you and 'Sparrow ' this is will help, I read now on Lazarus IDE form this problem caused by Windows limitation, we can use same code on Linux without problem
Hello MVD Fans,
How to change the text color of button ? ? ?
I try with this code
Form1.Button1.Font.Color := clRed;And this code
Form1.Button1.Font.Color := RGB(255, 0, 0);But no one of them change the color of button text !
Thank You sparrow
I Try Solution 1 Create a calculated field with the TEXT field type And Use Query Converter Text To Format It OK ...
But
Solution 2 tnxdatecolumn(Form1.TableGrid1.Columns[с]).formatmask := 'yyyy-mm-dd hh:mm:ss'
Nothing has changed
It would be great if you could show me a sample project.
Don't forget add Script call on (OnChange) for TableGrid
Thanks, this is will help me.
If you share the MVD with your friends by using DropBox or Google Drive, you can not run the apps by 2 users or more in same time, this is will cause problems with SQLite file, I believe due to the delay in writing data.
This is was my 1st step on my JSON API Project, It's Online version supporting https protocol, I hop it's give some help to you.
Hello,
I create a MVD app protected by login form (Username and Password) shared with my friends by DropBox, but when another body login to the MVD the SQLite created a conflicted copy
How to prevent conflicted SQLite copy problem or block Multi-Login to the app
Please fix my Project (Shopping List) contain 2 table (Header & Footer), How to print 2 linked table ?
Something like this
Perfect, Too many thanks
Hello MVD friends
Can I show the search results in ComboBox instead TableGrid ?
Hello MVD Family
I need example how to work with Supabase if MVD support it or Firebase
Thanks for any help

Derek.
Thanks, This now it's work perfectly
Hello
Can any one show me where is the wrong in this code ? I need update the database from editbox data directly.
procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
begin
SQLExecute('UPDATE Table_Name SET Field_Name = '+Form1.Edit1.Text+' where id = '+IntToStr(Form1.TableGrid1.dbItemID));
Form1.TableGrid1.dbUpdate;
end;My Visual Database → Posts by FMR
Powered by PunBB, supported by Informer Technologies, Inc.
Theme Hydrogen by Kushi