Topic: Fast Report and a Table Grid

Hi all,
I have a Table Grid with a bunch of records in it.
The main purpose of the Grid is so I can pick a record and go to the form for that record.
That works OK.
-
I also want to be able to run a report showing All of the records in the Grid.
-
I created a Fast Report to print the info for all of the items in the Grid
This works fine as long as I DO NOT highlight any of the records in the Grid.
-
However if I highlight one of the records in the Grid then the report shows only that record.
I would like to always have the report show all the records in the GRID, whether or not I have highlighted a record.
-
And once I highlight a record in the Grid, then I am unable to de-highlight that record.
-
Thanks for your help, Frank

2 (edited by derek 2020-08-20 00:02:38)

Re: Fast Report and a Table Grid

Hi Frank,
When you place a 'report' button on your form, you select a search component for the records you want to print.  Some of the options are
1.  You could leave this blank in which case it will print ALL record in the table (not just those displayed in the tablegrid)
2.  You could specify tablegrid1 (I'm guessing that's what you're doing in your example) in which case the report will print all the records displayed in the tablegrid (if no row is highlighted) or just a single record (if a selected row is higlighted) .
3.  You could use a search criteria (which is the option I would go for).  How that works is as follows (using the example in the attachment).
*  place an edit field on the form (in my example, it's form1.edit1)
* define that field as the thing you want to report on (in my example, it's an order number)
* (optional) set the field's filter property to %s% (to allow for wildcard searches)
* on the report button, specify edit1 as the report's search criteria.
Then when you run the report, if edit1 is blank, it will report all the rows in the tablegrid.  If you specify an order no', it will report just that specific row.  If you specify a partial value (in my example, enter RET) and it will report all the RET order no's.
However, there is one additional thing that I would do.  You have already added form1.edit1 as a search criteria for the report but you can use the same search criteria (form1.edit1) to do a normal 'search' as well.  Why?  Because using the same search criteria (form1.edit1) for both the 'search' and the 'report' synchronises what you see in the tablegrid and what gets printed on the report.
All of which sounds way more complicated than it actually is.  Please have a look at the attachment and you'll see how the report mirrors the tablegrid selection.
One final thing (optional) is to copy the report button on form1 and paste it onto form2.  Then you can run the report from either form (but as you'll probably have guessed, when you run it from form2 it will print out the individual record you're looking at).
Shout out if something's not clear.
Derek.

Post's attachments

Attachment icon frank.zip 338.21 kb, 246 downloads since 2020-08-19 

Re: Fast Report and a Table Grid

Derek,
Your solution works great, you get 2 gold stars for this one smile
-
I only had to use part of your solution do get my report to work the way I want.
I did create a Text Field on my form
I then set my Report Button to search on the new field
I then set the new field to not-visible
This prevents the user from entering anything into the field
So this means that when I click on the Report Button it will always report on all the records in my table.
Also if the user double-clicks on one of the records in the Table Grid they will go to the form for that record. 
-
The other options you included look real good but I'm going to save them for later in case I need them.
-
Thanks again, Frank