Skip to main content
7-Bedrock
October 5, 2021
Solved

Passing input parameter to Windchill report through info engine

  • October 5, 2021
  • 2 replies
  • 3717 views

Hello,

I'm trying to execute a Windchill report from Thingworx using InvokeIETask with following inputs:

    "Task""ExecuteReportTemplate.xml",
    "Params": [{
            "Name""object_ref",
            "Value""OR:wt.query.template.ReportTemplate:1552736"
        },{
            "Name""input",
            "Value""startDate=\"2021-04-12\" AND endDate=\"2021-06-22\""
        }
    ]

but it results in error:

{
    "error": {
        "code"null,
        "message""The timestamp value \"\"2021-04-12\" AND endDate=\"2021-06-22\"\" could not be parsed.  The value must be parsed using one of the following Java formats: \"yyyy:MM:dd:HH:mm:ss z\", \"yyyy-MM-dd HH:mm:ss z\", \"yyyy:MM:dd:HH:mm:ss\", \"yyyy-MM-dd HH:mm:ss\", \"MM/dd/yyyy HH:mm:ss\", \"dd/MM/yyyy HH:mm:ss\", \"yyyy/MM/dd HH:mm:ss\", \"M/d/yy, h:mm a\", \"M/d/yy\", \"yyyy-MM-dd\", \"yyyy-MMM-dd\", \"yyyy/MM/dd\", \"yyyy/MMM/dd\", \"yyyy:MM:dd\", \"yyyy:MMM:dd\", \"yyyy,MM,dd\", \"yyyy,MMM,dd\", \"yyyy MM dd\", \"yyyy MMM dd\", \"MM/dd/yyyy\", \"MM-dd-yyyy\", \"MM:dd:yyyy\", \"MM dd yyyy\", \"MMM/dd/yyyy\", \"MMM-dd-yyyy\", \"MMM:dd:yyyy\", \"MMM dd yyyy\", \"dd-MMM-yyyy\" ."
    }
}
I played with different date formats, with or without escape quotes, single/double quotes, none of that helped.
Trying without input parameters startDate, endDate it works and returns the whole recordset.
 
On Windchill side the report template parameters and criteria are configured as shown on attached images.
If I run the report through Windchill UI it executes correctly respecting the startDate and endDate parameters, so I assume the report configuration is OK.
 
Does anyone know how to pass the parameters correctly, or have an idea what could be wrong here?
Thanks.
Best answer by IvanIlicic

Thanks @rhart for the suggestion, it didn't solve the issue but you pointed me in the right direction.

Here is the format which works:

    "Task""ExecuteReportTemplate.xml",
    "Params": [{
        "Name""object_ref",
        "Value""OR:wt.query.template.ReportTemplate:1552736"
    }, {
        "Name""input",
        "Value""startDate=2021-06-22 14:26:00, endDate=2021-06-22 14:27:00"
    }]

2 replies

16-Pearl
October 5, 2021

Hi @IvanIlicic

The date format is OK I think, but thereโ€™s two parameters in the same input.

Perhaps try to use a separate input for each parameter.

 

 

IvanIlicic7-BedrockAuthorAnswer
7-Bedrock
October 6, 2021

Thanks @rhart for the suggestion, it didn't solve the issue but you pointed me in the right direction.

Here is the format which works:

    "Task""ExecuteReportTemplate.xml",
    "Params": [{
        "Name""object_ref",
        "Value""OR:wt.query.template.ReportTemplate:1552736"
    }, {
        "Name""input",
        "Value""startDate=2021-06-22 14:26:00, endDate=2021-06-22 14:27:00"
    }]
18-Opal
October 6, 2021

Glad I could help ๐Ÿ‘

7-Bedrock
October 6, 2021

Thanks @d_graham , you explained the problem perfectly.

The format that worked for me is with comma separated parameters but as a single Value (STRING):

"Value""startDate=2021-06-22, endDate=2021-06-22"