76

(12 replies, posted in General)

Hello EHW, Derek

EHW: A million thanks for that fact, I was really going crazy with that mistake. Very good for you, thank you brother.
Derek: Really very useful auto update, I think that way you look more professional work. Thanks to both of you, they saved me a lot of time.

Now..., any ideas about the second question I put in my first comment ...
Wenchester.

77

(12 replies, posted in General)

Hello again derek ...
Supporting me of the example that you gave me, I tried to add a pie chart where I can show the countries and the quantity per country, but it gives me an error and I do not know how to solve it ..., any ideas ??

Below I attach the version that includes graphics.

78

(12 replies, posted in General)

Hello derek ...
You supplied my first question, and I like the part of opening the location in the browser.
Now, about the second question, do you have any ideas?

79

(12 replies, posted in General)

Hello...

I have a question ... can this be done?

I have a table where I store the data of a person (name, surname, home address (text, latitude and longitude), region), in another table the name of the regions belonging to a country (Example: Japan).

- I want to show in a grid (region, people count) how many people belong to each region.
- I want to locate the particular address of each person on the map (limit the use of the map to the country). Can a map be used offline?

80

(5 replies, posted in Script)

Hello...

I want to automatically import the data contained in a CSV file.

This is the code I use, but I want it to be a predefined file that is in a folder inside the program root, not using a dialog window.

procedure frmMain_Button4_OnClick (Sender: TObject; var Cancel: boolean);
var
   userVar, modeVar : String;
   DateVar, TimeVar : Extended;
   OpenDialog: TOpenDialog;
   sl: TStringList;
   arrStr: array of string;

   i,c: integer;
begin
     OpenDialog := TOpenDialog.Create(frmMain);
     OpenDialog.InitialDir := ExtractFileDir(Application.Exename);

     if OpenDialog.Execute then
     begin
          sl := TStringList.Create;
          sl.LoadFromFile (OpenDialog.FileName);


          c := sl.Count - 1;
          for i := 0 to c do
          begin
               arrStr := SplitString(sl[i], ';');

               // Nombre
               if arrStr[0] <> '' then arrStr[0] := ''''+ ReplaceStr(arrStr[0], '''', '''''') + ''''
                   else arrStr[0] := 'NULL';

               // 1er Apellido
               if arrStr[1] <> '' then arrStr[1] := ''''+ ReplaceStr(arrStr[1], '''', '''''') + ''''
                   else arrStr[1] := 'NULL';

               // 2do Apellido
               if arrStr[2] <> '' then arrStr[2] := ''''+ ReplaceStr(arrStr[2], '''', '''''') + ''''
                   else arrStr[2] := 'NULL';

               // CI
               if arrStr[3] <> '' then arrStr[3] := ''''+ ReplaceStr(arrStr[3], '''', '''''') + ''''
                   else arrStr[3] := 'NULL';

               modeVar := 'Importado';
               userVar := inttostr(frmLogin.cbLogin.dbItemID);
               DateVar := Now;
               TimeVar := Time;

               SQLExecute ('INSERT INTO student (firstname, lastname, surname, ci, pestado, pparticular, mestado, mparticular, ujc, cdr, pcc, feu, fmc) VALUES ('+ arrStr[0] +','+ arrStr[1] +','+ arrStr[2] +','+ arrStr[3]+', 0, 0, 0, 0, 0, 0, 0, 0, 0);');

               SQLExecute('INSERT INTO registro'+
               '(dateadded, timeadded, firstname, lastname, surname, ci, mode, id_users) '+
               'VALUES("'+DateToStr(DateVar)+'","'+TimeToStr(TimeVar)+'",'+ arrStr[0] +','+ arrStr[1] +','+ arrStr[2] +','+ arrStr[3] +',"'+modeVar+'","'+userVar+'")');

               frmMain.Label22.Caption := IntToStr(i+1) + ' of ' + IntToStr(c+1);
               Application.ProcessMessages;
          end;


          UpdateDatabase('student');
          UpdateDatabase('registro');
          sl.Free;
          frmMain.TableGrid1.dbUpdate;
          frmMain.TableGrid2.dbUpdate;
          frmStaticsUser.TableGrid2.dbUpdate;
     end;
     OpenDialog.Free;

end; 

81

(4 replies, posted in Reports)

Hello
I have a problem in my Report, I have a checkbox in a user field that I want to show in my report to print, but it gives me an error and I do not get anything in the fields,

Below I leave an image to see how I want it to show and the error it gives me.

82

(2 replies, posted in General)

Thanks you ehwagner, It's what I need

83

(2 replies, posted in General)

Hello Dimitri ...

A question. After doing a search and showing the results in a grid, this tells me the amount of results obtained. I want to have a button that when I pass the instruction "frmMain.TableGrid1.ClearRows;" This will erase the results of the grid and I will initialize the counter at 0.


How to do it?

84

(2 replies, posted in General)

Hello, Derek

Very good your solution, it is just what I needed, the 3 cases are very useful

Thank you very much...

Greetings, Wen

85

(2 replies, posted in General)

Hello,

I have a window to access the application. The users are related in a combobox and the password is inserted in a textbox, the question is as follows. How can I take the user selected in the "cb" to a label in another form?

Thank you...

86

(2 replies, posted in SQL queries)

Thank you very much, that's what I needed

Wen.

87

(2 replies, posted in SQL queries)

Hi, I want to filter this data for a given date range. I think the query is wrong, can someone help me?

SELECT *
FROM fechas
WHERE fecha BETWEEN "DateTimePicker1" AND "DateTimePicker2"  

88

(9 replies, posted in General)

DriveSoft wrote:

HD 720P Webcam

It is possible to select from a list the devices (webcam) connected in the PC???

89

(14 replies, posted in SQL queries)

DriveSoft wrote:

Please attach your project.

Hi, can you give me an email where to send it?

90

(14 replies, posted in SQL queries)

This is the error that I get when I click on the button.

91

(1 replies, posted in SQL queries)

Hello,
I have a checkbox, and I want that when I mark it, another checkbox is automatically marked ..., I know it's a simple thing, but I do not give with the problem .., I do it this way

procedure frmAddUser_chbRead_OnClick (Sender: TObject);
begin
if frmAddUser.chbRead.Checked = 'True' then
begin
frmAddUser.chbSearch.Checked = True;
end;
end;

92

(187 replies, posted in General)

Hello,

1- I think you could add within the properties of the button a call "Styleicon" or something similar, where you can change the design of the button icon ie Material etc.

2- The same with the calendar object, power between several designs of it.

3- Add an object (container) of the slider type where data contained in it can be displayed, for example, a Top of something

93

(3 replies, posted in General)

You can also do it this way

procedure frmMain_TableGrid1_OnClick (Sender: TObject);
var
   s: string;
begin
   if frmMain.TableGrid1.SelectedRow > -1 then
   begin
   // check permission to print
   s := VarToStr( SQLExecute('SELECT print FROM users WHERE (id = ' + IntToStr(idUser) + ');') );
   if s<>'0' then frmMain.Button3.Enabled := True;  // activate the button to print the record
   end;
     end;

This way checks if a user has printing permission, before enabling or not the button.

Wen.

94

(14 replies, posted in SQL queries)

DriveSoft wrote:

Beginning from version 3.4 in the reports, the names of the fields contain the names of the table. I just fixed report template and SQL query. Check it out:

I've already seen where the error is. Thanks .., now another question.

To obtain the data of a field in a Memo, I mean like this:

[Report. "sex.sexname"]

Now, to objener the value of a chekbox ???

I do it in the "DataField" property, I simply put the name of the data.
What now with what you told me do not know how to do it below I put ideas, is any one right?

sex.ujc

or

ujc

This last one worked for me when I did it for SQLReport.

95

(14 replies, posted in SQL queries)

DriveSoft wrote:
wenchester21 wrote:

Discard that there is a lack of data in the DB, since I have several records entered and using the SQL query works well, but not with multi-selection.

This is the action window

please attach your project.

This is a small example of what happens. When you open it, you will see that there are 3 buttons to print. The one in bold is the one that gives the error.

96

(14 replies, posted in SQL queries)

mathmathou wrote:

Hello wenchester21,

I think Dmitry is correct, his solutionis the simplest you can apply.
...

Hello mathmathou.

Yes, I take the idea and it is very useful to solve another problem I have. It's very similar to what you mentioned earlier. If you could upload an example of what I ask (print multiselection in a report) and another with the case insert them in a temporary table of in a stringlist or array, it would be very helpful.

Thanks for the help

97

(14 replies, posted in SQL queries)

Discard that there is a lack of data in the DB, since I have several records entered and using the SQL query works well, but not with multi-selection.

This is the action window

98

(14 replies, posted in SQL queries)

DriveSoft wrote:

Hello.


Why you use SQL query for the report?


You can do it without using SQL,


1. Just set up button with action "Report"
2. In the first list of setting the button "1. Select the components involved in the search" add component TableGrid
3. Use Object Inspector change the property of TableGrid: Additional > Options > goMultiselect = True
4. Now you can select severals records in the TableGrid using Ctrl button and print them.

Hi.

I used the way you told me and I get this error.

99

(14 replies, posted in SQL queries)

Pleaseeeeeeee, Helppppppp!!!!!

100

(14 replies, posted in SQL queries)

Hello, I do not speak much English, so I will try to formulate my question in the best possible way.

How can I make several selections in the "Table Grid" object and print them through a SLQQuery?

I print one with this code

SELECT
   
student.firstname,
student.lastname,
student.photo,
student.direcpart,
student.datoscadete,
student.parentname,
student.material,
student.yearstart,
student.yearend,
student.ujc,
student.cdr,
student.pcc,
student.fmc,
groupname.groupname,
sex.sexname,
prohod.proname,
munihod.muniname,
socialstatus.socialstatus,
university.nuniversity,
specname.specname,
student.surname,
student.phone,
student.ci,
student.id

FROM student

LEFT OUTER JOIN groupname ON student.id_groupname = groupname.id
LEFT OUTER JOIN sex ON student.id_sex = sex.id
LEFT OUTER JOIN prohod ON student.id_prohod = prohod.id
LEFT OUTER JOIN munihod ON student.id_munihod = munihod.id
LEFT OUTER JOIN university ON student.id_university = universidad.id
LEFT OUTER JOIN specname ON student.id_specname = specname.id
LEFT OUTER JOIN socialstatus ON student.id_socialstatus = socialstatus.id
WHERE student.id = $ id

if I want to print all I remove the last line.

But, how a selection?