简体   繁体   中英

Does anyone know how to fix these ssrs script file errors?

I copied the .rss script file contents from here: https://technet.microsoft.com/en-us/library/aa225813(v=sql.80).aspx , I took a sample .rdl file and put it in the same location, and I changed instances of "MyReport" to the .rdl files name.

I now get the following errors:

The specified script failed to compile with the following errors: C:\\Users\\xxxxx> "C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\vbc.exe" /t:exe /main:MainModule /utf8output /R:"System.dll" /R:"System.Xml.dll" /R:"System.Web.Services.dll" /R:"C:\\Program Files (x86)\\Microsoft SQL Server\\100\\Tools\\Binn\\rs.exe" /out:"C:\\Users\\xxxxx\\AppData\\Local\\Temp\\4\\ivfgtstk.exe" /debug- "C:\\Users\\xxxxx\\AppData\\Local\\Temp\\4\\ivfgtstk.0.vb" "C:\\Users\\xxxxx\\AppData\\Local\\Temp\\4\\ivfgtstk.1.vb"

Microsoft (R) Visual Basic Compiler version 8.0.50727.5483 for Microsoft (R) .NET Framework version 2.0.50727.5485 Copyright (c) Microsoft Corporation. All rights reserved.

C:\\Users\\xxxxx\\AppData\\Local\\Temp\\4\\ivfgtstk.0.vb(49) : error BC30456: 'Main' is not a member of '____ScriptClass'.

  clientScript.Main() ~~~~~~~~~~~~~~~~~ C:\\Users\\xxxxx\\AppData\\Local\\Temp\\4\\ivfgtstk.1.vb(14) : error BC30465: 

'Imports' statements must precede any declarations.

Imports System ~~~~~~~ C:\\Users\\xxxxx\\AppData\\Local\\Temp\\4\\ivfgtstk.1.vb(15) : error BC30465: 'Imports' statements must precede any declarations.

Imports System.IO ~~~~~~~ C:\\Users\\xxxxx\\AppData\\Local\\Temp\\4\\ivfgtstk.1.vb(16) : error BC30465: 'Imports' statements must precede any declarations.

Imports System.Web.Services.Protocols ~~~~~~~ C:\\Users\\xxxxx\\AppData\\Local\\Temp\\4\\ivfgtstk.1.vb(20) : error BC30002: Type 'Rep ortingService' is not defined.

  Dim rs As New ReportingService() ~~~~~~~~~~~~~~~~ 

My online searches have come up unanswered ( https://social.msdn.microsoft.com/Forums/sqlserver/en-US/ae90b9cb-f8a0-46a5-989f-aff4c5bc3190/script-runs-on-vbc-compiler-but-not-on-rs-utility?forum=sqlreportingservices as an example).

Assistance in solving this issue would be much appreciated.

I think your first issue is that the script you have copied is for the version of Reporting Services from SQL Server 2000 which you should probably not be referring to unless you are actually using SQL Server 2000.

Secondly the rs.exe utility can run Visual Basic scripts, as long as they are in a specific format . The code you have copied from the SQL Server 2000 page is an example of Visual Basic code that might be used when developing an application, not a script file. For example, it includes Import statements, which are not allowed in a script file for rs.exe

The basic format required for your Visual Basic script is:

Public Sub Main()
    ' Your code goes here.
End Sub

Take a look at the script samples that can be downloaded from Codeplex for some detailed examples of Reporting Services scripting.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM