Topic: Custom report based on field selection

Hi everyone, is there a way I can print reports based on field selection directly from the database. For eg: I have a database with a field status and only needs to print reports where STATUS = ACTIVE?

Thanks in advance for any help offered.

Re: Custom report based on field selection

Just thought of adding few more information since no one has replied.

  • I have an address book kind of database in which there is a 'status' field.
    I have designed it to get value ACTIVE or INACTIVE using combobox
    I have also managed to setup a form in which search data is displayed based on STATUS. I used filter section in Tablegrid settings to make it status=active.
    I tried designing a report but unfortunately it only displays the first record when re-opened again

So, just wondering is there a way for me to print a report probably by scripting to only include the records with my search criteria?

Any help would be appreciated.

Re: Custom report based on field selection

Is this the sort of thing that you're meaning (please see attached).
If I understand your question, all you need to do is specify the active/inactive combobox as the search criteria associated with the 'report' button.
No script is required for something like this.

Post's attachments

Attachment icon 339.77 kb, 146 downloads since 2019-03-29 

4 (edited by Techfactor 2019-03-30 01:06:16)

Re: Custom report based on field selection

Brilliant, Many thanks for the reply Derek, Highly appreciated. That's exactly what my requirement is.

If its not too much, I was planning to have a report that I can print (Name and Address only)  direct based on status to a label sheet  (Avery J8160 Label sheet) which has three columns and seven rows. Is that possible with the same print option available or would that require separate buttons/form? 

Thanks again.

Re: Custom report based on field selection

Please see attached.
I don't use FastReport very much so there may be some sort of template you can use to match the layout to Avery J8160.
Failing that, it's just a case of adjusting the spacing etc within FastReport until it all fits correctly (my example has the 3x7 matrix but I don't know the label dimensions to align the data to).

Post's attachments

Attachment icon 342.86 kb, 183 downloads since 2019-03-30 

Re: Custom report based on field selection

Hi Darek, fantastic, As you suggested it just needs some adjustments. Actual sheet is A4 in size with 1.51cm (Top) x 1.3cm (Bottom) X 0.86 (Left) x 0.79 (Right) in MS-Word . However, adjusting the Top margin to 2.5cm pushes the fastreport in alignment with Avery J8160.

Many thanks for your brilliant work & assistance,
Thanks again Derek!