Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: confused

  1. #1
    Join Date
    Jan 2006
    Posts
    313

    Default confused

    I have an imput parameter type = date picker.
    I have a post processing formula =TEXT([param1];"yyyy-M-d'T'H:m:s")
    What should the value type be String or Date?
    The result type of the formula or of the original query?

    When i use String it works in the designer, but not in the platform (i updated to 3.6.M1). In the log's no error, on screen a red text shows up saying "The post-processing failed with an error."

  2. #2
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    This should be string, as the parameter-validator will see a string when it runs. The system works as follows:

    (1) Show the user a fancy UI (DatePicker)
    (2) Return a Date-Object
    (3) Put the date into the parameter-values, and then feed everything directly into the Formula-processor
    (4) Run the formula and take the output of the formula and put that into the parameter-values-collection*
    (5) Validate the parameter values, including that the parameter-value-collection contains the correct type for each parameter


    (*) If the formula-execution fails with an error, this will be treated as if the value is invalid. You shall receive a parameter-validation-error in that case.

    (To that respect: M1 reacts a badly when dealing with date-parameters in general. This is a bug that was fixed as late as last weekend. Bad me messed up the server-side parameter-handling (both the validation and how it is sent back to the report-viewer, which then upsets the report-viewer beyond recovery.)
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  3. #3
    Join Date
    Jan 2006
    Posts
    313

    Default which jars do i need to update

    Taqua, thanks for the info.
    Is it sufficient to update the reporting-platform-plugin or do i need other jars as well

  4. #4
    Join Date
    Jan 2006
    Posts
    313

    Default upgrade does not work

    I took the latest build from prd & the reporting-platform-plugin. Copied the files to the platform.
    Behaviour is the same. Looks like the post processing formula =TEXT([param1];"yyyy-MM-dd HH:mm:ss") is not accepted as a valid formulla.

  5. #5
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    OK, after a bit of praying for enlightenment, I see no sensible way how we can handle such a case within a single parameter.

    We rely on the declared parameter-type for both the validation and for the conversion from string (we get that from HTTP requests in the platform) to real objects. So if you declare the parameter as string, then the conversion from string to date will fail and thus your formula may react funny. If you declare the parameter as date, we can create the date object from the input string and compute the value, but the parameter validator will be unhappy.

    We can now either declare a second type ("parameter-type" and then for instance "post-process-parameter-type") to deal with that situation (which is ugly, as it complicates all other cases and doubles the chances to screw up)

    or

    we outright ban such evil behaviour.
    (Ahh, I love banning )


    With the ban, we simply say that this situation is not resolveable, and that you better declare a second parameter, hidden and with the formula as your post-processing-formula. That parameter can then be safely declared as string and both the type-converter and the validator are happy.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  6. #6
    Join Date
    Jan 2006
    Posts
    313

    Default ban option works

    I now inplemented the "ban" option. After setting a default value for the additional parameter i could get the post processing formula =TEXT([param1];"yyyy-MM-dd HH:mm:ss") to work with kettle.


    I assume that in one of the next versions, we will get an error in the designer if the datatype of the parameter and the datatype of the post processing formula are different.

    By the way, parameter hiding is not working when publishing the report to the platform.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.