1

(4 replies, posted in General)

g0dmenuelz wrote:

Hello, I would just like to ask how what tools or what way can I configure the MVD form so that it can be used not on just 1 office but 3 offices interconnected together (Wan). We are connected with a Cisco router.

Will I need to use an sql, or will it need further advanced programming for it?
Basically there are 3 users that will need to have access to the database and they are from different buildings.

Thank you.

This type of requested configuration is not related to MVD, but there are many ways to do

First to all: exposing your database to the WAN (¡¡¡WARNING!!: Expose a database to the internet is unsecure if you dont know security steps to do, even if you apply all security steps, is not 100% secure)

Option 2: Use a vpn to conect all offices (is the best way and more sensate)

2

(1 replies, posted in General)

Hi to all, i migrate my database to mysql using MVD but when i try to save data from a form with "Foreign Key" it get strange behavior:

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

It was in MVD 5.2, and happen when try to save a combobox with a foreign key setted, it duplicated the FK, but in my form are only one combobox with that key

Not happen with SQLite Database

Thanks

EDIT: It happen with all forms with a Foreign Key

3

(1 replies, posted in Reports)

I try to make a report by script but the dataset is not loader, idk why, i follow some examples and topics in this forum but still not work

This is my code:

procedure frmMain_Button10_OnClick (Sender: TObject; var Cancel: boolean);
var
    frxDBDataSet1, frxDBDataSet2, frxDBDataSet3 : TfrxDBDataset;
    Results1, Results2, Results3 : TDataSet;
    asset_id : Integer;
begin
    //the variable I need to trigger the queries
    asset_id := frmMain.TableGrid1.dbItemID;

      //qyery one stored in dataset1
      SQLQuery('SELECT * FROM proposal WHERE proposal.id = "'+IntToStr(asset_id)+'"', Results1);

        //query two stored in dataset 2
        SQLQuery('SELECT * FROM quoting WHERE id_proposal = "'+IntToStr(asset_id)+'"', Results2);

      //query three stored in dataset 3
      SQLQuery('SELECT * FROM annex WHERE id_proposal = "'+IntToStr(asset_id)+'"', Results3);


    //transfer standard datasets results to report datasets
    frxDBDataSet1 := TfrxDBDataset.Create(frmMain);
    frxDBDataSet1.UserName := 'Proposal';
    frxDBDataSet1.CloseDataSource := True;
    frxDBDataSet1.OpenDataSource := True;
    frxDBDataSet1.DataSet := Results1;

    frxDBDataset2 := TfrxDBDataset.Create(frmMain);
    frxDBDataset2.UserName := 'Quoting';
    frxDBDataset2.CloseDataSource := True;
    frxDBDataset2.OpenDataSource := True;
    frxDBDataset2.DataSet := Results2;

    frxDBDataset3 := TfrxDBDataset.Create(frmMain);
    frxDBDataset3.UserName := 'Annex';
    frxDBDataset3.CloseDataSource := True;
    frxDBDataset3.OpenDataSource := True;
    frxDBDataset3.DataSet := Results3;


    //assign the three report datasets to the same report
    frmLogin.frxReport.Clear;
    frmLogin.frxReport.DataSets.Clear;
    frmLogin.frxReport.DataSets.Add(frxDBDataSet1);
    frmLogin.frxReport.DataSets.Add(frxDBDataset2);
    frmLogin.frxReport.DataSets.Add(frxDBDataset3);

    //DESIGN MODE - comment the following two lines and uncomment the preview mode lines to preview report

    frmLogin.frxReport.LoadFromFile('.\Report\prop.fr3');
    frmLogin.frxReport.DesignReport;


    //PREVIEW MODE - comment the following four lines and uncomment the above design mode lines to design report

    //frxDBDataset1.DataSet.Close;
    //frxDBDataset2.DataSet.Close;
    //Form1.frxReport.LoadFromFile(ExtractFilePath(Application.ExeName)+'Report\MyReport.fr3'); //this is my path and my report name, you need to use yours
    //Form1.frxReport.ShowReport;

    Results1.Free;
    frxDBDataSet1.Free;
    Results2.Free;
    frxDBDataset2.Free;
    Results3.Free;
    frxDBDataset3.Free;

    frmLogin.frxReport.Clear;
    frmLogin.frxReport.DataSets.Clear;
end;

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




This report button is in the second form in my project, thanks in advanced

4

(1 replies, posted in Script)

I solve! Here i Post the Result for help any other

procedure frmQuoting_lic1_OnExit (Sender: TObject);

begin
    if TEdit(Sender).Text = '' then
    begin
       TEdit(Sender).Text := '0';
    end;

end;

5

(1 replies, posted in Script)

Hi, i have several textbox in a form, i want to make an event "onExit" when the user leave the textbox with nil (nothing) value, the textbox autofill with "0"

but i want make only 1 function to replicate on all my textbox, how i can autocall the sender(textbox itself)??

Here an example of the code i try to use:

procedure frmQuoting_lic1_OnExit (Sender: TObject);
begin
    if Sender.Text = nil then
    begin
       Sender.Text := IntToStr(0);
    end;
end;

Thanks in Advanced!

Thanks! two question more

1-can you make me a example how in script i can use the result of a query like the name of a fr3 file?

2-can make a example of how composite a report with reportes stored in the database like you show in this thread?

myvisualdatabase.com/forum/viewtopic.php?id=4754

DriveSoft wrote:

Yes, you can, just describe your case in more details, and I'll try to help you.

I want to make a little "Commercial proposal" application

The goal is simple: the proposal report have a cover and main data the others pages will be filled with "modules", finishing with a last report with the resumen data.

Example: a proposal with 3 modules will merge the main fr3, fr3 "A", fr3 "B", fr3 "C" and one last fr3 with the final data, the composite report merge 5 fr3 reports.

In the app the user need to select wich modules will be merged in the report  selecting over 50+ modules, that will be saved in a child table of the proposal table


The idea is: the user print a proposal saved in their table, the code call the child table "modules" to get all records with relationship of the proposal, if in a table is saved module "A" Named "1234" the code load first the 1234.fr3, then the next module is saved like "B" with name "78910", the code load 78910.fr3 is second place to be showed after "1234" in the report

sorry for my bad english, thanks in advanced

Excellent, thanks for the example!!

A question:

Im new using MVD, that script can be used with a condition based in record?

Example something like:

if Phone = null then
       Employees.frxReport.LoadFromFile(ExtractFilePath(Application.ExeName)+'Report\1.fr3');

Please excuse my syntax, im still in learning phase

Thanks!

I want to start make a proyect but i need to know if MVD or FR can composite a report merging others FR3 files, and an example how please.