Alpha Video Training
Results 1 to 2 of 2

Thread: Report.Saveas Problem/Question

  1. #1
    Member
    Real Name
    Jeff Wolfe
    Join Date
    Jan 2001
    Location
    Chesapeake, VA
    Posts
    147

    Default Report.Saveas Problem/Question

    I have a button on a form that saves a report using the Report.Saveas routine. The sample of code is below:

    dim filter as c
    dim where as c
    dim rptdate as c
    dim rptvalue as c
    dim rptcustref as c
    DIM wherewhat AS C
    topparent.commit()

    Ordernum = topparent:Order_number.value
    filter = "Order_number="+"'"+trim(ordernum)+"'"
    where = trim(lookupc("F","100","Quote_location","master file","Co_Num"))
    rptdate = dtoc(topparent:Date.value,"6-")
    rptvalue = substr(topparent:Ref.value,1,15)
    rptcustref = trim(topparent:Tag_Num.value)
    what = rptvalue+"{"+rptdate+"}"+"{"+trim(rptcustref)+"}"+"{"+trim(Ordernum)+"}"
    wherewhat = where+what

    Report.saveas("Customer Quote","PDF",filter,"",wherewhat,.f.)

    This works great and allows me to save the report with any naming convention I dictate. The problem is I'm trying to free up real estate on my form and I'm trying to move these options to a custom menu. I had to change the code a bit as you can see below:

    dim filter as c
    dim where as c
    dim rptdate as c
    dim rptvalue as c
    dim rptcustref as c
    DIM wherewhat AS C
    :Order_Entry.commit()

    Ordernum = Order_Entry:Order_number.value
    filter = "Order_number="+"'"+trim(ordernum)+"'"
    where = trim(lookupc("F","100","Quote_location","master file","Co_Num"))
    rptdate = dtoc(Order_Entry:Date.value,"6-")
    rptvalue = substr(Order_Entry:Ref.value,1,15)
    rptcustref = trim(Order_Entry:Tag_Num.value)
    what = rptvalue+"{"+rptdate+"}"+"{"+trim(rptcustref)+"}"+"{"+trim(Ordernum)+"}"
    wherewhat = where+what

    Report.saveas("Customer Quote","PDF",filter,"",wherewhat,.f.)

    This code works fine until the Report.saveas command is initiated. The program hangs and I have to end A5 and restart. Was wondering if anyone can recreate this or see if I have an error in my coding. I have debugged and all variables fill as expected.

    Thanks for any assistance.

  2. #2
    "Certified" Alphaholic
    Real Name
    William Hanigsberg
    Join Date
    Apr 2000
    Location
    Toronto, ON
    Posts
    4,018

    Default RE: Report.Saveas Problem/Question

    Jeff:

    I was too busy to reply yesterday. Perhaps the issues is your form reference. What was the problem with leaving topparent in your menu bar code? You might change the alias to "this" as the context of the menu is inhereted from the form.

    If you have two copies of the form open and use the form's literal name in your code (as you have done), then the script will fail on one of the forms as no two forms can have the same name. So the first instance of the form has the bare name and any further instances have a digit appended to the name.

    Bill

Similar Threads

  1. report.saveas() run silent
    By Bill Parker in forum Alpha Five Version 6
    Replies: 3
    Last Post: 07-22-2005, 06:49 AM
  2. Report.SaveAs path?
    By roy in forum Alpha Five Version 5
    Replies: 2
    Last Post: 06-06-2003, 05:38 AM
  3. :report.saveas() problem
    By martinwcole in forum Alpha Five Version 5
    Replies: 2
    Last Post: 04-30-2003, 02:25 PM
  4. help with report.SaveAs
    By gkeramidas in forum Alpha Five Version 5
    Replies: 4
    Last Post: 02-15-2003, 07:43 PM
  5. Report.Saveas... for text printer?
    By Bill Warner in forum Alpha Five Version 5
    Replies: 4
    Last Post: 09-14-2002, 05:07 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
  •