[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: [sqr-users] Multiple PDF's files



Here is how I have done it.  I have a program that creates a report for each
school, and changing the name of the file

Begin-program
!Near the beginning of the program, first thing I do is extract the filename
!from the extension of the original report

   let $orig_report_file = $sqr-report
   do Determine-New-Report-Name

    begin-select
   <main processing logic>
      !if new campus code, start a new report
      do Create-Report-CampusCode
    end-selct
End-program


!***************************************************************************
*******
!Figure out original report name without extension
!***************************************************************************
*******
begin-procedure Determine-New-Report-Name
   !walk backwards from length of string to the first . - add campus code to
pdf
   !this keeps the reports in report manager, instead of always overwriting

   let $orig_report_file_extensions = ''
   let $orig_report_file_wo_extension = ''

   let #slen     = length(rtrim($orig_report_file, ' '))
   while (#slen > 0)
     let $char = substr($orig_report_file,#slen,1)
     if $char = '.'
       break
     end-if
     subtract 1 from #slen
   end-while

 if #slen > 0
    let $orig_report_file_extensions = substr($orig_report_file, #slen +
1,(length(rtrim($orig_report_file, ' ')) - #slen) )
    let $orig_report_file_wo_extension = substr($orig_report_file,1,(#slen -
1))
  else
    let $orig_report_file_extensions = ''
    let $orig_report_file_wo_extension = $orig_report_file
  end-if

  show 'orig:  .' $orig_report_file
  show 'woext: .' $orig_report_file_wo_extension
  show 'ext:   .' $orig_report_file_extensions
end-procedure


!***************************************************************************
*******
!Generate a new report name for each campus code
!***************************************************************************
*******
begin-procedure Create-Report-CampusCode

   if (length(rtrim($orig_report_file_extensions, ' ')) > 0)
     let $new_pdf_file = $orig_report_file_wo_extension || '_' || $camp_cd
|| '_'|| $AWARD_YR || '.' || $orig_report_file_extensions
   else
     let $new_pdf_file = $orig_report_file_wo_extension
   end-if

   show '$new_pdf_file=' $new_pdf_file

   new-report $new_pdf_file

end-procedure



-----Original Message-----
From: Bryson, Steven [mailto:Steve.Bryson@phh.com] 
Sent: Wednesday, March 31, 2004 10:44 AM
To: 'sqr-users@sqrug.org'
Subject: [sqr-users] Multiple PDF's files


I understand how to get multiple output files by declaring the report names.
What if I actually want to create the report name dynamically, is that
possible?

I have a 100 page report that I want to be 100 1 page reports.  Each report
represents a seperate person.
Example
A file name is created based off of a persons name found in the query.  I
want to open a report that has that persons name, write to it, close it and
then move on to the next driver.

I can get the files created just fine, however everything is being written
to the main pdf file.  
Any of this make sense?


"The sender believes that this E-mail and any attachments were free of any
harmful and malicious code or defects when sent.  This message and its
attachments could have been infected during transmission.  By reading the
message and opening any attachments, the recipient accepts full
responsibility for taking protective and remedial action regarding the code
or such defects.  The sender is not liable for any loss or damage arising in
any way from this message or its attachments."

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users