/// <summary> /// 测试列 /// </summary> /// <param name="pageIndex"></param> /// <param name="x"></param> /// <param name="y"></param> /// <returns></returns> private int TestCol(int pageIndex, int x, int y) { if (reportDatas == null || pageIndex < 0) { return(-1); } I3PrintArea area = reportDatas.PrintAreas.Dic[pageIndex]; RectangleF fullRect = GetAreaPaperRect(area); RectangleF dataRect = GetAreaContentRect(area); foreach (int col in area.AllCols) { int firstRow = area.AllRows[0]; I3ReportCell cell = area.ReportData[firstRow][col]; RectangleF rect = I3ReportPrintController.CalCellClipRect_Scale(reportDatas, cell, area, Scale, dataRect, fullRect); if (x >= rect.Left && x <= rect.Right) { return(col); } } return(-1); }
/// <summary> /// 测试行 /// </summary> /// <param name="pageIndex"></param> /// <param name="x"></param> /// <param name="y"></param> /// <returns></returns> private int TestRow(int pageIndex, int x, int y) { if (reportDatas == null || pageIndex < 0) { return(-1); } I3PrintArea area = reportDatas.PrintAreas.Dic[pageIndex]; RectangleF fullRect = GetAreaPaperRect(area); RectangleF dataRect = GetAreaContentRect(area); foreach (int row in area.AllRows) { int firstCol = area.AllCols[0]; I3ReportCell cell = area.ReportData[row][firstCol]; RectangleF rect = I3ReportPrintController.CalCellClipRect_Scale(reportDatas, cell, area, Scale, dataRect, fullRect); if (y >= rect.Top && y <= rect.Bottom) { return(row); } } return(-1); }