public DxCrosstab(DxCrosstabsSettings settings, DataTable data) { _settings = settings; _title = settings.title; CreatePivot(data, _settings.pivot_rows, _settings.pivot_cols, _settings.stats, _settings.pivot_cells[0], _settings.decimal_places); }
public void ProcessOrder(DxTableOrder order) { if (order.batches.Count > 0) { order.batches.Clear(); } bool hassameworksheet = order.HasSameWorksheet(_dpdata); if (!hassameworksheet) { //Need new DPData _dataproject.selectedsheet = order.worksheet; _dpdata = new DPData(_dataproject, order.filter); } bool hassamefilter = order.HasSameFilter(_dpdata); if (!hassamefilter) { _dpdata.filter = order.filter; } _dt = _dpdata.dt; //Each order will result in a list of batches //List<DxBatchOcharts> batchlist = new List<DxBatchOcharts>(); List <DxTableBatch> batchlist = new List <DxTableBatch>(); foreach (DxTableSettings settings in order.list_settings) { if (settings.outputtype == DxOutputtype.Crosstabs) { DxCrosstabsSettings mysettings = (DxCrosstabsSettings)settings; DxTableBatch batch = new DxTableBatch(mysettings, dt); PrepareBatch(batch, settings); batchlist.Add(batch); } } order.batches.AddRange(batchlist); //The invoice serves as a table of contents for what was actually created order.PrepareInvoice(); }
public DxTableBatch(DxCrosstabsSettings mysettings, DataTable dt) { Initialize(); _tblsettings = (DxTableSettings)mysettings; outputtype = DxOutputtype.Crosstabs; layout = mysettings.layout; if (mysettings.pivot_rows.Count > 0) { vars.AddRange(mysettings.pivot_rows); } if (mysettings.pivot_cols.Count > 0) { vars.AddRange(mysettings.pivot_cols); } if (mysettings.pivot_cells.Count > 0) { vars.AddRange(mysettings.pivot_cells); } DxCrosstab crosstab = new DxCrosstab(mysettings, dt); tables.Add(crosstab); }