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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run FR report for another database than current?

Status
Not open for further replies.

XJ900

Technical User
Apr 13, 2007
27
US
I'm trying to run a financial report for another database other than the one I am currently in.

I already know how to open a session to the other database but I can't quite figure out how to get the financial reporter to pull the information from the open session rather than the current database.

Here is what I have so far:

Set SESSION = CreateObject("accpac.session")
SESSION.Init "", "GL", "GL1000", "53A"
SESSION.Open "ADMIN", "ADMIN", "AFKCOM", Date, 0, ""
'session.OpenDBLink DBLINK_COMPANY, DBLINK_FLG_READWRITE
Dim MDBlinkcmpRW As AccpacCOMAPI.AccpacDBLink
Set MDBlinkcmpRW = SESSION.OpenDBLink(DBLINK_COMPANY, DBLINK_FLG_READWRITE)



Dim glfrrpt As Object

Set glfrrpt = CreateObject("AccpacGL9100.AccpacMacro")
glfrrpt.CmdFRSelect "Q:\Statement Forms\Manager Apple.xls"
glfrrpt.CmdFRPrinterSetup "HP LaserJet 4000 Series PCL", "LPT1:", "10", "10"
glfrrpt.ReportType "1" ' 1=Actual, 2=Provisional
glfrrpt.Year "2007" ' Year is YYYY
glfrrpt.Period "3" ' Period is 1 - 13
glfrrpt.InclOptions "0" ' 0=Do not include options, 1=Include options
glfrrpt.SortBy "1" ' 1=AcctNo Order,2=Segment Order,3=AcctGroup Order
glfrrpt.FromAcctId ""
glfrrpt.ToAcctId "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ"
glfrrpt.FromAcctGroup "1"
glfrrpt.ToAcctGroup "16"
glfrrpt.FromAcSeg0 ""
glfrrpt.ToAcSeg0 "ZZZZ"
glfrrpt.AcSegReportAs0 "1" ' 1=Consolidated, 2=Separate
glfrrpt.CmdFRFileFormat 1
glfrrpt.CmdFRPrintEx MDBlinkcmpRW, "preview", 1, "", "", 0

Set glfrrpt = Nothing

To begin with I'm just trying to print a financial report from another DB called AFKCOM. Can anyone help me?

Thanks
 
Set glfrrpt = SESSION.CreateObject("AccpacGL9100.AccpacMacro")
 
Thanks, I got really excited for a second because that sounded pretty logical, but when I do that I get error 438 "Object doesn't support this property or method.
 
OK, I swear I will totally donate a whole $5 dollars to this site if anyone can help me with this problem. I'm getting desperate.

Thanks
 
Make it $50...
I think you are outta luck, I have bashed around a few options but they all print the report for the default Accpac session.
 
Well, I'm sure as my frustration increases so will my prospective donation.

Thanks for taking a look at it ettienne, I really appreciate it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top