Alpha Video Training
Results 1 to 12 of 12

Thread: Print Report with no detail records

  1. #1
    Member
    Real Name
    Patrick Buono
    Join Date
    Apr 2000
    Posts
    66

    Default Print Report with no detail records

    Is there a way to print a report with a Report or Page Header that has no detail records? By default Alpha prints a page that reads "No record for this report"

    Any help is greatly appreciated

  2. #2
    "Certified" Alphaholic Ronald Anusiewicz's Avatar
    Real Name
    Ronald Anusiewicz
    Join Date
    Oct 2000
    Location
    Southampton, MA
    Posts
    1,547

    Default Re: Print Report with no detail records

    I'm guessing you could create a report against any table that contains at least one record.
    Add one field to the detail section. Set the field's color to white or whatever color the paper will be.
    Alpha Anywhere v3.5
    Version 12.3, Build 2999
    MySql56 & DBF's

    Alpha 4, 5, Anywhere

    Ron Anusiewicz

  3. #3
    "Certified" Alphaholic Tom Henkel's Avatar
    Real Name
    Tom Henkel
    Join Date
    May 2002
    Location
    New Jersey, USA
    Posts
    1,858

    Default Re: Print Report with no detail records

    The question begs, WHY?

  4. #4
    Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,557

    Default Re: Print Report with no detail records

    Check the table prior to running the report.

    If not records are there, add a record with xbasic.

    Then run the report.
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  5. #5
    Member
    Real Name
    Patrick Buono
    Join Date
    Apr 2000
    Posts
    66

    Default Re: Print Report with no detail records

    I asked the same thing but, the client wants it as a positive confirmation that no records were added to table. The blank page with the line " No records" is not good enough for them

  6. #6
    Moderator
    Real Name
    James A. Talbott, Jr.
    Join Date
    Apr 2000
    Location
    Versailles, KY
    Posts
    1,426

    Default Re: Print Report with no detail records

    Instead of running the report with "No record for this report", why not display a message box to the screen with that effect?

    Jay
    Jay Talbott
    Lexington, KY


  7. #7
    Member
    Real Name
    Patrick Buono
    Join Date
    Apr 2000
    Posts
    66

    Default Re: Print Report with no detail records

    Jay

    I guess they like killing trees, but they want a hard copy for their files

    Pat

  8. #8
    Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,557

    Default Re: Print Report with no detail records

    Quote Originally Posted by sicomputerguy View Post
    I asked the same thing but, the client wants it as a positive confirmation that no records were added to table. The blank page with the line " No records" is not good enough for them
    So add the record to the table and fill a field with "No Records Found "+now() to print on the report. Might want to fancify the time display....

    Delete the record when the report has finished.

    There are multiple ways to handle this, but you'll need to think out of the box a bit.

    Let us know what the client really wants to see, how it's run now, and we'll try to come up with a way to make it happen.

    Combining a pre report check with a filter passed to the report (ie filter to the first record?) and a conditional object in the detail section on the report can do it.

    I don't know how complicated this report is now and how you can best modify it.
    Last edited by Al Buchholz; 02-16-2019 at 01:29 PM.
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  9. #9
    Member
    Real Name
    Mark Williams
    Join Date
    Dec 2005
    Posts
    313

    Default Re: Print Report with no detail records

    Would someone consider sharing a sample report that displays a dialog box when there are no records instead of the default behavior of printing a page that states there are no records for this report?
    Thanks

  10. #10
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,270

    Default Re: Print Report with no detail records

    You could add a conditional object to the form so that the query which selects records to print if it returns 0 displays the No records or whatever.
    However, I suspect you need confirmation that there are no added records in the TABLE, which is slightly different.
    So let us know a bit more about what needs checking can you?
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

  11. #11
    Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,557

    Default Re: Print Report with no detail records

    Quote Originally Posted by Mark Williams View Post
    Would someone consider sharing a sample report that displays a dialog box when there are no records instead of the default behavior of printing a page that states there are no records for this report?
    Thanks
    NoRecordsNoPrint.jpg

    Add this table to a database/workspace to see one method.

    NoRecords.zip

    You can check a variety of things to see if the no record message is appropriate. A query would tell you how many records would display.
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  12. #12
    Member
    Real Name
    Richard James
    Join Date
    Jun 2004
    Location
    Atlanta, Ga.
    Posts
    224

    Default Re: Print Report with no detail records

    I have several instances where I use one report to show detail where there is detail to be displayed and a second report which does not show any detail when there is none to be displayed. I name the second report with the same name as the first but with the letters 'MT' appended, indicating the report is empty. (eg. VacancyReport & VacancyReportMT) Before printing the report, I run a query to test for the existence of detail records to be displayed. If the result of the query is 0, then I print the 'MT' report. Both reports can be tied to the same table.

    Initially, I needed help to do this because I wasn't adept with queries. Here is the query I have used to test for the existence of any vacancy records to print.

    Code:
    query.order = ""
    query.filter = "(noticependingyn = .t.  )  .or. (dispopendingyn = .t.  ) .or. (applicationpendingyn = .t.  ) " + \ 
    " .or. (status = \"Dispo\"  .or.  status = \"Notice\"  .or.  status = \"Vacant\"  .or.  status = \"Vac-App\" .or. status = \"Vac-Dep\"  )" + \
    " .or. (status = \"Vac-Not\" ) "
    
    dim rcdCount as n = 0
    rcdCount = a5_get_records_in_query("tblUnitInformation",query.filter)
    If rcdCount = 0 after running the query, I print VacancyReportMT. You will have to develop your own query.filter.

Similar Threads

  1. How to: conditionally print a detail section on a report?
    By georgefurnel in forum Alpha Five Version 9 - Desktop Applications
    Replies: 7
    Last Post: 01-12-2009, 06:01 PM
  2. Eliminate spacing between 2 Detail Print Lines on Report
    By Rudy16 in forum Alpha Five Version 9 - Desktop Applications
    Replies: 13
    Last Post: 06-13-2008, 04:54 PM
  3. Report w/extra detail records
    By Steve Wood in forum Alpha Five Version 6
    Replies: 6
    Last Post: 05-11-2005, 01:56 PM
  4. Ordering Detail records in a report
    By Rob Schippers in forum Alpha Five Version 4
    Replies: 5
    Last Post: 12-06-2002, 10:56 AM
  5. Report - show no detail records
    By Tom Patten in forum Alpha Five Version 4
    Replies: 1
    Last Post: 04-20-2002, 07:29 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •