3 Replies Latest reply on Aug 10, 2017 9:31 AM by philmodjunk

    calculation to print email and group items

    evansj2

      All,

      I am developing a project managing system and am at the stage of writing the scripts needed to printout/email. i have the following, and its laid out this way to make it easier to read.

       

      user::user_f_name & " " & user::user_l_name & ",

      ¶¶There has been an update to Project ID #: "&AV Projects::project_sn&

      "¶¶Titled: " &AV Projects::project_title&

      "¶¶Building: " &AV Projects::proj_building&

      "¶Room: " &AV Projects::proj_room&

      "¶¶Description:   ¶" &AV Projects::project_description &

      "¶¶Primary Event Note: ¶" &av project notes::avproject_note_filtered_not_private &

      "¶¶Equipment:¶" & AV Projects::proj_equip &

      "¶¶-----SUB EVENTS-----¶¶ Sub Project ID: "&AV Project_subevents::av_projects_subevent_sn_combined&

      "¶¶Sub Event Building: "&AV Project_subevents::av_projects_subevent_building&

      "¶Sub Event Room :" &AV Project_subevents::av_projects_subevent_room&

      "¶¶Sub Event Start Date:  " &AV Project_subevents::av_projects_subevent_start_date&

      "¶Sub Event Start Time: " &AV Project_subevents::av_projects_subevent_start_time&

      "¶Sub  Event End Time:  " &AV Project_subevents::av_projects_subevent_end_time&

      "¶¶Sub Event Note: ¶" &AV Project_subevents::av_projects_subevent_note&

        "¶¶ --------------------------------------------------------------------------------¶¶

       

      I need all of the sub-events associated with the project to printout and grouped. So sub-event one would have all its information, then sub-event 2 would be listed and then 3 and so on. I tried a few permutations of List (blah blah blah) but its on grouping them as needed.

       

      Any thoughts?

        • 1. Re: calculation to print email and group items
          bertrand

          Try to use a report which will sort records of the same project and export the report to send it in PDF format.

          • 2. Re: calculation to print email and group items
            realgrouchy

            I agree with bertrand's suggestion. If you use a Report style layout, using the Project_subevents table (list mode), then you just have to search for all the relevant subevents.

             

            You can also add layout parts "Sub-summary when sorted by" (Edit Layout > Layouts Menu > Part Setup > Create...), then sort the report by Projects to show that layout part. If you select "Page break before each occurrence" in the Part Definition, then you can search for all updated project sub-events, sort them by Project, and it will spit out a multi-page report with one page per project listing all the updated subevents.

             

            - RG>

            • 3. Re: calculation to print email and group items
              philmodjunk

              I'm assuming that you didn't go the PDF route here because you wanted this text in the body of your email. There are two approaches that can be used to do that: List and ExecuteSQL.

               

              With list, you have to do the labeling/grouping in the subevent table in a calculation field that returns text. You then list that field to get rows of data from the subevent table.

               

              ExecuteSQL on the other hand supports using both field separator text and text concatenation in the list of selected fields as a way to produce the same result without the need for the extra calculation field in the child table.