Alpha Video Training
Results 1 to 7 of 7

Thread: Printing Multiple Reports

  1. #1
    Member
    Real Name
    Jonathan
    Join Date
    Apr 2010
    Posts
    134

    Default Printing Multiple Reports

    How can multiple reports be printed at the same time?
    For example - if we have a series of invoices, how can a selected group be printed at once? Can these be selected/filtered via a multi-select list box?
    The work-around which I have for now is as follows:

    Create a temporary table with 1 column (sales_id)
    Insert sales_id of each report required for printing into this table
    Query (mySQL) on which report is based links to this temporary table which means ony sales_id in this table are printed.

    Each report is fairly complicated - lots of calculations, sub-queries, etc which means that to preview/print individually from a grid would take quite some time.
    The above solution is ideal except for one thing...
    Each report can be 1 or more pages each - quite often just 3 or 4. The footer of the report displays a page x of y. Now when printing a group of reports, it displays the total number of pages. ie if 5 reports of 3 pages each were printed, it would say in the footer Page x of 15.
    Using this example, it there a way to display page x of 3 for each report even though the 'full' report is made up of 15 pages?

  2. #2
    "Certified" Alphaholic
    Real Name
    Larry Grupido
    Join Date
    May 2010
    Posts
    1,826

    Default Re: Printing Multiple Reports

    When you ask about printing multiple reports, are you actually printing two or more reports (creating 2 or more PDF files) or are you printing multiple RECORDS to the same report - so you end up with 1 PDF file, but 4 different records and data grouped together of 1-5 pages each?

  3. #3
    Member
    Real Name
    Jonathan
    Join Date
    Apr 2010
    Posts
    134

    Default Re: Printing Multiple Reports

    Yes - multiple records to the same report.
    I need the result to be one pdf file where pages are numbered according to the 'groups' rather than the total pages in the complete pdf.

  4. #4
    VAR
    Real Name
    Mike Reed
    Join Date
    Apr 2000
    Location
    Phoenix, AZ
    Posts
    668

    Default Re: Printing Multiple Reports

    Why not print separate reports as pdf files, then use a routine to combine the pdf files into one big pdf file? The one big pdf can then be printed, displayed or emailed.

    I find it difficult to get the page renumbering to work the way I wanted for groups, so this is a quick and fast way to accomplish that.

    Mike
    Last edited by Mike Reed; 03-09-2017 at 07:23 PM.
    Mike Reed
    Phoenix, AZ

  5. #5
    VAR
    Real Name
    Mike Reed
    Join Date
    Apr 2000
    Location
    Phoenix, AZ
    Posts
    668

    Default Re: Printing Multiple Reports

    I have routine a that creates separate files for each new invoice for a customer. Then I run a pdf combine function that takes all the separate invoices and combines them into one pdf. It uses the built in Alpha command 'pdf_append()' to do the combining.

    The process saves each invoice file in the 'private path' for the user. Each invoice file has the invoice number as a part of the file name, e.g. INV_12345.pdf. Then I use this function to combine the pdf files. The function sorts the file names alphabetically and combines them into one pdf file.

    Be sure to delete the combined pdf from the private path after it has been printed or emailed or you will have a huge mess.

    Mike

    FUNCTION prt_combine AS C (vcom_id as c )
    'this routine is used to combine invoices for a given property into one pdf file. Used where a customer wants one pdf for all invoices, in invoice number order.
    'vcom_id is the property ID number.
    'get a list of file names to be combined.
    file_list = filefind.get(A5.GET_PRIVATE_PATH()+chr(92) + "Invoice" + chr(92)+ "*.pdf",0,"PN")
    'sort the file names alphabetically
    sortsubstr(FILE_LIST,CRLF())
    'get a count of how many files to combine
    count = w_count(file_list,crlf())
    'here is where the work is done.
    IF count > 1
    'assign the filenames to an array
    DIM names[count] as C
    names.initialize(file_list)

    WHILE names.size() > 1
    'append one file to the next, then delete the appended file
    pdf_append(names[1],names[2])
    IF file.exists(names[2]) THEN
    file.remove(names[2])
    END IF
    'delete the appended file from the list
    names.delete(2,1)
    'resize the file list
    count = count - 1
    names.resize(count)
    END WHILE
    'get the filename for the remainig file
    file_list = filefind.get(A5.GET_PRIVATE_PATH()+chr(92) + "Invoice" + chr(92)+ "*.pdf",0,"PN")
    END IF
    xbasic_wait_for_idle(1)

    DIM vfilenew AS C
    DIM vpath AS C
    'get the path name from the file_list variable
    vpath = file.filename_parse(file_list,"dp")
    'create a new variable name that holds the full path of the combined report with a the new name.
    vfilenew = vpath + vcom_id + "_Invoices.pdf"
    'rename the file using the property ID number.
    file.rename(file_list,vfilenew)
    prt_combine = vfilenew
    END FUNCTION
    Mike Reed
    Phoenix, AZ

  6. #6
    Member
    Real Name
    Jonathan
    Join Date
    Apr 2010
    Posts
    134

    Default Re: Printing Multiple Reports

    The problem with printing each report separately is simply the time that it takes. Even if it takes 30 seconds to load up a single report/invoice (and sometimes longer), when there could be 15-20 of these at a time, you see that a lot of time is spent simply waiting on reports to load.
    Each report (invoice) is for a different customer which is why a single combined file is not a solution. Each report/invoice needs to be a separate report and ideally with its own page numbering.

    The current workaround which I have described above is perhaps the best solution in the meantime. It means simply typing the invoice numbers and then click print. For a print run of 15 invoices, its just a matter of entering the relevant invoice ids - the whole process is now only 2 mins max compared to up to 1 min per single report as previously was the case.

    The only drawback is page numbering. This is not a big problem and unless the customer comes back with a specific request for page numbers, the current solution will probably continue for now. I have put a continuation footer with 'Continued...' which seems to be satisfactory for now.

  7. #7
    "Certified" Alphaholic
    Real Name
    Govindan Gandhi
    Join Date
    Aug 2008
    Location
    New York, NY
    Posts
    4,294

    Default Re: Printing Multiple Reports

    Each report can be 1 or more pages each - quite often just 3 or 4. The footer of the report displays a page x of y. Now when printing a group of reports, it displays the total number of pages. ie if 5 reports of 3 pages each were printed, it would say in the footer Page x of 15.
    The only drawback is page numbering.
    would you please explain more on this.

    i understand so far, how you are printing the desired reports by creating a temp table to feed the invoice numbers (or the relevant numbers ).
    i also understand you have page numbers in the footer.
    do you have group turned on, so that each new group will start on a new page. and have you used the pageno(grp->invoice_number). but still it is not printing as it should, per invoice?

    i see you are in mobile/browser section. is that not possible to create an ux/dialog with a textbox or area to enter all the invoice numbers and call the report via sql command using the numbers provided
    or
    create a editable grid where you do not add any new record just able to delete.
    in the toolbar action button create a button to print the reports.
    then create an ux/dialog to enter the record into the grid.
    then call this grid from the dialog and print reports.
    or
    just you may have a better solution than mine.
    so it looks all done in sequence.
    thanks for reading

    gandhi

    version 11 3381 - 4096
    mysql backend
    http://www.alphawebprogramming.blogspot.com
    ggandhi344@gmail.com
    Skype:ggandhi344@gmail.com
    1 914 924 5171

Similar Threads

  1. "Printing" or generating reports to multiple files
    By agardk in forum Alpha Four Versions 7 and 8
    Replies: 1
    Last Post: 04-02-2007, 12:13 PM
  2. Printing multiple reports simultaneously
    By Jordans17x in forum Web Application Server v7
    Replies: 2
    Last Post: 07-28-2006, 06:29 PM
  3. difficulty printing multiple reports
    By Bill Maguire in forum Alpha Five Version 5
    Replies: 1
    Last Post: 08-11-2005, 04:06 PM
  4. Printing multiple reports per line item
    By Mike Champion in forum Alpha Four Versions 7 and 8
    Replies: 4
    Last Post: 08-07-2003, 12:15 PM
  5. PRINTING MULTIPLE REPORTS
    By dorseya in forum Alpha Four Version 6 and Prior
    Replies: 6
    Last Post: 10-02-2002, 12:32 PM

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
  •