Re: Print a selected record in a tablegrid

'Dipendenti'.'Città' AS "Dipendenti.Città,    miss quotes

Re: Print a selected record in a tablegrid

Hi Fabio, Sparrow,
It's good that you have fixed it.
However, for myself, I would not do things in this way - rather I would use just one report button that is associated with your 'search';  this then gives you the choice of
1.  reporting everything
2.  reporting everything that your 'search' has retrieved
3.  reporting a single record if you click in the tablegrid.
It's just my opinion but I think it gives you much more flexibility.
Derek.

Re: Print a selected record in a tablegrid

Completely agree with Derek. And everything will be easier.
But on the other hand, new knowledge has been obtained )))

Re: Print a selected record in a tablegrid

Kindly one more question. I entered the textboxes that are part of the search as per the attached screenshot.
But if I am beginning to understand something this action to print all records is not necessary, am I right?

Post's attachments

Attachment icon bello.jpg 119.82 kb, 36 downloads since 2023-04-03 

30 (edited by reteinformatica 2023-04-03 19:32:54)

Re: Print a selected record in a tablegrid

derek wrote:

Hi Fabio, Sparrow,
It's good that you have fixed it.
However, for myself, I would not do things in this way - rather I would use just one report button that is associated with your 'search';  this then gives you the choice of
1.  reporting everything
2.  reporting everything that your 'search' has retrieved
3.  reporting a single record if you click in the tablegrid.
It's just my opinion but I think it gives you much more flexibility.
Derek.

Hi derek, Using this route how should I go about printing only a record? I had tried changing the button to just "Report" without SQL but I didn't understand then how to print only the selected record.

Re: Print a selected record in a tablegrid

Hi Fabio,
Perhaps it is easier to explain if I make changes to your original 'Decora' project so you can follow what is going on.
There are a number of other things that you might want to consider apart from your 'report' question that you might not have yet encountered in MVD so I have included them too.  Feel free to use the things you agree with (if any!) and to ignore the things you don't.
1.
I replaced all of your individual search criteria with just one search field (it's a calculated field that you use to search for anything);  this way, the user doesn't have to think about which edit field to use to search for what (and it also frees up a lot of space on the form).   
Also, I prefer to use the 'incremental search' facility as I believe it to be more user friendly.
2.  So now you can use the same (calculated field) search field as the filter for your report as well.  This means you have the option to print everything, print what you have searched for or print a single row by clicking in the tablegrid.  Basically, the report will show what you can see in the tablegrid or what you have highlighted in the tablegrid.  Personally, I think it give the user much more flexibility.
3.
I think using a mixture of the 'menu bar' and other controls elsewhere on the form can be a bit confusing for the user - they have to play 'find the option'!  So another possibility is to take the menu bar options (in your example, change password, users, information) off the 'menu bar' and place them on the form itself;  in your example, I've actually put them on discrete tab sheets.
4.
I changed the pagecontrol tabsheet index so that 'dipendenti' is the first tabsheet when you go from left to right - it seems to be the logical tabsheet to start with and so it makes more sense to place it first.
5.
You can use 'buttons' instead of 'tabs' when you use pagecontrols - sometimes it helps to make things more noticeable but again, it's your choice - it's just a property of the 'pagecontrol' object.
6.
When you use 'role based access' together with 'tab sheets', it is very easy to control a user's access to entire areas of your application.  In your example, if you log-on as 'derek', notice that access to the 'Licenze' tabsheet is read-only and that the 'Utenti' tabsheet is not visible at all - all of this is done without script and it is very powerful.
Any changes I made to your script are all grouped together towards the end of the script.
Good luck,
Derek.

Post's attachments

Attachment icon Decora1a.zip 407.86 kb, 101 downloads since 2023-04-03 

Re: Print a selected record in a tablegrid

I really can't thank you Derek for the effort you always put in to help me. Of course, any advice from you is always welcome!