Home > Community > Forums > Custom IC SKILL > calculated value in ?headers of hiCreateReportField

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 calculated value in ?headers of hiCreateReportField 

Last post Tue, Jan 8 2013 10:31 PM by Andrew Beckett. 1 replies.
Started by The Consultant 08 Jan 2013 05:51 AM. Topic has 1 replies and 484 views
Page 1 of 1 (2 items)
Sort Posts:
  • Tue, Jan 8 2013 5:51 AM

    calculated value in ?headers of hiCreateReportField Reply

    Hi,

    i creat a form with an report field. The value in the header should not a fixed value in the code, it should be a varialbe.

    but i get an error, fixnum req.

     

    here is the code

    ------------------------------------------------

    width = 30x ( some digit)

    reportField = hiCreateReportField(
            ?name       'reportField
            ?title      "Report"
            ?selectMode 'multiple
            ?headers    '(
                           ("obj-type"     75   'left)
                          ("l"            75   'left)
                          ("pp"           75   'left)
                          ("description"  width   'left)
                          )
            ?choices     ch
    )

    -----------------------------------------

     

     if i change with to e.g. 100 , everything is fine.

    • Post Points: 20
  • Tue, Jan 8 2013 10:31 PM

    Re: calculated value in ?headers of hiCreateReportField Reply

    If you use '(...) the list is quoted which means that nothing is evaluated inside the list. You have a couple of choices:

            ?headers    list(
                          list("obj-type"     75   'left)
                          list("l"            75   'left)
                          list("pp"           75   'left)
                          list("description"  width   'left)
                          ) 

    Or you could use the backquote approach which allows selective evaluation of things preceded by a comma (note the 'left will be quoted - so don't really need the quote either):

            ?headers    `(
                          ("obj-type"     75   left)
                          ("l"            75   left)
                          ("pp"           75   left)
                          ("description"  ,width   left)
                          ) 

    Sometimes the backquote approach is cleaner because it is clearer when you are just inserting a small number of values into an otherwise static list structure. It's actually a macro which expands into list() (and other function calls).

    Regards,

    Andrew.

    • Post Points: 5
Page 1 of 1 (2 items)
Sort Posts:
Started by The Consultant at 08 Jan 2013 05:51 AM. Topic has 1 replies.