Jump to content
JasperReports Library 7.0 is now available ×

Error en Api Rest con Json como parámetro


ostasiulevicius

Recommended Posts

Estimados: tengo éste inconveniente, luego de leer muchos post aún no he logrado resolverlo:

JasperStudio (6.20.5) en Windows 10

JasperServer CE (8.2.0) en Debian 11 (Se amplió el parámetro maxParameterCount y maxPostSize (-1) de Tomcat server.xml)

El reporte funciona bien en JasperStudio,  sin importar la cantidad de registros que tenga el .Json, no tiene subreportes

Sourse del .jrxml:

<parameter name="jsonString" class="java.lang.String" isForPrompting="false">

<defaultValueExpression><![CDATA[]]></defaultValueExpression>

</parameter>

<parameter name="JSON_INPUT_STREAM" class="java.io.InputStream" isForPrompting="false">

<defaultValueExpression><![CDATA[new java.io.ByteArrayInputStream($P{jsonString}.getBytes("UTF-8"))]]></defaultValueExpression>

</parameter>

<queryString language="json">

<![CDATA[]]>

</queryString>

*------------------------------------------------------------------------

Al ejecutarlo via API REST con C#, no genera el reporte cuando tiene más de 2 registros el Json (o más de 9000 caractéres)

Fuente de la clase:

https://github.com/netinhoteixeira/jrs-rest-csharp-client

Código de Parámetros:

Dictionary<string, string> parameters = new Dictionary<string, string>
   {
                          { "jsonString", (My_Json) },
    };

Ejecución Program.cs: (Linea 248)

 

jasperserverRestClient.SaveToFile(My_Reporte, parameters, My_PDF);

 

En la Clase: (Linea 122)

var task = client.GetStreamAsync(url);
            Task.WaitAll(task);

Linea 105:

MemoryStream ms = new MemoryStream();
            this.GetTask(url, ms);

JasperReport Error :
 - MSG: Se han producido uno o varios errores.
 Data: System.Collections.ListDictionaryInternal
 Stack:    en System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken)
   en System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout)
   en System.Threading.Tasks.Task.WaitAll(Task[] tasks)
   en JasperServer.Client.Core.JasperserverRestClient.GetTask(String url, Stream stream) en jrs-rest-csharp-clientsrcJasperServer.Client.CoreCoreJasperserverRestClient.cs:línea 122
   en JasperServer.Client.Core.JasperserverRestClient.Get(String report, Dictionary`2 parameters) en jrs-rest-csharp-clientsrcJasperServer.Client.CoreCoreJasperserverRestClient.cs:línea 105
   en JasperServer.Client.Core.JasperserverRestClient.SaveToFile(String report, Dictionary`2 parameters, String filename) en jrs-rest-csharp-clientsrcJasperServer.Client.CoreCoreJasperserverRestClient.cs:línea 145
   en FacturaAfipImpresion.Program.Main(String[] args) en FacturaAfipImpresionProgram.cs:línea 248
 Source: mscorlib

Desde ya muchas gracias!

 

 

 

Link to comment
Share on other sites

Thank you for posting to the Jaspersoft Community. Our team of experts has read your question and we are working to get you an answer as quickly as we can. If you have a Jaspersoft Professional Subscription plan, please visit https://support.tibco.com/s/ for direct access to our technical support teams offering guaranteed response times.
 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...