Actualmente tengo un error en carga automáticas de .rdl a un caperta en repositorio de reporting services.
Tengo varios rdl, los cuales debo cargar al reporting services, en su portal web.
> Blockquote
'Script Starting Point
' Script to deploy report to report server
' EXECUTE VIA COMMAND LINE
DIM definition As Byte = Nothing
DIM warnings As Warning() = Nothing
Public Sub Main()
' Variable Declaration
Dim TextLine As String = ""
Dim LocalDir As String = ""
Dim ServerDir As String = ""
Dim definition As Byte = Nothing
'Dim warnings As Warning() = Nothing
' Lectura del archivo de texto de configuración y asignación de valores a variables
If System.IO.File.Exists(FILE_NAME) = True Then
Dim objReader As New System.IO.StreamReader(FILE_NAME)
Do While objReader.Peek() <> -1
TextLine = objReader.ReadLine()
Dim parts As String() = TextLine.Split(New Char() {","c})
'TextLine & objReader.ReadLine() '& vbNewLine
LocalDir = parts(0)
ServerDir = parts(1)
Dim path As String = LocalDir
Dim fileEntries As String() = Directory.GetFiles(path)
Dim fileFullPath As String = ""
For Each fileFullPath In fileEntries
Try
Dim stream As FileStream = File.OpenRead(fileFullPath)
Dim NameWithExt As String = fileFullPath.Replace(path, "")
Dim NameOnly As String = NameWithExt.Replace(".rdl", "")
definition = New [Byte](stream.Length) {}
stream.Read(definition, 0, CInt(stream.Length))
warnings = rs.CreateReport(NameOnly, ServerDir, True, definition, Nothing)
If Not (warnings Is Nothing) Then
DIM warning As Warning
For Each warning In warnings
Console.WriteLine(warning.Message)
Next warning
Else
Console.WriteLine("Report: {0} CARGADO CORRECTAMENTE!", NameOnly)
End If
Catch e As IOException
Console.WriteLine(e.Message)
End Try
Next fileFullPath
Loop
Else
Dim MsgBox as String = "El archivo no existe o la ruta esta mal configurada en los archivos de configuracion"
End If
End Sub
'End of the Script
tengo un archivo de texto donde coloco las rutas de donde estan los rdl en mi equipo y la carpeta donde los deseo almacenar en el web services.
C:\Report\rdl_PRO,/Workmanager_ReportsV2
creo la carpeta en el portal
Donde la primera ruta corresponde al lugar en mi equipo y la segunda a donde lo deseo guardar en portal web.
Utilizo un .bat para invocar el rs.exe del reporting services, la rutina arriba indicada, y el archivo de configuracion.
Con la siguiente instrucción:
"C:\Program Files\Microsoft SQL Server Reporting Services\Shared Tools\RS.exe" -i C:\Report\Upload_Multiple_RDL_files.rss -s "http://equipoX/ReportServer" -v FILE_NAME="C:\Report\ConfigurationFile.txt"
Pause
Todo funciona bien si es reporting services 2016 o superior, pero en 2008, 2012 y 2014 me genera el siguiente error.
Unhandled exception:
The report definition is not valid or supported by this version of Reporting Ser
vices. This could be the result of publishing a report definition of a later ver
sion of Reporting Services, or that the report definition contains XML that is n
ot well-formed or the XML is not valid based on the Report Definition schema. De
tails: '.', hexadecimal value 0x00, is an invalid character. Line 1239, position
10.
He esta investigando y no logro dar con la solución, me pueden por favor ayudar, para poder hacerlo compatible con versiones inferiores a 2016 de reporting services, ya que debo cargar mas de 100 .rdl en varios reportings y es muy tedioso, ya que no ofrece la opcion de cargar varios sino de uno en uno.
Mil gracias.