Announcement

Collapse
No announcement yet.

Using Templates with Scriptcase (Custom Grid/Reports)

Collapse
This is a sticky topic.
X
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using Templates with Scriptcase (Custom Grid/Reports)

    ScriptCase can create Custom Grids/Reports (billets, invoices, business cards, etc). You can create a HTML file using your own layout, but following some rules.

    It should be a HTML file. We can stipulate where Scriptcase fields will be displayed on the HTML file using "curly brackets" {variable}. As you can see below:

    HTML Code
    Code:
    <table border="0" cellspacing="0" cellpadding="0">
       <tr>
            <td width="247" height="96" align="left" valign="center">
            <font face="verdana" style="font-size:11px">
            <b>{Name}</b><br>{Address}<br>{City}- {State}<br>
            {ZIP}
            </font>
            </td>
       </tr>
    </table>
    Running the HTML code above.
    {Name}
    {Address}
    {City}-{State}
    {ZIP}


    In the Template we can define a Loop feature using a flag (see in red):

    Código HTML
    Code:
    <table border="0" cellspacing="0" cellpadding="0">
       <tr>
         <!-- BEGIN bl2 -->
            <td width="247" height="96" align="left" valign="center">
            <font face="verdana" style="font-size:11px">
            <b>{Name}</b><br>{Address}<br>{City}- {State}<br>
            {ZIP}
            </font>
            </td>
         <!-- END bl2 -->
       </tr>
    </table>

    The red parts define where the loop will start and finish. The iterations amount is defined by "Columns per Page" of the Grid.

    eg: If "Columns per Page" is 3 so it will display the following result.

    HTML code
    Code:
    <table border="0" cellspacing="0" cellpadding="0">
       <tr>
            <td width="247" height="96" align="left" valign="center">
            <font face="verdana" style="font-size:11px">
            <b>{Name}</b><br>{Address}<br>{City}- {State}<br>
            {ZIP}
            </font>
            </td>
            <td width="247" height="96" align="left" valign="center">
            <font face="verdana" style="font-size:11px">
            <b>{Name}</b><br>{Address}<br>{City}- {State}<br>
            {ZIP}
            </font>
            </td>
            <td width="247" height="96" align="left" valign="center">
            <font face="verdana" style="font-size:11px">
            <b>{Name}</b><br>{Address}<br>{City}- {State}<br>
            {ZIP}
            </font>
            </td>
       </tr>
    </table>
    Running the HTML Code above
    {Name}
    {Address}
    {City}-{State}
    {ZIP}
    {Name}
    {Address}
    {City}-{State}
    {ZIP}
    {Name}
    {Address}
    {City}-{State}
    {ZIP}

    After done the ".html" file we should include it in Scriptcase accessing "Tools>>Layout>>Templates".

    Select "Free Format" and Upload the file.

    Then Create a new Grid application and select "User Defined" Option in "Orienation" setting.

    Access "Grid>>Layout>>Settings" and select the "Body Template".

    Now we should associate the template variables with the Grid fields. (Grid>>Select Fields)

    Format the fields and Run. It is done.




    Vítor Jamil



  • #2
    Re: Using Templates with Scriptcase (Custom Grid/Reports)

    Dear Vitor,

    thank you for this good example!
    I would like to have an template where I check the user group of the currently loged in user. Depending on that group I would like to hide certain fields. Is this possible with templates?

    Thank you!

    Best regards
    Arno

    Comment


    • #3
      Re: Using Templates with Scriptcase (Custom Grid/Reports)

      [quote author=Arno link=topic=1379.msg4610#msg4610 date=1272642200]
      Dear Vitor,

      thank you for this good example!
      I would like to have an template where I check the user group of the currently loged in user. Depending on that group I would like to hide certain fields. Is this possible with templates?

      Thank you!

      Best regards
      Arno
      [/quote]

      Yes, it is possible using onInit event to check the group and hidding the fields with "sc_field_display" macro.

      Comment


      • #4
        Re: Using Templates with Scriptcase (Custom Grid/Reports)

        So how come this type of template level customization isn't in place for applications like control, form, etc.?

        Many times you can't do anything very easy in SC around custom layout using the SC IDE, and simple things for layout, require a workaround or 5 hours to figure out how to maybe doing something...

        Why would you make the custom template only available in a grid and not all applications?


        thanks,

        David

        Comment


        • #5
          Re: Using Templates with Scriptcase (Custom Grid/Reports)

          And please publish your original templates as start point for custom templates.

          Thank you
          Arno

          Comment


          • #6
            Re: Using Templates with Scriptcase (Custom Grid/Reports)

            [quote author=Arno link=topic=1379.msg5053#msg5053 date=1278412697]
            And please publish your original templates as start point for custom templates.

            Thank you
            Arno
            [/quote]

            ^^^^^^^^^^

            This. If you want to tweak something, this is a pre-requisite.

            Comment


            • #7
              Re: Using Templates with Scriptcase (Custom Grid/Reports)

              hi there!

              this is a great feature.
              but: where and how can i put the "tools"? like: next, search, buttons and so on? cant find that. maybe i am blind

              Comment


              • #8
                Re: Using Templates with Scriptcase (Custom Grid/Reports)

                This seems to be applicable for SC 5, but it won't work in SC 6. Can somebody update this for SC 6?

                Comment


                • #9
                  Re: Using Templates with Scriptcase (Custom Grid/Reports)

                  well, I wonder if any of existing MockUp tools would help creating SC templates.
                  There should be definitely mor examples on customizing the look of Applications, as SC is missing Visual Design Tool.

                  Comment

                  Working...
                  X