Header Ads

  • Recent Posts

    Displaying a message if data in same group(Crystal Report) breaks into multiple pages

    In Crystal Reports, group header can be repeated in each page if the group is spanning to pages. However, what if user wants a custom message like, 'data is continued from previous page'. How to achieve it?
    By using the below code snippet in Crystal Reports, it is possible to display a message if data in same group breaks into multiple pages.

    First creat a formula with the below code:
    WhilePrintingRecords;
    //Variable declaration
    shared stringvar Array Student_Array;
    local stringvar disp;
    shared numbervar i;
    shared stringvar array Student_Pno_Array;
    shared numbervar j;

     //checks if previous Student no is not in array (not displayed in report) before assigning it to Student_Array
    if not ({Student.STUDENT_NBR} in Student_Array) then
       ( i := i + 1;
       Redim Preserve Student_Array[i];
       Student_Array[i] := {STUDENT.STUDENT_NBR};
       // Adds value to Student_Pno_Array
       j := j + 1;
       Redim Preserve Student_Pno_Array[j];
       Student_Pno_Array[j] := {STUDENT.STUDENT_NBR}+totext(pagenumber);
       disp:="";) // Text message to be displayed must go in here
    else
    //The line below ensures that only new values are added to the array.
       if not(({STUDENT.STUDENT_NBR}+totext(pagenumber)) in Student_Pno_Array) then
          ( j := j + 1;
          Redim Preserve Student_Pno_Array[j];
          Student_Pno_Array[j] := {STUDENT.STUDENT_NBR}+totext(pagenumber);
          disp:="display message")
       else disp:=""; // Text message to be displayed must go in here

    Then place this formula in all the sections where you want to display the custom message if the group is breaking into multiple pages.

    No comments

    Please refrain for marketing messages and unnecessary back links.

    Post Top Ad

    Post Bottom Ad