1

(5 replies, posted in General)

Thank you so much JB for your great script
This code as you mentioned only saves and loads the selected font settings from the Windows Registry; it does not install the .ttf font itself
I need to install a custom font that is not currently installed in Windows.
I want to keep the .ttf font file inside my application's folder and have a button on a form that, when clicked, installs the font into Windows so that it becomes available to the application.
The reason I need this is specifically for designing and displaying a form/report in the Report Designer. I need the Report Designer to be able to use this custom font even if the font is not already installed on the user's Windows system.
Is there a way in MyVisualDatabase to install a .ttf font programmatically from the application's folder, preferably by clicking a button?

2

(5 replies, posted in General)

Subject: How to Install a Custom Font from the Application Folder Using a Button

Hello,

I have a question about My Visual Database.

I would like to add a button to the main form of my application. When the user clicks this button, I want the application to automatically install a specific font that is included in the application's folder.

Is it possible to do this using My Visual Database? If so, could you please explain how I can implement it?

Thank you.

Hi every one
How can I make the TableGrid columns display from right to left?

I don't mean right-aligning the text inside the cells. I want to change the column order/direction so that the first column appears on the right, the second column next to it, and so on, similar to a right-to-left layout.

Is there a property or setting in My Visual Database to change the TableGrid column direction to RTL? Or even a script
Thanks alot

Hi sparrow

Thank you for your previous reply.

My situation is a little different, so I would like to explain it in more detail.

* My **Student** list is fixed. The number of members does not change during the year.
* Each student has a fixed monthly membership fee stored in the **Student** table (field: `fee`).
* The membership fee does **not** change during the year.
* Members cannot pay less than the required amount. At the beginning of every month, the exact same amount must be recorded for every student.

I created a form (auto) with:

* ComboBox3= Year
* ComboBox1 = Month
* Button1 = Register monthly fees

When I click the button, I want one SQL command to automatically insert a record for **every student** into the `Bank` table, using:

* `id_student` = Student ID
* `monthlyfee` = Student.fee
* `id_year` = Selected year
* `id_month` = Selected month

You suggested using:

```sql
INSERT INTO bank (id_student, monthlyfee, id_year, id_month)
SELECT id, fee, 2, 1
FROM student;
```

Should I execute this SQL in the **Button → SQL Query** action, or should it be executed from **Pascal Script** (for example using `SQLExecute`)?

Also, I have attached a **simplified sample** of my project. If necessary, I can attach the complete project as well.

Thank you for your help.

Hello,

I am developing a student management system, and I need some guidance about how to automate the monthly membership fee registration process.

In this software, I have a large number of student records. I need to register their monthly membership fees automatically instead of entering each record manually.

The annual membership fee is fixed for each student and is already stored in the Student table. However, I need to create monthly payment records in a TableGrid (for example, January, February, March, etc.).

My idea is to have two ComboBoxes for selecting the year and month. Then, by clicking a button, the software should automatically create a monthly membership fee record for all students based on the selected year and month.

For example, if I select:
Year: 2025
Month: march

and click the button, the software should automatically add a payment record for all students in the payment table, using the membership fee amount stored in the Student table.

Could you please guide me on the best way to implement this in My Visual Database?

Thank you.

I have attached a sample

6

(2 replies, posted in General)

Hi everyone
I have been working on a project regarding staffs of a particular company.
I want to record their personal resume. each resume has many attachments ( pdf files)
some staffs may have only 1 pdf attachment and some may have more than 10 attachments.

1) is there any way that the user can add as many DBfile as he wants automatically using a button?

2) also when I create a DBfile and imported a PDF file, all of the files are stored in a particular folder something like the script below
(frmStaff.Edit1 is first name and frmStaff.Edit2 is last name)

begin
     if frmStaff.bSave.dbGeneralTableid = -1 then sID := SQLExecute('SELECT IFNULL(MAX(id), 0)+1 FROM Personel')
     else sID := IntToStr(frmStaff.bSave.dbGeneralTableid);

     frmStaff.DBFile1.dbCopyTo := 'Scan\'+frmStaff.Edit1.Text+' '+frmStaff.Edit2.Text;

end;

7

(8 replies, posted in General)

thank you Derek
It was my bad to confuse you
by "elementary teacher" I didn't mean only the phrase "elementary teacher" . I meant every elementary teacher (about 20 teachers) at a particular school.

8

(8 replies, posted in General)

Hi guys
in the attached project I used a combobox (Form 2)
what I need is that Elementary teachers should only be visible for the user "Derek" and high school teacher should be visible for "Identity"
but that combobox shows all the teachers for both users.
How can I fix it?

9

(8 replies, posted in General)

Hello.
I  need some suggestions.

I’ve created a project about the income and expenses of a school. It includes about 20 tables, each with several items, and many different forms. Now I want to use it for two different schools: an elementary school and a high school.

Is there a way to avoid having to recreate all the tables and forms again? It’s very time-consuming. I just want to be able to choose between the two schools at the beginning using a ComboBox.

Thank you.

10

(3 replies, posted in General)

expense tab in the frmMain has empty fields

i used a script but it shows an error

11

(3 replies, posted in General)

hi
is there anyway that an empty row in a tablegrid is not shown?

12

(10 replies, posted in General)

I read the parts of documentation related to thousand separator but unfortunately I couldn't find any answers
So I tried chatgpt  smile
it gave me two options:

procedure Form1_OnShow(Sender: TObject; Action: string);
var
  Total: Double;
begin
  Total := Dataset.Sum('Amount');
  TableGrid1.FooterText[1] := FormatFloat('#,##0', Total); // Adjust column index
end;

but dataset is not working in MVD
so there is another option suggested by chatgpt:

procedure Form1_OnShow(Sender: TObject; Action: string);
var
  qry: TDataSet;
  total: Double;
begin
  qry := SQLQuery('SELECT SUM(amount) AS total FROM sales');
  if not qry.IsEmpty then
  begin
    total := qry.FieldByName('total').AsFloat;
    TableGrid1.FooterText[1] := FormatFloat('#,##0.00', total);  // Adjust index if needed
  end;
  qry.Free;
end;

again not working
so only one option is left and thats you smile sparrow smile

13

(10 replies, posted in General)

thanks sparrow
its very kind of you
is there any way that the footer is also thousand separated?

14

(10 replies, posted in General)

hi sparrow
i have a quick question
in the last file you have uploaded, the table "Student" has 2 calculated fields:
calc_sum  &  Rem_amount
what I need to do is that when these fields are shown on the tablegrid, they should have thousand separator
is it possible for a calculated field to have thousand separator?
thanks

15

(2 replies, posted in General)

THANK YOU
I found my mistake
field type in the tables should be currency

16

(2 replies, posted in General)

Hi
I have a tablegrid with two columns: Name and salary
is there any way that the tablegrid column showing salary has thousand separator?

17

(3 replies, posted in General)

you are right
my bad
I should have attached a sample project
in the attached sample, all the textboxes are not null but in the form 2 the textbox value is zero
Am I doing something wrong or maybe only in my computer shows zero
how can  I clear that textbox

18

(3 replies, posted in General)

Hi
I have encountered a problem with not null
I have a table with a field. the field type is currency and it should not be null ( not-null box is checked)
when I create a textbox and choose that field and run the project, zero is written in that textbox
the default value of that textbox changes to zero so it is not null.
what can I do to clear that textbox in order for the project to consider it null

19

(10 replies, posted in General)

thank you sooooooo much sparrow for your effort
that is exactly what I needed
you have helped me a lot

20

(10 replies, posted in General)

thank you so much sparrow
you are great
that's exactly what I had in mind.
there is only one thing
is it possible that the tuition installments are done with "percent" ?
what I need is that in the "frmtuition" when you enter a digit showing "percent" the project calculate the payment based on that percent and in another field the remaining amount is shown
or vice versa
when you enter the tuition  payment the project calculate the percent

21

(10 replies, posted in General)

hi
I have been working on a project regarding revenues and expenses of a school.
I have encountered 2 problems:

1)
the sum of tuition is shown on ( "Gridtuition" in the form "frmStudent" )
is there nay way that in the main form of the attached project, the sum of tuition for each student is shown on a separate column in the tablegrid1 -frmMain?

2) students may not pay the whole tuition fee in one go and every time he/she may pay only some proportions of it.
what I need to do is that the whole tuition is shown and every time a student pays a proportion, the projects shows the sum of money that the student paid and the sum of money that he owes.

thanks guys

22

(24 replies, posted in General)

hi sparrow and thanks a lot
1- all the patients' data are stored in just one sheet of an Excel form
2- all of the title fields of the patients are similar with different data ( each row of the Excel has about 30 cells for specific antibiotic, 30 cells for number of that antibiotic, 30 cells for unit price and 30 cells for total price) if a patient does not take a particular antibiotic, the fields regarding that specific antibiotic are empty.
3- the title of the column of the excel are the same only the number of antibiotics that each patient took is different.
4- the attached Excel is exactly the same as the original excel form but with only 10 different types of antibiotic ( the original form has 30 types of antibiotics)
thank you so much for your help

23

(24 replies, posted in General)

Sorry It's my bad
I thought I have attached it
the excel form is like the attached one but with 35 types of antibiotics

24

(24 replies, posted in General)

Hi Everyone
Its me again with several problems looking for solutions
I have updated the sample that "Sparrow" developed.
The price textbox (Searchform) does not work so I decided to insert an advanced search button that somehow works fine.
The patients only take medicine in 2 departments of hospital: Clinic or surgery.
so I used a checkbox and one of these 2 should always be checked.
the only problem that I have here is regarding Import button.
I have recorded many patients in Excel form and converted to CSV format but I can't import the file into the project.
I searched the forum a lot looking tor import samples but the schema of this project is different and I don't know how to import since the Excel data should be imported to different tables of the project and that's what make it difficult to import.
Please guide me through the import
thanks a lot guys specially Sparrow

25

(24 replies, posted in General)

Now that's the script I have been looking forward to. smile
thank you so much Sparrow you rock