1

(7 replies, posted in General)

Adam,
I put in what you request, so when the reminder happens the sound byte will play the number of times specified in your reminder form. However, I'm not sure what the advantage is to having the alert sound multiple times. I agree with Derek's concept. I did this in one of my client's applications. I put in a reminder system and whenever a reminder happens a popup form is displayed with a sound. The user sees what the reminder message is and they have the option to either close the reminder out or set another reminder for a specified timeframe like 15 minutes or an hour, two hours, next day or whatever they desire. They don't have to go back to the original task reminder form to update it. You might want to consider that design.


Also, I hid the Play Once checkbox and the Loop checkbox in the reminder setup form. It is confusing if you are playing a sound a set number of times.

2

(7 replies, posted in General)

MERRY CHRISTMAS to everyone!

3

(13 replies, posted in General)

Alaa,
Look in my previous post. The project is attached there.

4

(13 replies, posted in General)

Alaa,
I put together a script to import into your participants. It does two things. If a database record with identical first and last names as the import file then the process will update the database record. If no first name or last name exists in the database then the record is inserted into the database. One thing to be careful with. If you have duplicate participants with the same name then the update process will update all the records having the same name. You need to make sure that your table maintains unique records. You might want to include another field in the duplicate check besides the name. Anyway, the attached should at least get you started in the right direction.

5

(13 replies, posted in General)

Alaa,
What you want to do can be done but it needs to be done through script. The standard import feature in MVD only does inserts, but you want to do updates for existing rows based on first name and last name, correct?


I will try to put something together for you in the next day or two. I'm extremely busy right now with my own projects.

6

(18 replies, posted in General)

Did you apply the script I provided in my previous post?

procedure Form1_TableGrid1_OnCellClick (Sender: TObject; ACol, ARow: Integer);
begin
     Form1.btnEdit.click;
end;

Maybe you should attach your project so we can take a look at what you are referencing.

7

(18 replies, posted in General)

Destiny,
What do you mean by "it blocks the Edit function"?


If you are looking to execute the edit on a single click, you can put into the script to click on the EDIT button in the OnCellClick event of the tablegrid.


procedure Form1_TableGrid1_OnCellClick (Sender: TObject; ACol, ARow: Integer);
begin
     Form1.btnEdit.click;
end;

8

(6 replies, posted in Script)

daamoucheacil,
A couple of years ago I put together a simplistic invoice system for someone else on the forum. I have attached it here. Maybe it can help you with your project. It is a very rudimentary application and is not meant to be an all encompassing supply chain application. It certainly isn't production ready.


In the attached project Invoices can contain stock items and non-stock items. For stock items It does maintain stock inventory quantities for you. In order to maintain stock item quantities for various scenarios, it does require a bit of scripting. For instance if you delete a stock item on an invoice line item, then that quantity needs to be added back into stock inventory. Product list will show products where the quantity on hand is less than the reorder point and will highlight those products in bold red so you can visually see the products needing to be reordered. It does not include your cost on products, but it could easily be added in the table and respective forms. Hope it helps.

9

(13 replies, posted in General)

Frank,
I put together the attached sample project for someone else on the forum. It will catch duplicates for a newrecord or a showrecord. It doesn't matter what case the user types in, it will catch the duplicate. Hope it helps.

10

(4 replies, posted in General)

sonixax,
See if the attached is the sort of thing you are looking for.  Although the project is called Formless_add it actually is not formless. It just uses the opening form to save the record with the record counter and SAVE button hidden. The DELETE button removes the last record.

11

(6 replies, posted in General)

Adam,
Keep in mind that calculated fields are not real fields in the database. It is basically sql code to calculate and produce a single value utilizing other fields from the database. They are only available during the running of the program and are primarily used in tablegrids and basic reports. If you want to utilize them in other ways such as you are doing with text fields, then you need to replicate the sql of your calculated field into your script. See attached.

Frank,
I typically do all my record selections through MVD rather than FastReport. I really never even tried to do any kind of filtering in FastReport and not sure exactly how to do it. Is there a reason why you need to do it in FastReport? If not, I would just do it in MVD. Attached are two ways to do it. One is through ReportSQL and the other is just a plain Report with a hidden search checkbox to indicate the SPARE field. There are actually four records in the table, but only two have the SPARE boolean field set to 0 (No). Therefore, when you click on the respective report buttons only two of the records will print. Hope it helps.

13

(11 replies, posted in Reports)

Hey Gang,
Let me put my two cents worth into this. I have a way where it does not require any extraneous empty data rows.and I think it will take care of the requirement. In the attached project I am using an overlay which places the order lines on the empty page. Then to get the total underneath the order grid lines I had to expand the Page Footer section and force place the total in its proper location. This works but if there are more than 10 lines I am not sure what it will look like. I did not test that part. There probably should be some script to limit the data lines from going over 10, unless you expand the grid.


Also, it takes a little bit of effort to create/manipulate the grid lines to matchup with the data. If you need to move the entire grid, just select all the grid lines and move it or if you need to move individual lines, just select that particular line and move it. If you add more grid lines then you will also need to expand the overlay and reduce the footer section and move the total to matchup with the grid cell for the total. Once everything is in place and the max rows on an order is defined, then this design should not need to be modified on an ongoing basis.


PS. The FastReport designer window is not large enough to show every component on the page due to the overlay, but all the components are there  in the footer. In a real project all the necessary footer info should be placed before expanding and placing the total in the expanded area. Expanding the footer section makes the bottom components invisible in the designer window, but they are there.

14

(11 replies, posted in General)

Frank,
I am not familiar with Lazarus. You should run this project thru MVD not Lazarus. The script file is present. What I was trying to show you is how to show the last service date and the next service date on the form and in the Equipment tablegrid. The two tables are most definitely related. This is a typical Master-Detail type relationship. The Equipment table is the parent and the Service table is the child. In other words for each piece of equipment there can be many services performed.


I would suggest re-downloading the project and run again.

15

(11 replies, posted in General)

Frank,
Along the same lines as Sparrow indicated see attached for an example that may help you.

16

(22 replies, posted in General)

Awesome!

17

(22 replies, posted in General)

Not exactly sure what you mean. Are you using a SqlQuery button or SqlExecute script? If you are using a SqlQuery button and you want all records when the variable is empty, the easiest way I can think of is to create another SqlQuery button with the WHERE clause removed, then check  for the existence of the variable and script click on the appropriate button. You could do the same with SqlExecute only you would remove the WHERE clause in the script rather than having a separate button.  Maybe you could explain a little more if I am off base.

18

(11 replies, posted in General)

I haven't seen your project. From what I can see the line of code you showed only displays info from the current record you are editing on the form. If you want to display the latest date (highest date) from a database table you can use the following line of code as an example.

Form1.edLatestDate.Text := DateToStr(SQLDateTimeToDateTime(SqlExecute('Select Max(TransDate) From Test')));

19

(18 replies, posted in General)

Destiny,
You have two buttons with ShowRecord action for the same tablegrid. You cannot have that. I removed the ShowRecord Action on "Modifier" button and kept the one on "Afficher" button and now it works.

20

(22 replies, posted in General)

Try this

hd.Completed_TS >= ' + _fromTime + ' Order By...

You may need to put quotes around it as follows

hd.Completed_TS >= "' + _fromTime + '" Order By...

21

(15 replies, posted in General)

Frank,
See attached sample for how to blank the date (using Jean's solution). When you populate the date using script you also need to clear (nullify) the format following the date set script so the date shows. I don't know how you populate your date, but In the example I use a button to set the date. Just adapt the concept in your program.

22

(22 replies, posted in General)

blackpearl8534,
Is there a reason why you can't use a temporary sqlite db for reporting purposes only.

23

(22 replies, posted in General)

Not without loading an Sqlite DB first. Unless Dimitry can provide another solution, I'm just not aware of another way.

24

(15 replies, posted in General)

Ok, check to make sure the script for Form1.DateTimePicker1.Format:=' '; is defined in your EVENT tab to make sure it is actually executing. It is probably in the OnShow event. Otherwise, you may need to upload your project so we can check it out.

25

(15 replies, posted in General)

Is the date on your form have the checkbox checked when you run it?