Beispiel #1
0
 private static bool SetRelativeStaticLocation(RPLTablixMemberCell member, ALayout layout, RelativeStaticLocation staticLocation, List <RelativeStaticLocation> rowHeaderStaticLocations, ref bool isColumn)
 {
     if (member.TablixMemberDef.IsColumn)
     {
         isColumn = true;
         if (!layout.SummaryColumnAfter.HasValue)
         {
             if (member.IsRecursiveToggle)
             {
                 layout.SummaryColumnAfter = false;
             }
             else
             {
                 staticLocation.SetIndexes(member, true);
             }
         }
     }
     else
     {
         isColumn = false;
         if (!layout.SummaryRowAfter.HasValue)
         {
             if (member.IsRecursiveToggle)
             {
                 layout.SummaryRowAfter = false;
             }
             else
             {
                 int level = member.TablixMemberDef.Level;
                 for (int i = rowHeaderStaticLocations.Count; i <= level; i++)
                 {
                     rowHeaderStaticLocations.Add(new RelativeStaticLocation());
                 }
                 RelativeStaticLocation relativeStaticLocation = rowHeaderStaticLocations[level];
                 relativeStaticLocation.SetIndexes(member, false);
             }
         }
     }
     return(member.HasToggle);
 }
Beispiel #2
0
 private static void ReadTablixStructure(RPLTablix tablix, ALayout layout, int top, int left, int generationIndex, BlockOutlines blockOutlines, Dictionary <string, ToggleParent> toggleParents, bool suppressOutlines, string subreportLanguage)
 {
     if (tablix != null)
     {
         int num = 0;
         if (tablix.ColumnWidths != null)
         {
             num = tablix.ColumnWidths.Length;
         }
         int[] array = new int[num + 1];
         array[0] = left;
         double num2           = (double)left;
         int    num3           = 0;
         int    rowHeaderWidth = 0;
         for (int i = 1; i <= num; i++)
         {
             num2    += LayoutConvert.ConvertMMTo20thPointsUnrounded((double)tablix.ColumnWidths[i - 1]);
             array[i] = (int)Math.Round(num2);
             if (tablix.ColsBeforeRowHeaders == 0 && i == tablix.RowHeaderColumns)
             {
                 rowHeaderWidth = (int)Math.Round(num2 - (double)left);
             }
         }
         num3 = (int)Math.Round(num2 - (double)left);
         int num4 = 0;
         if (tablix.RowHeights != null)
         {
             num4 = tablix.RowHeights.Length;
         }
         int[] array2 = new int[num4 + 1];
         array2[0] = top;
         double num5 = (double)top;
         int    num6 = 0;
         int    columnHeaderHeight = 0;
         for (int j = 1; j <= num4; j++)
         {
             num5     += LayoutConvert.ConvertMMTo20thPointsUnrounded((double)tablix.RowHeights[j - 1]);
             array2[j] = (int)Math.Round(num5);
             if (j == tablix.ColumnHeaderRows)
             {
                 columnHeaderHeight = (int)Math.Round(num5 - (double)top);
             }
         }
         num6 = (int)Math.Round(num5 - (double)top);
         List <RelativeStaticLocation> list = new List <RelativeStaticLocation>();
         bool         flag = false;
         RPLTablixRow nextRow;
         while ((nextRow = tablix.GetNextRow()) != null)
         {
             bool flag2 = false;
             RelativeStaticLocation relativeStaticLocation = new RelativeStaticLocation();
             if (!suppressOutlines && nextRow.OmittedHeaders != null)
             {
                 for (int k = 0; k < nextRow.OmittedHeaders.Count; k++)
                 {
                     RPLTablixMemberCell rPLTablixMemberCell = nextRow.OmittedHeaders[k];
                     if (Reader.SetRelativeStaticLocation(rPLTablixMemberCell, layout, relativeStaticLocation, list, ref flag2))
                     {
                         flag = true;
                     }
                     Reader.ReadTablixCellProperties(rPLTablixMemberCell, layout, array2, array, generationIndex + 1, tablix.LayoutDirection == RPLFormat.Directions.RTL, blockOutlines, toggleParents, suppressOutlines, subreportLanguage);
                     nextRow.OmittedHeaders[k] = null;
                 }
             }
             for (int l = 0; l < nextRow.NumCells; l++)
             {
                 RPLTablixCell rPLTablixCell = nextRow[l];
                 if (!suppressOutlines)
                 {
                     RPLTablixMemberCell rPLTablixMemberCell2 = rPLTablixCell as RPLTablixMemberCell;
                     if (rPLTablixMemberCell2 != null && Reader.SetRelativeStaticLocation(rPLTablixMemberCell2, layout, relativeStaticLocation, list, ref flag2))
                     {
                         flag = true;
                     }
                 }
                 Reader.ReadTablixCellProperties(rPLTablixCell, layout, array2, array, generationIndex + 1, tablix.LayoutDirection == RPLFormat.Directions.RTL, blockOutlines, toggleParents, suppressOutlines, subreportLanguage);
                 nextRow[l] = null;
             }
             if (!suppressOutlines && flag2 && !layout.SummaryColumnAfter.HasValue)
             {
                 layout.SummaryColumnAfter = relativeStaticLocation.IsSummaryAfter();
             }
         }
         if (!suppressOutlines)
         {
             int num7 = 0;
             while (!layout.SummaryRowAfter.HasValue && num7 < list.Count)
             {
                 RelativeStaticLocation relativeStaticLocation2 = list[num7];
                 layout.SummaryRowAfter = relativeStaticLocation2.IsSummaryAfter();
                 num7++;
             }
             if (flag)
             {
                 layout.AddStructuralItem(top, left, num3, num6, ALayout.TablixStructStart + ALayout.TablixStructGenerationOffset * generationIndex, rowHeaderWidth, columnHeaderHeight, tablix.LayoutDirection == RPLFormat.Directions.RTL);
             }
         }
     }
 }