Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

blalor (IS/IT--Management) (OP)
5 Nov 10 10:22
We are trying to eliminate the printing of G/L Transaction Listings for over 50 departments.  Recording a macro seems the easiest method for this, however when printing the Transaction Listings to a file it requires the end-user to manually specify the path and filename for each report.  The macro recording does not seem to pickup the address input during the recording and the code doesn't show it either.

Does anyone have a sample macro that outputs the transaction listing to a specific path and filename?

Thanks  
tuba2007 (Programmer)
5 Nov 10 18:15
Yes, but not to Excel.  PDF only.
warrenk1966 (TechnicalUser)
8 Nov 10 15:32
I have never done macros in ACCPAC but for other applications something like this works (you can specify the path to your liking rather than the default of where ACCPAC resides)

   SaveAs Filename:=Path & "\" & ".xls"

You may have to play with it a bit; hope it works out for you.
DjangMan (Programmer)
8 Nov 10 16:38
Go the other way:  Pull the transactions from GLPOST into Excel via ODBC.
BillLalor (IS/IT--Management)
10 Nov 10 18:14
Hi Tuba....  do you have an example of the script to output to pdf?
tuba2007 (Programmer)
10 Nov 10 18:27
Sorry, forget my first answer, I was thinking of regular Crystal reports, not Financial reports.

I just recorded an FR macro, and I see this line:

GLFRRPT.CmdFRPrintEx2 mDBLinkCmpRW, "file", 1, "C:\PROGRAM FILES\ACCPAC\SHARED\USER\ADMIN", "Balsum01_FR.001.xls", 0

That sure looks like a full path and filename to me.
BillLalor (IS/IT--Management)
10 Nov 10 19:14
Yeah, that's where my problem is.  From the FR it's pretty simple.  This is a GLreport that I'm trying to automate.
DjangMan (Programmer)
10 Nov 10 19:17
Seriously - create an Excel workbook.  Page one is where you enter a FY and FP.  The other sheets can then contain queries to each company.  Pull in records from GL post using the criteria from page one.  It'll be faster and have better formatting.
tuba2007 (Programmer)
10 Nov 10 19:35
Oh, then you do something like this:

===========================================
    Set rpt = ReportSelect("ARDINVO[" & sReportName & "]", "      ", "      ")
    Set rptPrintSetup = GetPrintSetup("      ", "      ")
    rpt.SetParam "SELECTBY", "1"             ' Report parameter: 12
    rpt.SetParam "FROMBATCH", Me.fldVendor
    rpt.SetParam "TOBATCH", Me.fldVendor
    rpt.SetParam "FROMENTRY", ARBatchHeader.Fields("CNTITEM")
    rpt.SetParam "TOENTRY", ARBatchHeader.Fields("CNTITEM")
    rpt.SetParam "FROMCUST", " "             ' Report parameter: 0
    rpt.SetParam "TOCUST", "ZZZZZZZZZZZZ"    ' Report parameter: 0
    rpt.SetParam "FROMDOCNBR", " "           ' Report parameter: 0
    rpt.SetParam "TODOCNBR", "ZZZZZZZZZZZZZZZZZZZZZZ"   ' Report parameter: 0
    rpt.SetParam "FCURNDEC", "2"             ' Report parameter: 0
    rpt.SetParam "ADDR01", CSCompany.Fields("ADDR01")
    rpt.SetParam "ADDR02", CSCompany.Fields("ADDR02")
    rpt.SetParam "ADDR03", CSCompany.Fields("ADDR03")
    rpt.SetParam "ADDR04", CSCompany.Fields("ADDR04")
    rpt.SetParam "CITY", CSCompany.Fields("CITY")
    rpt.SetParam "STATE", CSCompany.Fields("STATE")
    rpt.SetParam "POSTAL", CSCompany.Fields("POSTAL")
    rpt.SetParam "@SELECTION_CRITERIA", "{ARIBH.CNTBTCH} in " & Me.fldVendor & " to " & Me.fldVendor & " and {ARIBH.CNTITEM} in " & ARBatchHeader.Fields("CNTITEM") & " to " & ARBatchHeader.Fields("CNTITEM")
    rpt.NumOfCopies = 1
    rpt.Destination = PD_FILE
    rpt.Format = PF_PDF
    rpt.PrintDir = Me.lblExportFolder & ARBatchHeader.Fields("IDINVC") & ".PDF"
    rpt.PrintReport

===========================================

rpt.PrintDir is the folder and file name.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close