76

(5 replies, posted in Script)

salahnecibi,

procedure Form2_OnShow (Sender: TObject; Action: string);
begin
    If Action = 'NewRecord' then Form2.edit1.Text := SqlExecute('Select Max(id) From tablename') + 1;
end;

If the value you are pulling is the primary key(id), It's ok to show this value, but I would be very careful in allowing users to manipulate this value.

77

(11 replies, posted in General)

If FindWindow('Notepad',nil) then ShowMessage('Notepad is running') else ShowMessage('Notepad is not running');

78

(31 replies, posted in General)

Yes, CDB is correct with how to write the key to the Registry. When the trial period is over you can show a form stating such and have a text field where they can enter the key that you provided them (one of the ones in your IF STATEMENT). Once they enter the key you can then use CDB's WriteString statement to store it in the Registry. From that point on your program will read the Regisrtry key and since it is one of the ones in your IF Statement, your program will allow your user to continue using your software. Hope this makes sense.

79

(31 replies, posted in General)

Yes you can remove the app name also.

80

(31 replies, posted in General)

Frank,
If you are using JB's script, then you should see your app name under the SOFTWARE folder in the Registry. Click on your app name and the registry entries for your app will be in the right side panel. Right-Click on each entry and select DELETE. It's ok to delete your own entries since your app should be rewriting them. You definitely do not want to mess with any other software entries, so be sure you are on your own app entry.

81

(3 replies, posted in General)

Frank,
I use this same method when trying to troubleshoot. Here is how to combine the two:

ShowMessage('Edit1 = ' + Form1.edit1.text);

You can substitute variables for the form fields. Keep in mind though that you may need to provide conversion functions if the variable is not a text string, ie intostr(intvar), datetostr(varDate), etc.

82

(9 replies, posted in Reports)

salahnecibi,
Not exactly sure what you are trying to do. It sounds like you are trying to import html code right into FastReport. I don't think you can do that. FastReport does allow some simple HTML tags in text objects. Look in the FastReport manual Chapter 2.4 (Page 19) for more information on that.


FastReport is robust enough for formatting that you do not need html tags for formatting, if that is what you are trying to do.

CDB,
I just tested your code and placed the result into an html editor and it displays correctly (all rows and all columns). Do you have any special characters in your columns that may be throwing it off?

84

(6 replies, posted in General)

Try this

const
  APP_NAME = 'My App Name';
procedure Form1_OnShow (Sender: string; Action: string);
begin
  Form1.Caption := '';
  if FindWindow(nil, APP_NAME) <> 0 then
  begin
      ShowMessage('This application is already opened, you cannot open it again.".');
      Form1.Close;
  end;
  Form1.Caption := APP_NAME;
end;

85

(4 replies, posted in General)

eyeman303,
That's the way to do it.

86

(13 replies, posted in Reports)

I am not sure what you mean by

can we use default report chekbox for more information????

87

(10 replies, posted in General)

If you use the script method, then you do not need a form to translate. Your users do not need to enter in the database connect info each time they start your program. I would recommend this approach.

88

(13 replies, posted in Reports)

bbrother,
See attached for a solution to your report. Select a record on the Form1 grid and click on NEW REPORT button.


Keep in mind that most all of us on the forum are volunteers and contributes whenever they can. Sometimes it may be a few days before somebody can respond. Personally I'm lucky if I can get on here once a week. I have my own clients to take care of and they come before this forum. So try to be a little patient. You'll get your answers from somebody.

89

(6 replies, posted in General)

abu7akm,
It appears you are trying to do everything on one form and what you are doing is not setup properly. Although MVD with a little scripting can do a lot on one form, it is a more advanced task. Since you are new to MVD I recommend reviewing the video lessons on the home page and even review the database examples to see how to create forms to interact with the database.


If you still are having trouble, come back here and ask for more assistance. But you should know the basics of  MVD first.

90

(8 replies, posted in Reports)

bbrother,
Welcome to MVD. There is a sum function in Fast Report to sum various columns in the detail bands of a report. If you could upload your project, it would be easier for people on this forum to provide solutions for you.

91

(2 replies, posted in General)

blackpearl8534,
Not sure if the attached is what you are looking for. Two ways are shown. One is shown as static images and the other is shown from a database based on the pump state.

anils,
Welcome to MVD.
The syntax of calculated fields is SQL. So you can use available references outside of MVD. On occasion there can be subtle differences between Sqlite and MySql. So depending on the database you are using you may need to adjust the SQL syntax for the appropriate database. But this is only in rare occasions.

93

(72 replies, posted in General)

unforgettable,
See attached for price/sum in tablegrid and report.

94

(72 replies, posted in General)

unforgettable,
See attached for print.


There are a bunch of sites for SQL. Here is one of many for learning: https://www.w3schools.com/sql/default.asp.

95

(72 replies, posted in General)

See if the attached works for you.

96

(12 replies, posted in General)

Frank,
Typically an object on a form has three parts to it. The form name that the object belongs to, the object (field name), and the property of the object. So it usually looks like this: formname.fieldname.property. An example is Form1.Edit1.Text

Therefore your If statement should be:

if frmHousing.cboRentOwn.Text = "Own" then
        frmHousing.hPurchaseDate.Visible := True else frmHousing.hPurchaseDate.Visible := False; 

97

(3 replies, posted in General)

Thank you.

98

(4 replies, posted in Reports)

jopowers68,
What you want to develop can be done by MVD. However, DriveSoft is not in the business of developing end user apps. They are the creators of MVD for us end user developers. I don't see anything in your scope that seems out of the ordinary, but it's up to you to put together the application. Maybe someone on this forum can either help you or maybe for a fee could develop it for you, if you do not want to take it on yourself.


As far as a chart on a report, here is an example of doing that.  FYI - The chart can be most any style, bar, pie, line, gannt, etc. 3D or flat, etc.
http://myvisualdatabase.com/forum/viewt … 450#p25450

99

(18 replies, posted in General)

Frank & Derek,
I recently developed a carryout dinner system for a local business. There are different stations in the process from order takers to preparers to deliverers, each using tablets without keyboards. It was easier for the end user to do single clicks in tablegrids. If you use the tablegrid cell click event rather than the tablegrid click event, you can still click the headers for sorting. I placed the record delete button on the order update form and created a very small script to do the deletion.  Frank, don't be afraid to do some scripting. Sometimes a little work on our part can make it a lot easier on the end user. I knew nothing about pascal before MVD and I am still learning some aspects of it as it relates to MVD. I maintain a code snippet database that I use for a reference guide if I forget something. Happy Computing!

100

(4 replies, posted in General)

Derek,
I have run into this situation also and it looks like Dimitry never responded to your request.


Dimitry can you look into this please.