Scripting

Expand all | Collapse all

Error 200 in Method INTIREPORTENGINE.I've got a

  • 1.  Error 200 in Method INTIREPORTENGINE.I've got a

    Posted 07-01-2015 08:32
      |   view attached
    Error 200 in Method INTIREPORTENGINE. I've got a script that prints a GL Trial Balance to pdf - copied mostly from a post by KentMacall on SageCity. The script runs fine on my computer and on the client's server, but errors on the client's workstations. The error points to the line: retval = oGLReport.nInitReportEngine(). All retVals prior to the error check out. I've attached the error message. Thanks! Here's the script: retVal = 0 'Create ProvideX COM Object Set oScript = CreateObject (""ProvideX.Script"") 'The Init method must be the first method called, and requires the path to the MAS90 home directory oScript.Init(""M:\Sage 2013\MAS90\Home\"") Set oSS = oScript.NewObject(""SY_Session"") retVAL = oSS.nSetUser(""ALL"","""") retVAL = oSS.nSetCompany(""ABC"") retVAL = oSS.nSetDate(""G/L"",""20150531"") retVAL = oSS.nSetModule(""G/L"") retVAL = oSS.nSetProgram(oSS.nLookupTask(""GL_TrialBalance_ui"")) Set oGLReport = oScript.NewObject(""GL_TrialBalance_rpt"", oSS) options = ""SORTREPORTBY$=""""A"""";DB_TYPEOFBALANCE$=""""E"""";DB_FISCALYEAR$="""""""";DB_STARTPERIOD$="""""""";DB_ACCOUNTINGPERIOD$="""""""";DB_ENDPERIOD$="""""""";CB_ZEROBALANCE$=""""Y"""";CB_CONDENSEDPRINT$=""""N"""""" retVAL = oGLReport.nSetOptions(options) 'BEGIN EXPORT SPECIFIC LOGIC 'The following options and methods are the keys to exporting the report. 'nReportType is used to suppress the Export Selection dialogue (UI) that displays when exporting a 'report in Sage 100. This must always be set to 6 in order to suppress the selection dialogue. This must be 'set prior to calling the nProcessReport() method. Do not set this value at all if you want the export selection 'dialogue to display. oGLReport.nReportType = 6 'nInitReportEngine() is called to create the report object that is required in order to set the export options. 'This must be called before the call to nSetExportOptions() retval = oGLReport.nInitReportEngine() 'nSetExportOptions(nOuptutFormat, sOuputPath) is called to set the output format and path. 'nOuputFormat is a numeric value and can be one of the following values/export types: ' Ouput Format Values/Types ' 2 Rich Text ' 3 Microsoft Word ' 4 Microsoft Excel ' 5 PDF ' 9 Text ' 10 CSV ' 11 Tab Separated ' 12 Editable Rich Text ' 13 XML 'nOuputPath is the path where the file will be exported/created. This should be the full path and filename '(i.e. ""C:\temp\GL_TrialBalance.pdf""). This was tested using an existing path. nOuputFormat = 5 sOuputPath = ""C:\temp\GL_TrialBalance.pdf"" retval = oGLReport.nSetExportOptions(5, ""C:\TEMP\GL_TrialBalance.pdf"") 'nProcessReport(sDestination) is called with ""EXPORT"" as the destination which will export the report in the format and to the location specified in the nSetExportOptions() call above. retVal = oGLReport.nProcessReport(""EXPORT"") 'END EXPORT SPECIFIC LOGIC oSS.nCleanup() oSS.DropObject() Set oSS = Nothing Set oScript = Nothing msgbox(""Done"")


  • 2.  RE: Error 200 in Method INTIREPORTENGINE.I've got a

    Posted 07-01-2015 10:17
    With exception to the message ""Missing selection table for column $"", this script works for me in 2014 Advanced and creates the PDF of the report. Are you sure the ""M:"" drive is the same on both machines?


  • 3.  RE: Error 200 in Method INTIREPORTENGINE.I've got a

    Posted 07-01-2015 11:21
    Thanks Dan. Yes, they have Sage100 Standard so they all use the same path. BTW, I tried the unc path instead with the same result - works on their server, not on the workstations.


  • 4.  RE: Error 200 in Method INTIREPORTENGINE.I've got a

    Posted 07-01-2015 12:10
    It works (w/o ""Missing.."" message) on my 2014 Standard also. I don't know if it has anything to do with it, but I do have Crystal Reports installed on my workstation)


  • 5.  RE: Error 200 in Method INTIREPORTENGINE.I've got a

    Posted 07-01-2015 12:14
    Crystal Reports - let me look to see if Crystal is on these workstations. I'll report back - thanks!


  • 6.  RE: Error 200 in Method INTIREPORTENGINE.I've got a

    Posted 07-01-2015 12:19
    This is a button script correct? Is it an issue maybe of change the options to execute on server vs client or vice versa?


  • 7.  RE: Error 200 in Method INTIREPORTENGINE.I've got a

    Posted 07-01-2015 12:54
    Hmmmm...I get this error on a workstation to my 2013 Standard system!


  • 8.  RE: Error 200 in Method INTIREPORTENGINE.I've got a

    Posted 07-01-2015 13:06
    They're on v2013.00.4.0. Do you think it's a version issue?


  • 9.  RE: Error 200 in Method INTIREPORTENGINE.I've got a

    Posted 07-01-2015 14:06
    Or the version.


  • 10.  RE: Error 200 in Method INTIREPORTENGINE.I've got a

    Posted 07-01-2015 14:06
    I get this on my 2013 server as well. Research indicates is a OS issue, but the same workstation that worked with 2014 Standard fails when run as a workstation to 2013 Standard. I suppose that points to the server?


  • 11.  RE: Error 200 in Method INTIREPORTENGINE.I've got a

    Posted 07-02-2015 00:27
    I'll bet on v2013 it required an additional command prior to InitReportEngine() maybe the one to set the template desccription: ` retVal = oGLReport.nSelectReportSetting(""STANDARD"") retVal = oGLReport.nSetPartialRecord(""Plain"", oScript.Evaluate(""CPL(""""IOLIST TemplateDesc$"""")"")) ` 'not sure above if it's nEvaluate(blah blah) or just Evaluate (blah blah)


  • 12.  RE: Error 200 in Method INTIREPORTENGINE.I've got a

    Posted 07-02-2015 09:09
    Added these two lines above InitReportEngine (BTW it's Evaluate (blah blah) - the object doesn't support nEvaluate) It works on my PC and on the client's server, but still not on their workstations. I've got Crystal installed on the workstation, so that's not it. Not sure if it's version or environment. I'm inclined to agree with @DanBurleson that it's probably version.