Hi,
You need to associate the procedure in your script with the event (the event in your example is 'form1.tablegridPC_oncellclick').
To do this, on Form1, highlight the object form1.tablegridPC, open the object inspector 'events' tab and then doubleclick on 'oncellclick').
Please see the screenshot in the attachment and your fixed project.
Regards,
Derek.

1,802

(23 replies, posted in General)

Hi,
In frmstart.grdfornitore, you have fields from both anagrafica and arrivomerce - this is why, if there is no number for arrivomerce, they are not visible.
To get around this, I have split them into 2 tablegrids - one for anagrafica and one for arrivomerce.
The two tablegrids are linked with a search button (invisible) so when you click on a row in grdfornitore, it automatically shows all the arrivomerce rows for that client.  Personally, I think this is a much better way to show the information as it avoids all the duplication you had before.
Then all you need to do is click on the arrivomerce that you want to print and the report runs (the stampa button is also hidden);  this makes the process a bit quicker for the User.
I think this solves the issues that you have identified.
Regards,
Derek.

1,803

(23 replies, posted in General)

Hi,
Please try this version - the 'report' button is back on the 'frmstart' but the correct contract should now be printed when the relevant row in the tablegrid is selected.
Derek.

1,804

(23 replies, posted in General)

Hello,
I changed the 'main' table on the report from 'anagrafica' to 'arrivomerce' and moved the 'stampa' button to form 'frmarrivomerce' and that seems to select each 'arrivo merce' number correctly.
But I'm not sure if that is the best way to do it.  I will have a longer look at it if I have some more time.
One question - in the 'anagrafica' table, there is a field 'numerodocumento'.  This means that a customer cannot have more than one 'numerodocumento'.  Is that correct or can a customer have more than one 'numerodocumento'?
Derek.

Try using
(select count(*) from tbdata)
Please see attached.
Derek.

Привет Inkalika,
Я взял свой старый проект и попытался изменить его по вашему требованию.
Возможно, он может дать вам некоторые идеи о вашей структуре данных, а также о некоторых вещах, которые вы можете делать с макетом.
Существует небольшой сценарий, но он не является строго необходимым - это всего лишь автоматизировать несколько вещей.
Надеюсь, это поможет.
Как видите, я не играю в шахматы !!
С уважением
Derek.
(с гугл переводчиком)

1,807

(23 replies, posted in General)

Hi Jean,
What I meant was that I very rarely have the need to print anything out, so I don't consider myself a user of FastReport (or any other reporting tool). 
Derek.

1,808

(1 replies, posted in Russian)

Привет Sibprogsistem,
После Windows XP это больше невозможно.
Посмотрите на это сообщение - http://myvisualdatabase.com/forum/viewtopic.php?id=4597
Derek.

Hi Adam,
For me, the easiest way would be to use a calculated field and avoid doing it in the script.
(select round(avg(rating),2) from item where item.id_school = school.id) 
See attached.
Derek.

1,810

(5 replies, posted in Russian)

Привет,
Синтаксис такой:
(case
   when colour = 'WHITE' then 'BLACK'   
   when colour = 'BLACK' then 'WHITE'
   else                       'UNKNOWN'
end)   
Пожалуйста, посмотрите на прилагаемый пример.
Чтобы узнать больше, я использую эту ссылку:
http://myvisualdatabase.com/help_ru/
Также я изучаю сообщения на этом форуме
Derek.

1,811

(5 replies, posted in Russian)

Привет Inkalika,
Одним из самых простых способов является использование вычисляемого поля.
name||', '||city
Пожалуйста, посмотрите на пример.
С Уважением,
Derek
(с гугл переводчиком)

Hi Adam,
I'm guessing you'll be including it as part of some 'if' statement and processing through all the rows in the grid but the basic syntax that I'd use for the actual 'copy' of the footer value is:
  form1.tablegrid1.cells[1,1] := floattostr(form1.tablegrid1.columns[1].footer.formulavalue);
But there may be other ways too.
Derek.

1,813

(23 replies, posted in General)

Hello,
I don't use FastReport but I've had a look and I think you do it this way (see attached).
You must highlight the row in the grid and then click  'stampa' to print out the 'customer' on the report;  when you click another row and click 'stampa' it should print out a different 'customer' etc etc.
If you want to print all the rows at the same time, I think the report needs to be coded differently (perhaps with each 'customer' in a different report 'group header'?  (but I may be wrong)).
Sorry, I may have changed some of your report while I was looking at it, so you'll need to check the layout etc.
Derek.

1,814

(23 replies, posted in General)

It depends on what you are trying to do.
If there is a 1:1 relationship between the 'anagrafica' table and the 'data' table then you would normally hold 'arrivo' and 'scadenza' in the 'anagrafica' table - there is no need to have 2 separate tables.
If there is a 1:many relationship between the 'anagrafica' table and the 'data' table, you would normally add / save the fields belonging to the 'anagrafica' table on one form and then add / save the fields belonging to the 'data' table on another form.  The relationship between the 'anagrafica' table and the 'data' table is specified in your 'data structure and the link between the two forms ('frmfornitore' and 'frmarrivomerce') is through 'frmfornitore.tablegrid1 (MVD does this automatically for you).
If I understand the aim of your project, it looks like you have a 1:many relationship between 'anagrafica' and 'arrivomerce'.  If this is correct, then it makes more sense to hold 'arrivo' and 'scadenza' on the 'arrivomerce' table (and you can delete the 'data' table).
Anyway, have a look at the attachment and perhaps it will give you some ideas (I have done it in MVD 1.44 so you should be okay).
Derek.

1,815

(23 replies, posted in General)

Hello Reteinformatica,
The error message is correct.
The problem is that on 'frmfornitore' you are trying to add / save fields that belong to 2 tables - 'anagrafica' and 'data'. 
But the 'save button ('salva') can only save to  one table - you have configured it to save to table 'anagrafica' and  it is unable to save 'arrivo' and 'scadenza' to table 'anagrafica' because they belong to table 'data'. 
And this is why you get the error.
Regards,
Derek.

Hi,
Not sure if I quite understand what you want to do, but does the attached help at all? 
It shows
1) the current row in the tablegrid
2) the number of rows selected into the grid
3) the total number of rows in the table
Regards,
Derek.

1,817

(8 replies, posted in General)

Hello Cujos,
Can you try downloading this again and see if it works?  https://app.box.com/s/10uz426r6pbad3mwzrhxl579udp4xkvx
I've made one more change (deleting and then re-creating your mainform.pay search field). 
If that doesn't work, then I'm afraid I can't think of anything else to check.
Derek.

1,818

(8 replies, posted in General)

Hi Cujos,
I can't recreate it on my PC;  maybe lots of changes to the different forms and tablegrids you are using has caused the problem (although it SHOULDN'T) .
To try and solve the problem, I took your application and re-worked it.
1.  Now all of your information is filtered using the same tablegrid (you can still select more than one 'type' by using 'multi-select').
2.  Because you now do this all from 'Form1', I have deleted forms that are no longer needed;  this should make everything a bit quicker.
3.  I have added tablegrid footer totals so that you can see the effect that using filters has on the number of rows displayed.
4.  All of your searches now use 'wildcards' (%s%) and are interactive so the 'search' button can be hidden.
5.  Each 'search' fields is aligned above the column that it relates to (perhaps visually more logical?) and each search field has a 'hint' on it.
6.  Your look-up tables (for Kategorier and Typ) now use 'editable grids' and can be set up with 1 form (instead of 4).
7.  If you store images in the application, it quickly gets very large and might slow down so on 'inputform' I have changed 'storefile' to 'linkfile';  your documents are stored in a folder called 'documents' located within the 'ekonomi' folder (but it can be anywhere you choose).
Can you try running this version and let me know if you still have the same problem when adding values.  As the folder is too large, please download it using this link:  https://app.box.com/s/88tqeta1beleirmue9pdzj0py5g3ah6n
All of the above points are just suggestions - there is no 'correct' way to do things.
By the way, what version of My Visual Database do you use?
Regards,
Derek.

1,819

(8 replies, posted in General)

Hej Cujos,
I think it might have been because of how your filters were set up.  You don't need 'tablegrid1' as a filter criteria (see screen shot).  I added / changed a few records as a test and it seems to be fine now.
There are also a few things in your program that perhaps could be done differently which might make it  a bit easier for people to use and for you to maintain.
If it would be any help to you, just let me know.
Derek

1,820

(8 replies, posted in General)

Hi Cujos,
If you attach your project (zip it without the 'exe' file), then I can take a look if you want.
Derek.

1,821

(5 replies, posted in General)

Hi,
No problem - at some stage, we've all left the 'show child records' button selected!
In answer to your question, yes, it is possible to filter on more than one value (see the option to select multiple values from the combobox in the attachment).  However, this function was introduced around Version3 so if you're using the free version of MVD, that won't be possible for you.
Please see the attachment for some examples of the different ways to filter (by no means all of the ways).  All of the ways in the attachment use standard MVD functionality (ie, no script is required - sorry Mathias!).
Derek.

1,822

(13 replies, posted in General)

Hi,
If you're meaning the extra lines with £0 values on the payroll breakdown, I don't know of any other way to get round it other than using 'reportsql' rather than 'report'. 
It's easy enough to not print out the item text and the zero value but that still leaves an empty line which doesn't look very good.
As I said earlier, I don't use FastReport very much so maybe someone else has some ideas.
Derek.

1,823

(4 replies, posted in General)

The error you encountered was because you hold your dates in a different format.
I tried using separate date and time fields because your datetime fields were not set up correctly in your original 'test' application (see screenshot in the attachment). 
As you need date and time in the same column, I've corrected this and everything looks okay at my end.

Hello Sibprogsistem,
это помогает?
Derek

1,825

(4 replies, posted in General)

Hi Raheel,
I'd do it like this (see attached) but there's probably other ways too that might be better.
Derek