# WebDev error in script (Show Report in url)

**URL:** <https://forum.inductiveautomation.com/t/webdev-error-in-script-show-report-in-url/105690>\
**Category:** Ignition\
**Created:** [April 29, 2025, 2:38pm UTC](https://forum.inductiveautomation.com/t/webdev-error-in-script-show-report-in-url/105690 "2025-04-29T14:38:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kennethandrad](https://avatars.discourse-cdn.com/v4/letter/k/ce7236/32.png) [@kennethandrad](https://forum.inductiveautomation.com/u/kennethandrad)\
**Post date:** [April 29, 2025, 2:38pm UTC](https://forum.inductiveautomation.com/t/webdev-error-in-script-show-report-in-url/105690/1 "2025-04-29T14:38:27Z")

</div>

Hi, I want to create a WebDev script python but It don't show me the report that I had create, I tried it with this url [http://10.10.100.103:8088/system/webdev/Mantenimiento\_vn/Recursos/Preventivo\_E](http://10.10.100.103:8088/system/webdev/Mantenimiento_vn/Recursos/Preventivo_E) but show me this error Error: No visible constructors for class (javax.servlet.http.HttpServletResponse) some one can help me pls I want to show the pdf in a http link [http://10.10.100.103:8088/system/webdev/Mantenimiento\_vn/Recursos/Preventivo\_E](http://10.10.100.103:8088/system/webdev/Mantenimiento_vn/Recursos/Preventivo_E) please ,the report has the two parameters and it is the url of the report. Thanks a lot.

```python
def doGet(request, session):

    logger = system.util.getLogger("myLogger")
    logger.info("Iniciando la ejecución de doGet")

    path = "RENEW/PLANILLAS/PREVENTIVA_PLANILLA/PLANILLA_MANT_PREVENTIVO_E"
    params = {
        "ID_PREVENTIVA": 6228,
        "CATEGORIA": "INFRAESTRUCTURA NECESARIA"
    }

    try:
        report_bytes = system.report.executeReport(
            path=path,
            project='Mantenimiento_vn',
            parameters=params,
            fileType='pdf'
        )
        
        # Alternativa para versiones sin system.webdev
        from javax.servlet.http import HttpServletResponse
        response = HttpServletResponse()
        response.setContentType("application/pdf")
        response.setHeader("Content-Disposition", "inline; filename=preventivo_e.pdf")
        response.getOutputStream().write(report_bytes)
        response.getOutputStream().flush()
        
        return response
        
    except Exception as e:
        logger.error("Error: " + str(e))
        return "Error al generar el reporte: " + str(e)

```

---

<div class="post-metadata">

**Author:** ![kennethandrad](https://avatars.discourse-cdn.com/v4/letter/k/ce7236/32.png) [@kennethandrad](https://forum.inductiveautomation.com/u/kennethandrad)\
**Post date:** [April 29, 2025, 3:01pm UTC](https://forum.inductiveautomation.com/t/webdev-error-in-script-show-report-in-url/105690/2 "2025-04-29T15:01:29Z")

</div>

I solved using this code:

```python
logger = system.util.getLogger("myLogger")
 logger.info("Iniciando la ejecución de doGet")

 path = "RENEW/PLANILLAS/PREVENTIVA_PLANILLA/PLANILLA_MANT_PREVENTIVO_E"
 params = {
     "ID_PREVENTIVA": 6228,
     "CATEGORIA": "INFRAESTRUCTURA NECESARIA"
 }

 try:
     report_bytes = system.report.executeReport(
         path=path,
         project='Mantenimiento_vn',
         parameters=params,
         fileType='pdf'
     )
    return {
        "contentType": "application/pdf",
         "headers": {
             "Content-Disposition": "inline; filename=preventivo_e.pdf"
         },
         "bytes": report_bytes
     }

 except Exception as e:
     logger.error("Error al generar el reporte: " + str(e))
     return {"error": "Error al generar el reporte: " + str(e)}

```
