1 (edited by Techfactor 2019-04-04 14:24:44)

Topic: Bulk invitation to all persons in a DB

Hi All, I have just created an address book and wondering whether I can print invitation to all or selected persons in the Database with or without scripting?

Eg: I would like to send a party invitation to all or selected friends. What I am expecting to do is to have a template (invitation) on which the First Name, Last Name, Address and the party date / venue inserted grabbed from the Database and included in the invitation. So that I don't need to manually enter details for each and everyone.

Please see attached picture, ones highlighted in RED are the information I'd like to get from Database and the ones in Blue is fixed content on the template.

Is this possible? if yes, any help in this regard would be highly appreciated

Post's attachments

Attachment icon Capture.JPG 19.79 kb, 241 downloads since 2019-04-04 

2 (edited by derek 2019-04-04 23:33:07)

Re: Bulk invitation to all persons in a DB

Hello,
A few different ways of tackling this (see attached for one solution that doesn't require (hardly) any script).
The 'invitation' report is a bit 'rough and ready' but it gives you the general picture.
The 1 line of script is nothing to do with the basic functionality at all - it's just to update the tablegrid (calculated field) with the number of guests at a particular venue and is purely cosmetic - you can leave it out if you want to avoid having a script at all.
Regards,
Derek.

Post's attachments

Attachment icon techfactor3.zip 347.6 kb, 449 downloads since 2019-04-05 

Re: Bulk invitation to all persons in a DB

Hi Derek, as usual, brilliant and thanks for that. Just a question, can we have live search instead of the combobox on form6 (Guests)?

Regards.

Re: Bulk invitation to all persons in a DB

Hi There,
Not sure what you mean by 'live search' but the combobox on Form6 is already searchable so it gives you both options (pick from the drop down list or just type any part of the firstname or lastname).
Derek.

Re: Bulk invitation to all persons in a DB

Hi Derek, apologies for the delay, got your point! Perhaps, can I just do the invitation printing straight from ACTIVE / INACTIVE members instead of adding guests again?

Regards.

derek wrote:

Hi There,
Not sure what you mean by 'live search' but the combobox on Form6 is already searchable so it gives you both options (pick from the drop down list or just type any part of the firstname or lastname).
Derek.

6 (edited by derek 2019-04-08 12:01:01)

Re: Bulk invitation to all persons in a DB

Hi,
So if I understand your message correctly, you are,  in effect, wanting to use the status of 'active' or 'inactive' to determine who gets an invitation, rather than adding guests to a 'guests list table'.  There's no problem doing it that way (see attached) but you lose the functionality of being able to see who was invited to previous parties (because their status may have changed, or people may have been added  / deleted in the address book in the meantime).
Derek.

Post's attachments

Attachment icon techfactor3a.zip 348.12 kb, 427 downloads since 2019-04-08 

Re: Bulk invitation to all persons in a DB

Thanks Derek, as usual, you got it right, appearance of the INVITATIONS button after selecting the venue is a clever idea.
Just thought of two further ideas:

1. Can we have a text editor integrated within the application (if yes, content of the invitation including the dates can be edited within manually)
2. Also, making radio button selection instead of combo boxes (for search results) to make it more fun.

Regards.

Re: Bulk invitation to all persons in a DB

Hi,
There are a couple of ways that the content of the invitation can be created (basically set it up and save it as part of creating the invitation (which is how I do it in the attached example)  or just writing it 'on the fly' without saving it). 
In both instances, you then just pass the contents through as 'plain text' to the report.  I don't use FastReport much but I think I'm right in saying that this doesn't work if you try to use 'rich text' (although it would be nice if it did).
MVD doesn't support 'radio buttons' (at the moment);  the nearest equivalent is 'check boxes' but they are not mutually exclusive so each check-box needs to be visited individually to set it 'off' or 'on' and so can be rather confusing for the user (ergo - not so much fun!).
Derek.

Post's attachments

Attachment icon techfactor3b.zip 350.15 kb, 425 downloads since 2019-04-09 

Re: Bulk invitation to all persons in a DB

I am really impressed the way you are playing around within the limitations of MVD to put things right, Great and thank you Derek!

On the other hand hats off to MVD creators for being so practical, I am yet to explore the MVD with Numbers and Calculations (Finance). But so far, things are very impressive. Would appreciate if future versions can come out with better button styles + modern design aspects that can help developers create unique layouts.

Regards.

Re: Bulk invitation to all persons in a DB

Hi,
It's a fair comment about some of the 'standard' things like button styles, forms etc.
But there is also a lot you can do by using icons or images instead of standard buttons, a bit of imagination  and a few lines of script.
Have a look at the attachment for some light-hearted examples.
Regards,
Derek.

Post's attachments

Attachment icon techfactor3b.zip 1.31 mb, 438 downloads since 2019-04-09 

Re: Bulk invitation to all persons in a DB

Thats really cool smile you got the X-Factor Derek!

Re: Bulk invitation to all persons in a DB

Hi Derek, Impressed by your ideas, I was just trying to play around within the database and need your help to complete the following since I am missing the basics.

1. I kept the original address book data as it is.
2. Created a separate table for entering party date in to a field named date (DATE)
3. Created a separate table called venues entering venue information (TEXT)

Now, I wanted to print invitations using all three tables and stuck!

Fields I would use for the invitations are;
Name,Address,City,Postcode from table 'addressbook'
Party date from table party, filed 'date' (which will change in the future)
Venue from table venue, field 'venue' (assuming the venue is fixed)

Would appreciate your advise.
Regards.

13 (edited by derek 2019-04-10 13:53:35)

Re: Bulk invitation to all persons in a DB

Hi,
I'd probably approach it like this (see attached).
Took the opportunity to tidy a couple of things up as it was looking a bit messy - most things are now under the 'menu' option.
And as always happens when you add things on, change ideas etc, the script gets a bit disorganised but it's easy enough to straighten out when everything is settled.
Derek.

Post's attachments

Attachment icon techfactor3c.zip 1.31 mb, 415 downloads since 2019-04-10 

Re: Bulk invitation to all persons in a DB

Hi Derek, please find the experimental project attached herewith, I'd like to know what are the mistakes in that.
Attached picture is what the report should look like.

I am unable to upload the zip file here. Please download it from the link below:

https://www.dropbox.com/s/1xc62f2q6voxk … 3.zip?dl=0

Post's attachments

Attachment icon Capture.JPG 30.5 kb, 223 downloads since 2019-04-10 

15 (edited by derek 2019-04-10 23:38:41)

Re: Bulk invitation to all persons in a DB

Hi,
Your 'invitations' report requires information from the 'addressbook', 'venue' and 'party' tables. 
But because there is no relationship between the 'addressbook' table and the 'party' and 'venue' tables, the information from the 'venue' and 'party' tables isn't automatically built into the report data-set.
So you need to pass this additional information (venue, party start and end dates and party text) through to the report as variables instead.
This is what the script in the attachment is doing (I've stripped out everything that isn't needed so you can see more clearly what is going on).
On a different point, if you need to upload your project, you can delete the executable file (it's not needed) before zipping it to reduce the size of the zip file.
Derek.

Post's attachments

Attachment icon techfactor5.zip 353.05 kb, 412 downloads since 2019-04-11 

Re: Bulk invitation to all persons in a DB

Hi Derek, I followed the instruction but couldn't figure out how to insert the particular information to the report.
When I open in design view, I see labels [Edit1] , [Edit2 .. 4] appears in the report you've attached.

However, I am not sure how I can insert it in a new report that I design (how to select / where to choose from)?
Lets say I go to a new report design, what I get is the result fields I choose from the table addressbook, (its what I see when I select Button9 of Form1 from your design as well). but where do I get the other values of tables party and venues in report design?

Pls explain.

Post's attachments

Attachment icon Capture.JPG 69.53 kb, 191 downloads since 2019-04-11 

17 (edited by derek 2019-04-11 11:29:03)

Re: Bulk invitation to all persons in a DB

Hi,
Because there are no joins between the address book table and the venue and party tables, the venue and party details need to be put into local variables (edit1 - edit4) and added as search components in MVD (screenshot1).
When you go into FastReport, these additional variables (edit1-edit4) are located in the 'variables tab' (next to the 'data tab' on the right side of the screen) - see screenshot2.
Now you can just drag them onto the report like any other fields.
Derek.

Post's attachments

Attachment icon techfactor screenshots.zip 517.26 kb, 408 downloads since 2019-04-11 

Re: Bulk invitation to all persons in a DB

Hi Derek, I am very keen to understand this in deep. Please check the attached project and let me know, 1. Whether the script is doing anything? If no, what am I doing wrong? I assume, variables are not shown in the report design view (Creating New) due to this. if not, what else is required. For time being, lets assume I want the report to only include fields stdate and enddate from parties in addition to the address details for clarification purpose. (Hope i can include the venue information same way).

Thanks for your patience and time.
Regards.

Post's attachments

Attachment icon techfactorN.zip 350.68 kb, 392 downloads since 2019-04-11 

Re: Bulk invitation to all persons in a DB

Hi,
There are a few things you need to follow.
1.
A script is a set of instructions to be executed when a certain 'event' occurs to an object.  In your example, the 'event' is 'onclick' and the object is form1.tablegrid2.  But in your example, there is no link between the object/event and the script (see screenshot1).  To generate this link, double-click against the 'event' you want, the link will get created (see screenshot2) and the script editor opens.
Without this link, no code will get executed.
2.
When you're developing, if you use hidden fields, it's best to leave them visible until you've finished testing and are happy they are working properly.  I've made Edit1, Edit2 and Edit3 visible so you can check them - just make them invisible when you're finished.  In your example, click tablegrid2 and you'll see Edit1 and Edit2 get filled with the relevant dates, click tablegrid3 and you'll see Edit3 get filled with the relevant venue.
3.
You cannot use tablegrid2 and tablegrid3 as search criteria in the report because there is no relationship with 'addressbook' - that's the whole point of having to use Edit1, Edit2 and Edit3 as local variables.  Replace tablegrid2 and tablegrid3 in the report search criteria with Edit1, Edit2 and Edit3.
4.
With Edit1, Edit2 and Edit3 populated, click the 'Print Invitation' button and open the report in designer mode;  you should see Edit1, Edit2 and Edit3 are available (in the 'Variables' tab);  they can now be place on the report layout as required.
Derek.

Post's attachments

Attachment icon techfactorn.zip 1005.64 kb, 395 downloads since 2019-04-11 

Re: Bulk invitation to all persons in a DB

Hi Derek, thanks a lot, I now understand the approach properly. Once again, your patience and way of explaining is highly appreciated. As an alternative method, is there any possibility to transfer the stdate, enddate and venue information to the report / Edit 1..3 automatically upon loading the form, assuming I'll only have one record at a time in parties / venue?

21 (edited by derek 2019-04-11 22:38:24)

Re: Bulk invitation to all persons in a DB

Hi,
Yes, it can be done automatically. 
Before, the 'events' that filled Edit1, Edit2 and Edit3 was 'onclick' for tablegrid2 and tablegrid3. 
Instead, you can now use the 'onshow' event for Form1.  So as soon as Form1 is displayed, the script executes and Edit1, Edit2 and Edit3 are filled automatically (see attached).
Having an 'onshow' event for your first form is very common as there are often things you want to do at the very start of your program.
But you now want additional 'events' because the dates or the venue may get changed and you don't want to have to exit the program and then re-start just to pick up the changes. 
So we add 'events' for 'onclose' of the 'parties' form and 'onclose' for the 'venue' form so that any changes that have been made are immediately and automatically copied into Edit1, Edit2 and Edit3.
Finally, note that if you only have one row in the 'parties' and 'venue' tables, you can take the 'where clause' out of your script to simplify things.
Hope that all makes sense.
Derek.

Post's attachments

Attachment icon techfactorn2.zip 1006.12 kb, 489 downloads since 2019-04-12 

Re: Bulk invitation to all persons in a DB

Thanks a lot Derek, Learning MVD is becoming increasingly interesting! I need to learn a bit of scripting as it sounds now. Once again, many thanks for your  time and patience.
Regards.