Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Parameters to ACCPAC for Record Selection

Status
Not open for further replies.

sherlick

Technical User
Jan 3, 2007
13
US
Hi All;

I have written a macro in ACCPAC 5.3 to call a Crystal Report from ACCPAC. The macro seems to be working and called the report. However, I cannot seem to pass in the record selection parameters. When the report runs, it pops up the Crystal Record selection screen. Is it possible to get the macro to skip this section and take the values from the form. Here is a sample of my code. I have also included the OERPT.INI section that I created.

Set rpt = ReportSelect ("OEBOFL01[OEBOFL01.RPT]", " ", " ")
Dim rptPrintSetup As AccpacCOMAPI.AccpacPrintSetup
Set rptPrintSetup = GetPrintSetup(" ", " ")
rptPrintSetup.DeviceName = "Cheque_Printer"
rptPrintSetup.OutputName = "IP_192.168.190.7"
rptPrintSetup.Orientation = 1
'rptPrintSetup.PaperSize = 1
'rptPrintSetup.PaperSource = 15
rpt.PrinterSetup rptPrintSetup
rpt.SetParam "SFINV", sFromInvoice
rpt.SetParam "STINV", sToInvoice


rpt.NumOfCopies = 1
rpt.Destination = PD_PREVIEW
rpt.PrintDir = ""
rpt.PrintReport


** Object ID = XXXX Order Entry Applet **
[OEBOFL01]
heading="Bill of Lading"
crystal=OEBOFL01
orientation=portrait
paper size=1
optparms=2
2=SFINV STRING
3=STINV STRING


Any ideas?

Stephen
 
That code looks perfect. Try setting HKEY_LOCAL_MACHINE\SOFTWARE\ACCPAC International, Inc.\ACCPAC\Debug\REPCMD to "T" to debug.

Jay Converse
IT Director
Systemlink, Inc.
 
The Crystal parameters are case sensitive, so make sure in the Crystal report they are actually SFINV and STINV and not something like sfinv or SFinv....
 
Hi Jay and Ettienne;

I managed to get it working by adding in the PATH, EXT and SYSPATH parameters. Weird.

Thanks for your prompt responses.

Stephen
 
One more quick question. Do you know how to get the different values that can be assigned to the PaperSize and PaperSource parameters for the printer setup?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top