76

(187 replies, posted in General)

derek wrote:

Hi DBK,
Please have a look at the attached.  I find it the easiest way of using images as buttons.
I simply associate an image with a hidden button.  Then in the script, you just click the associated button when the image is clicked;
You can make it a bit slicker if you want by 'moving' the image slightly to make it look like it's been clicked (I've done this on the 'calendar' image).
Perhaps this gives you some ideas.
Regards,
Derek.

Hello Derek,
Thank you very much for the example!
This is a really clever solution, as usual!
I am going to use this solution while i wait until Dmitry could add this feature smile
I feel that it would still be much faster if we could have a draggable 'toolbar' action to make these kind of buttons without scripting a clever workaround.

77

(187 replies, posted in General)

Hello,

I would like to see an easier way to use our own images as buttons (i do not mean changing the icon of a button but just use an image that has the same kind of properties/possibilities like you drag a button to the form) so you could possibly make the GUI looking more modern like you see in today's apps.

78

(16 replies, posted in General)

sibprogsistem wrote:
procedure Form1_OnShow (Sender: TObject; Action: string);
begin
   Form1.ComboBox1.Items.Add('test');
end;

Ah yes, it works, thank you!!

79

(3 replies, posted in General)

Hello,

Sometimes i also get the 'access violation' error, i did not have this problem on windows 7 but i do on windows 10.

80

(16 replies, posted in General)

Hello

procedure Form1_ComboBox2_OnClick (Sender: TObject);
begin
 ComboBox2.Items.Add('test');
end;

What could be wrong?

Thanks

81

(16 replies, posted in General)

DriveSoft wrote:
dbk wrote:

Hello,

I tried this but i cant get in to work in my project, could you provide an example?

Many thanks,

Kind regards

It depends how you use this ComboBox, please provide more details and attach your project.

Hello,

When i try to script it using onclick event i get an error 'undeclared identifier'

DriveSoft wrote:

another way:

if <Report."person.calc_qtynumbers"> = 'sometext'  then GroupHeader1.Visible := True else GroupHeader1.Visible := False;

thank you Dmitry!

I fixed it for now, i am comparing it to the id which is an integer instead against the text value that is entered in the table. This works for now but if something in the future would change (value of id) it would break.

Hello Dmitry,

Thank you very much for the example. I am trying to understand it.

Could you tell me how to compare the following to a TEXT value instead of an Integer?

<Report."person.calc_qtynumbers"> = 0;

Should it be like the following?

<Report."person.calc_qtynumbers"> = 'textvalue';

I notice your example uses the masterdata etc but i think for my purpose it would be much more flexible to use variables that i can inside a text label.

Hello friends,

So i think i am getting close.

Let's say i have this code in the report designer, and lets say table field haskids is a TEXT value, i want to match it exactly with the text value 'YES':

 var
       haskids: String;
       nokids: String;  

begin
       if <Report1."haskids"> = 'Yes' THEN      
       haskids:= <Report1."name">                            
end.

If this could work i then i could just enter [haskids] variable in a text label in the report where it should show up, if there are no kids then the variable has no value so nothing would show.

So basically i want to match the TEXT value of table field haskids with TEXT value 'Yes'.

Any ideas?

Hello friends,

I have checked the forum for a solution but i didn't seem to find one.

I'm thinking of a way to have a conditional statement in the report, i will give an example:

Let's say i have a table: parents and a table: kids. On my report, the parents details with kids should be displayed on the top of the page, if the parents do not have kids their details should be displayed on the bottom of the page.

So basically i would like a script that shows a report label (data) on a certain part of the report if a condition is met, if it is not met then show the same report label on a different location in the report.

Is there a way to do this?

Thanks in advance!

Kind regards

Hello derek,

Thanks again for your help, it works perfectly!
Also thank you very much for your example, i also learned something new from this: clever how you integrated the checkbox in the grid.

derek wrote:

Hi DBK,
Just a thought - have you tried setting the checkbox 'allowgrayed' property to 'true'? (please see attached screenshot).
If you don't, you'll find that when used as a filter, you'll get rows that ARE checked, rows that ARE NOT checked, but you won't be able to see ALL rows.
I'd be careful using different combinations of filters (edit, combobox and checkbox) as it can get quite confusing for the User (just a personal opinion).  If you do use a number of different filters, it's often worth having a 'reset' button that un-filters everything all at once.
I'm sure I've got an old project somewhere with lots of different filter options - if it's any use to you, I can try and find it and upload it.
Regards,
Derek.

Hello Derek,

Many many thanks (again!), this did the trick!
When i allow grayed all rows show up, which is great.

Do you know if there is a way i can set the property 'allowgrayed' automatically (syntax)?
Like: Form1.CheckBox1.allowGreyed;
This way i could see all results.

Or would it be better to just add a button to clear all values from the search filters?

Hello friends,

I am trying to make a tablegrid that i can filter (= search) based upon the values of textboxes/comboboxes and checkboxes. My table has a field with a boolean value, the data is entered in to the db by checkbox.

My search works perfectly if i try to search using a textbox or combobox or both. However, when i try to search with a checkbox, it will also display the results perfectly, but when i uncheck it seems it doesn't go back to the initial state (like it doesn't know that the checkbox is unchecked). I am probably doing something wrong but i can't figure it out.

The search is made through mvdb, no script.

Kind regards

DriveSoft wrote:

Sorry, corrected

SQLQuery('SELECT fieldname1, fieldname2, (case table_field when 1 then ''Yes'' when 0 then ''No'' else '''' end) as calc_field FROM table WHERE table.id = '+form1.Edit10.Text , Results1);

It works!!
Thank you very much Dmitry!!

DriveSoft wrote:
SQLQuery('SELECT fieldname1, fieldname2, (case table_field when 1 then 'Yes' when 0 then 'No' else '' end) as calc_field FROM table WHERE table.id = '+form1.Edit10.Text , Results1);

hello DriveSoft,

thank you, but i get a syntax error, ')' expected

Hello friends,

I have a calculated field in my table which calculates the result of the boolean field in the tablegrid.

case table_field when 1 then 'Yes' when 0 then 'No' else '' end

I have created a dataset to make a report like so

 SQLQuery('SELECT * FROM table WHERE table.id = '+form1.Edit10.Text , Results1);

This does not include the calculcated field in the dataset.

My question, how can i include the calculated field, or replicate it, for use in the report? So, if boolean = 1 i want to show 'Yes' in the report.

Kind regards

sibprogsistem wrote:
procedure Form1_ComboBox1_OnChange (Sender: TObject);
begin
   form1.Memo1.Text:=SQLExecute('SELECT nn FROM tt WHERE id = ' +form1.ComboBox1.sqlValue);
end;

procedure Form1_Edit2_OnChange (Sender: TObject);
begin
   form1.Memo1.Text:=SQLExecute('SELECT nn FROM tt WHERE id = ' +form1.Edit2.Text);
end;

Thank you sibprogsistem! It works!

Hello friends,

i am trying to make a dataset with a SQL query to get all rows from a table where the id should match the ID that is entered on the form (textbox name: Edit10).

Is it possible to take the value of textbox in the query? If not how should i approach this?

Many thanks in advance!

SQLQuery('SELECT * FROM table WHERE table.field_id = ??? ', Results1);

95

(16 replies, posted in General)

Hello,

I tried this but i cant get in to work in my project, could you provide an example?

Many thanks,

Kind regards

Hello Derek & other viewers,

I just found the solution, it's been a while since i used MVDB, i forgot to set the title in the settings dialog... i am not very bright.
Thanks for taking your time to try to help me Derek, much appreciated.

Kind regards

97

(1 replies, posted in General)

+1 for this suggestion, i would also find this very very helpful.

Perhaps just a screencast of Dmitry or any other user that is making a project from scratch, so we can follow step by step.

I also think it would help to make MVDB more popular and gain new users.

A YouTube channel maybe?

Hello Derek,

Many thanks for having a look, i sent you the project file.

Kind regards

Hello all,

it's been a while since i've used mvdb, recently started to tinker with it again, i started a small test project but i can't seem to get titles in the header of the tablegrid. I can't remember having problems with this previously. I'm probably overlooking something, can someone tell me what i am missing or doing wrong?

Thanks!

https://image.ibb.co/dCnQ2q/Naamloos.png

Dmitry, this is exactly what i was looking for, thank you so much!!
Also thank you for supplying/making the example file, this helps me a lot.