public static Excel.WorkbookConnection GetWorkbookConnection(Excel.Range rngCell) { Excel.PivotTable pt = null; Excel.PivotCache cache = null; Excel.WorkbookConnection wbcnn = null; pt = rngCell.PivotTable; cache = pt.PivotCache(); wbcnn = cache.WorkbookConnection; return(wbcnn); }
public IEnumerable <DetailColumn> GetCustomDetailColumns(Excel.Range rngCell) { Excel.WorkbookConnection wbcnn = null; Excel.Workbook workbook = null; Excel.Worksheet sheet = null; wbcnn = ExcelHelper.GetWorkbookConnection(rngCell); sheet = (Excel.Worksheet)rngCell.Parent; workbook = (Excel.Workbook)sheet.Parent; TabularItems.Measure measure = GetMeasure(rngCell); string xmlString = ExcelHelper.ReadCustomXmlNode( workbook, Constants.DaxDrillXmlSchemaSpace, string.Format("{0}[@id='{1}']", Constants.TableXpath, measure.TableName)); List <DetailColumn> columns = DaxDrillConfig.GetColumnsFromTableXml(Constants.DaxDrillXmlSchemaSpace, xmlString, wbcnn.Name, measure.TableName); return(columns); }
public static int GetMaxDrillthroughRecords(Excel.Range rngCell) { Excel.WorkbookConnection wbcnn = ExcelHelper.GetWorkbookConnection(rngCell); Excel.OLEDBConnection oledbcnn = wbcnn.OLEDBConnection; return(oledbcnn.MaxDrillthroughRecords); }