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
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