Best JavaScript code snippet using wpt
PivotTables.js.js
Source:PivotTables.js.js
1"use strict";2//Generated code3function getBoolFromXml(val) {4 return "0" !== val && "false" !== val && "off" !== val;5}6var c_oAscSourceType = {7 Worksheet: 0,8 External: 1,9 Consolidation: 2,10 Scenario: 311};12var c_oAscAxis = {13 AxisRow: 0,14 AxisCol: 1,15 AxisPage: 2,16 AxisValues: 317};18var c_oAscFieldSortType = {19 Manual: 0,20 Ascending: 1,21 Descending: 222};23var c_oAscItemType = {24 Default: 0,25 Avg: 1,26 Count: 2,27 CountA: 3,28 Max: 4,29 Min: 5,30 Product: 6,31 StdDev: 7,32 StdDevP: 8,33 Sum: 9,34 Var: 10,35 VarP: 11,36 Data: 12,37 Grand: 13,38 Blank: 1439};40var c_oAscDataConsolidateFunction = {41 Average: 1,42 Count: 2,43 CountNums: 3,44 Max: 4,45 Min: 5,46 Product: 6,47 StdDev: 7,48 StdDevp: 8,49 Sum: 9,50 Var: 10,51 Varp: 1152};53var c_oAscShowDataAs = {54 Normal: 0,55 Difference: 1,56 Percent: 2,57 PercentDiff: 3,58 RunTotal: 4,59 PercentOfRow: 5,60 PercentOfCol: 6,61 PercentOfTotal: 7,62 Index: 863};64var c_oAscFormatAction = {65 Blank: 0,66 Formatting: 1,67 Drill: 2,68 Formula: 369};70var c_oAscScope = {71 Selection: 0,72 Data: 1,73 Field: 274};75var c_oAscType = {76 None: 0,77 All: 1,78 Row: 2,79 Column: 380};81var c_oAscPivotFilterType = {82 Unknown: 0,83 Count: 1,84 Percent: 2,85 Sum: 3,86 CaptionEqual: 4,87 CaptionNotEqual: 5,88 CaptionBeginsWith: 6,89 CaptionNotBeginsWith: 7,90 CaptionEndsWith: 8,91 CaptionNotEndsWith: 9,92 CaptionContains: 10,93 CaptionNotContains: 11,94 CaptionGreaterThan: 12,95 CaptionGreaterThanOrEqual: 13,96 CaptionLessThan: 14,97 CaptionLessThanOrEqual: 15,98 CaptionBetween: 16,99 CaptionNotBetween: 17,100 ValueEqual: 18,101 ValueNotEqual: 19,102 ValueGreaterThan: 20,103 ValueGreaterThanOrEqual: 21,104 ValueLessThan: 22,105 ValueLessThanOrEqual: 23,106 ValueBetween: 24,107 ValueNotBetween: 25,108 DateEqual: 26,109 DateNotEqual: 27,110 DateOlderThan: 28,111 DateOlderThanOrEqual: 29,112 DateNewerThan: 30,113 DateNewerThanOrEqual: 31,114 DateBetween: 32,115 DateNotBetween: 33,116 Tomorrow: 34,117 Today: 35,118 Yesterday: 36,119 NextWeek: 37,120 ThisWeek: 38,121 LastWeek: 39,122 NextMonth: 40,123 ThisMonth: 41,124 LastMonth: 42,125 NextQuarter: 43,126 ThisQuarter: 44,127 LastQuarter: 45,128 NextYear: 46,129 ThisYear: 47,130 LastYear: 48,131 YearToDate: 49,132 Q1: 50,133 Q2: 51,134 Q3: 52,135 Q4: 53,136 M1: 54,137 M2: 55,138 M3: 56,139 M4: 57,140 M5: 58,141 M6: 59,142 M7: 60,143 M8: 61,144 M9: 62,145 M10: 63,146 M11: 64,147 M12: 65148};149var c_oAscSortType = {150 None: 0,151 Ascending: 1,152 Descending: 2,153 AscendingAlpha: 3,154 DescendingAlpha: 4,155 AscendingNatural: 5,156 DescendingNatural: 6157};158var c_oAscPivotAreaType = {159 None: 0,160 Normal: 1,161 Data: 2,162 All: 3,163 Origin: 4,164 Button: 5,165 TopEnd: 6166};167var c_oAscGroupBy = {168 Range: 0,169 Seconds: 1,170 Minutes: 2,171 Hours: 3,172 Days: 4,173 Months: 5,174 Quarters: 6,175 Years: 7176};177var c_oAscSortMethod = {178 Stroke: 0,179 PinYin: 1,180 None: 2181};182var c_oAscDynamicFilterType = {183 Null: 0,184 AboveAverage: 1,185 BelowAverage: 2,186 Tomorrow: 3,187 Today: 4,188 Yesterday: 5,189 NextWeek: 6,190 ThisWeek: 7,191 LastWeek: 8,192 NextMonth: 9,193 ThisMonth: 10,194 LastMonth: 11,195 NextQuarter: 12,196 ThisQuarter: 13,197 LastQuarter: 14,198 NextYear: 15,199 ThisYear: 16,200 LastYear: 17,201 YearToDate: 18,202 Q1: 19,203 Q2: 20,204 Q3: 21,205 Q4: 22,206 M1: 23,207 M2: 24,208 M3: 25,209 M4: 26,210 M5: 27,211 M6: 28,212 M7: 29,213 M8: 30,214 M9: 31,215 M10: 32,216 M11: 33,217 M12: 34218};219var c_oAscCalendarType = {220 Gregorian: 0,221 GregorianUs: 1,222 GregorianMeFrench: 2,223 GregorianArabic: 3,224 Hijri: 4,225 Hebrew: 5,226 Taiwan: 6,227 Japan: 7,228 Thai: 8,229 Korea: 9,230 Saka: 10,231 GregorianXlitEnglish: 11,232 GregorianXlitFrench: 12,233 None: 13234};235var c_oAscIconSetType = {236 ThreeArrows: 0,237 ThreeArrowsGray: 1,238 ThreeFlags: 2,239 ThreeTrafficLights1: 3,240 ThreeTrafficLights2: 4,241 ThreeSigns: 5,242 ThreeSymbols: 6,243 ThreeSymbols2: 7,244 FourArrows: 8,245 FourArrowsGray: 9,246 FourRedToBlack: 10,247 FourRating: 11,248 FourTrafficLights: 12,249 FiveArrows: 13,250 FiveArrowsGray: 14,251 FiveRating: 15,252 FiveQuarters: 16253};254var c_oAscSortBy = {255 Value: 0,256 CellColor: 1,257 FontColor: 2,258 Icon: 3259};260var c_oAscFilterOperator = {261 Equal: 0,262 LessThan: 1,263 LessThanOrEqual: 2,264 NotEqual: 3,265 GreaterThanOrEqual: 4,266 GreaterThan: 5267};268var c_oAscDateTimeGrouping = {269 Year: 0,270 Month: 1,271 Day: 2,272 Hour: 3,273 Minute: 4,274 Second: 5275};276var c_oAscAllocationMethod = {277 EqualAllocation: 0,278 EqualIncrement: 1,279 WeightedAllocation: 2,280 WeightedIncrement: 3281};282var st_VALUES = -2;283function FromXml_ST_SourceType(val) {284 var res = -1;285 if ("worksheet" === val) {286 res = c_oAscSourceType.Worksheet;287 } else if ("external" === val) {288 res = c_oAscSourceType.External;289 } else if ("consolidation" === val) {290 res = c_oAscSourceType.Consolidation;291 } else if ("scenario" === val) {292 res = c_oAscSourceType.Scenario;293 }294 return res;295}296function ToXml_ST_SourceType(val) {297 var res = "";298 if (c_oAscSourceType.Worksheet === val) {299 res = "worksheet";300 } else if (c_oAscSourceType.External === val) {301 res = "external";302 } else if (c_oAscSourceType.Consolidation === val) {303 res = "consolidation";304 } else if (c_oAscSourceType.Scenario === val) {305 res = "scenario";306 }307 return res;308}309function FromXml_ST_Axis(val) {310 var res = -1;311 if ("axisRow" === val) {312 res = c_oAscAxis.AxisRow;313 } else if ("axisCol" === val) {314 res = c_oAscAxis.AxisCol;315 } else if ("axisPage" === val) {316 res = c_oAscAxis.AxisPage;317 } else if ("axisValues" === val) {318 res = c_oAscAxis.AxisValues;319 }320 return res;321}322function ToXml_ST_Axis(val) {323 var res = "";324 if (c_oAscAxis.AxisRow === val) {325 res = "axisRow";326 } else if (c_oAscAxis.AxisCol === val) {327 res = "axisCol";328 } else if (c_oAscAxis.AxisPage === val) {329 res = "axisPage";330 } else if (c_oAscAxis.AxisValues === val) {331 res = "axisValues";332 }333 return res;334}335function FromXml_ST_FieldSortType(val) {336 var res = -1;337 if ("manual" === val) {338 res = c_oAscFieldSortType.Manual;339 } else if ("ascending" === val) {340 res = c_oAscFieldSortType.Ascending;341 } else if ("descending" === val) {342 res = c_oAscFieldSortType.Descending;343 }344 return res;345}346function ToXml_ST_FieldSortType(val) {347 var res = "";348 if (c_oAscFieldSortType.Manual === val) {349 res = "manual";350 } else if (c_oAscFieldSortType.Ascending === val) {351 res = "ascending";352 } else if (c_oAscFieldSortType.Descending === val) {353 res = "descending";354 }355 return res;356}357function FromXml_ST_ItemType(val) {358 var res = -1;359 if ("data" === val) {360 res = c_oAscItemType.Data;361 } else if ("default" === val) {362 res = c_oAscItemType.Default;363 } else if ("sum" === val) {364 res = c_oAscItemType.Sum;365 } else if ("countA" === val) {366 res = c_oAscItemType.CountA;367 } else if ("avg" === val) {368 res = c_oAscItemType.Avg;369 } else if ("max" === val) {370 res = c_oAscItemType.Max;371 } else if ("min" === val) {372 res = c_oAscItemType.Min;373 } else if ("product" === val) {374 res = c_oAscItemType.Product;375 } else if ("count" === val) {376 res = c_oAscItemType.Count;377 } else if ("stdDev" === val) {378 res = c_oAscItemType.StdDev;379 } else if ("stdDevP" === val) {380 res = c_oAscItemType.StdDevP;381 } else if ("var" === val) {382 res = c_oAscItemType.Var;383 } else if ("varP" === val) {384 res = c_oAscItemType.VarP;385 } else if ("grand" === val) {386 res = c_oAscItemType.Grand;387 } else if ("blank" === val) {388 res = c_oAscItemType.Blank;389 }390 return res;391}392function ToXml_ST_ItemType(val) {393 var res = "";394 if (c_oAscItemType.Data === val) {395 res = "data";396 } else if (c_oAscItemType.Default === val) {397 res = "default";398 } else if (c_oAscItemType.Sum === val) {399 res = "sum";400 } else if (c_oAscItemType.CountA === val) {401 res = "countA";402 } else if (c_oAscItemType.Avg === val) {403 res = "avg";404 } else if (c_oAscItemType.Max === val) {405 res = "max";406 } else if (c_oAscItemType.Min === val) {407 res = "min";408 } else if (c_oAscItemType.Product === val) {409 res = "product";410 } else if (c_oAscItemType.Count === val) {411 res = "count";412 } else if (c_oAscItemType.StdDev === val) {413 res = "stdDev";414 } else if (c_oAscItemType.StdDevP === val) {415 res = "stdDevP";416 } else if (c_oAscItemType.Var === val) {417 res = "var";418 } else if (c_oAscItemType.VarP === val) {419 res = "varP";420 } else if (c_oAscItemType.Grand === val) {421 res = "grand";422 } else if (c_oAscItemType.Blank === val) {423 res = "blank";424 }425 return res;426}427function ToName_ST_ItemType(val) {428 var res = ' ';429 if (c_oAscItemType.Default === val) {430 res += 'Total';431 } else if (c_oAscItemType.Avg === val) {432 res += 'Average';433 } else if (c_oAscItemType.Count === val) {434 res += 'Count';435 } else if (c_oAscItemType.CountA === val) {436 res += 'Count';437 } else if (c_oAscItemType.Max === val) {438 res += 'Max';439 } else if (c_oAscItemType.Min === val) {440 res += 'Min';441 } else if (c_oAscItemType.Product === val) {442 res += 'Product';443 } else if (c_oAscItemType.StdDev === val) {444 res += 'StdDev';445 } else if (c_oAscItemType.StdDevP === val) {446 res += 'StdDevp';447 } else if (c_oAscItemType.Sum === val) {448 res += 'Sum';449 } else if (c_oAscItemType.Var === val) {450 res += 'Var';451 } else if (c_oAscItemType.VarP === val) {452 res += 'Varp';453 } else if (c_oAscItemType.Data === val) {454 res += 'Data';455 } else if (c_oAscItemType.Grand === val) {456 res += 'Total';457 } else if (c_oAscItemType.Blank === val) {458 res += 'Blank';459 }460 return res;461}462function FromXml_ST_DataConsolidateFunction(val) {463 var res = -1;464 if ("average" === val) {465 res = c_oAscDataConsolidateFunction.Average;466 } else if ("count" === val) {467 res = c_oAscDataConsolidateFunction.Count;468 } else if ("countNums" === val) {469 res = c_oAscDataConsolidateFunction.CountNums;470 } else if ("max" === val) {471 res = c_oAscDataConsolidateFunction.Max;472 } else if ("min" === val) {473 res = c_oAscDataConsolidateFunction.Min;474 } else if ("product" === val) {475 res = c_oAscDataConsolidateFunction.Product;476 } else if ("stdDev" === val) {477 res = c_oAscDataConsolidateFunction.StdDev;478 } else if ("stdDevp" === val) {479 res = c_oAscDataConsolidateFunction.StdDevp;480 } else if ("sum" === val) {481 res = c_oAscDataConsolidateFunction.Sum;482 } else if ("var" === val) {483 res = c_oAscDataConsolidateFunction.Var;484 } else if ("varp" === val) {485 res = c_oAscDataConsolidateFunction.Varp;486 }487 return res;488}489function ToXml_ST_DataConsolidateFunction(val) {490 var res = "";491 if (c_oAscDataConsolidateFunction.Average === val) {492 res = "average";493 } else if (c_oAscDataConsolidateFunction.Count === val) {494 res = "count";495 } else if (c_oAscDataConsolidateFunction.CountNums === val) {496 res = "countNums";497 } else if (c_oAscDataConsolidateFunction.Max === val) {498 res = "max";499 } else if (c_oAscDataConsolidateFunction.Min === val) {500 res = "min";501 } else if (c_oAscDataConsolidateFunction.Product === val) {502 res = "product";503 } else if (c_oAscDataConsolidateFunction.StdDev === val) {504 res = "stdDev";505 } else if (c_oAscDataConsolidateFunction.StdDevp === val) {506 res = "stdDevp";507 } else if (c_oAscDataConsolidateFunction.Sum === val) {508 res = "sum";509 } else if (c_oAscDataConsolidateFunction.Var === val) {510 res = "var";511 } else if (c_oAscDataConsolidateFunction.Varp === val) {512 res = "varp";513 }514 return res;515}516function FromXml_ST_ShowDataAs(val) {517 var res = -1;518 if ("normal" === val) {519 res = c_oAscShowDataAs.Normal;520 } else if ("difference" === val) {521 res = c_oAscShowDataAs.Difference;522 } else if ("percent" === val) {523 res = c_oAscShowDataAs.Percent;524 } else if ("percentDiff" === val) {525 res = c_oAscShowDataAs.PercentDiff;526 } else if ("runTotal" === val) {527 res = c_oAscShowDataAs.RunTotal;528 } else if ("percentOfRow" === val) {529 res = c_oAscShowDataAs.PercentOfRow;530 } else if ("percentOfCol" === val) {531 res = c_oAscShowDataAs.PercentOfCol;532 } else if ("percentOfTotal" === val) {533 res = c_oAscShowDataAs.PercentOfTotal;534 } else if ("index" === val) {535 res = c_oAscShowDataAs.Index;536 }537 return res;538}539function ToXml_ST_ShowDataAs(val) {540 var res = "";541 if (c_oAscShowDataAs.Normal === val) {542 res = "normal";543 } else if (c_oAscShowDataAs.Difference === val) {544 res = "difference";545 } else if (c_oAscShowDataAs.Percent === val) {546 res = "percent";547 } else if (c_oAscShowDataAs.PercentDiff === val) {548 res = "percentDiff";549 } else if (c_oAscShowDataAs.RunTotal === val) {550 res = "runTotal";551 } else if (c_oAscShowDataAs.PercentOfRow === val) {552 res = "percentOfRow";553 } else if (c_oAscShowDataAs.PercentOfCol === val) {554 res = "percentOfCol";555 } else if (c_oAscShowDataAs.PercentOfTotal === val) {556 res = "percentOfTotal";557 } else if (c_oAscShowDataAs.Index === val) {558 res = "index";559 }560 return res;561}562function FromXml_ST_FormatAction(val) {563 var res = -1;564 if ("blank" === val) {565 res = c_oAscFormatAction.Blank;566 } else if ("formatting" === val) {567 res = c_oAscFormatAction.Formatting;568 } else if ("drill" === val) {569 res = c_oAscFormatAction.Drill;570 } else if ("formula" === val) {571 res = c_oAscFormatAction.Formula;572 }573 return res;574}575function ToXml_ST_FormatAction(val) {576 var res = "";577 if (c_oAscFormatAction.Blank === val) {578 res = "blank";579 } else if (c_oAscFormatAction.Formatting === val) {580 res = "formatting";581 } else if (c_oAscFormatAction.Drill === val) {582 res = "drill";583 } else if (c_oAscFormatAction.Formula === val) {584 res = "formula";585 }586 return res;587}588function FromXml_ST_Scope(val) {589 var res = -1;590 if ("selection" === val) {591 res = c_oAscScope.Selection;592 } else if ("data" === val) {593 res = c_oAscScope.Data;594 } else if ("field" === val) {595 res = c_oAscScope.Field;596 }597 return res;598}599function ToXml_ST_Scope(val) {600 var res = "";601 if (c_oAscScope.Selection === val) {602 res = "selection";603 } else if (c_oAscScope.Data === val) {604 res = "data";605 } else if (c_oAscScope.Field === val) {606 res = "field";607 }608 return res;609}610function FromXml_ST_Type(val) {611 var res = -1;612 if ("none" === val) {613 res = c_oAscType.None;614 } else if ("all" === val) {615 res = c_oAscType.All;616 } else if ("row" === val) {617 res = c_oAscType.Row;618 } else if ("column" === val) {619 res = c_oAscType.Column;620 }621 return res;622}623function ToXml_ST_Type(val) {624 var res = "";625 if (c_oAscType.None === val) {626 res = "none";627 } else if (c_oAscType.All === val) {628 res = "all";629 } else if (c_oAscType.Row === val) {630 res = "row";631 } else if (c_oAscType.Column === val) {632 res = "column";633 }634 return res;635}636function FromXml_ST_PivotFilterType(val) {637 var res = -1;638 if ("unknown" === val) {639 res = c_oAscPivotFilterType.Unknown;640 } else if ("count" === val) {641 res = c_oAscPivotFilterType.Count;642 } else if ("percent" === val) {643 res = c_oAscPivotFilterType.Percent;644 } else if ("sum" === val) {645 res = c_oAscPivotFilterType.Sum;646 } else if ("captionEqual" === val) {647 res = c_oAscPivotFilterType.CaptionEqual;648 } else if ("captionNotEqual" === val) {649 res = c_oAscPivotFilterType.CaptionNotEqual;650 } else if ("captionBeginsWith" === val) {651 res = c_oAscPivotFilterType.CaptionBeginsWith;652 } else if ("captionNotBeginsWith" === val) {653 res = c_oAscPivotFilterType.CaptionNotBeginsWith;654 } else if ("captionEndsWith" === val) {655 res = c_oAscPivotFilterType.CaptionEndsWith;656 } else if ("captionNotEndsWith" === val) {657 res = c_oAscPivotFilterType.CaptionNotEndsWith;658 } else if ("captionContains" === val) {659 res = c_oAscPivotFilterType.CaptionContains;660 } else if ("captionNotContains" === val) {661 res = c_oAscPivotFilterType.CaptionNotContains;662 } else if ("captionGreaterThan" === val) {663 res = c_oAscPivotFilterType.CaptionGreaterThan;664 } else if ("captionGreaterThanOrEqual" === val) {665 res = c_oAscPivotFilterType.CaptionGreaterThanOrEqual;666 } else if ("captionLessThan" === val) {667 res = c_oAscPivotFilterType.CaptionLessThan;668 } else if ("captionLessThanOrEqual" === val) {669 res = c_oAscPivotFilterType.CaptionLessThanOrEqual;670 } else if ("captionBetween" === val) {671 res = c_oAscPivotFilterType.CaptionBetween;672 } else if ("captionNotBetween" === val) {673 res = c_oAscPivotFilterType.CaptionNotBetween;674 } else if ("valueEqual" === val) {675 res = c_oAscPivotFilterType.ValueEqual;676 } else if ("valueNotEqual" === val) {677 res = c_oAscPivotFilterType.ValueNotEqual;678 } else if ("valueGreaterThan" === val) {679 res = c_oAscPivotFilterType.ValueGreaterThan;680 } else if ("valueGreaterThanOrEqual" === val) {681 res = c_oAscPivotFilterType.ValueGreaterThanOrEqual;682 } else if ("valueLessThan" === val) {683 res = c_oAscPivotFilterType.ValueLessThan;684 } else if ("valueLessThanOrEqual" === val) {685 res = c_oAscPivotFilterType.ValueLessThanOrEqual;686 } else if ("valueBetween" === val) {687 res = c_oAscPivotFilterType.ValueBetween;688 } else if ("valueNotBetween" === val) {689 res = c_oAscPivotFilterType.ValueNotBetween;690 } else if ("dateEqual" === val) {691 res = c_oAscPivotFilterType.DateEqual;692 } else if ("dateNotEqual" === val) {693 res = c_oAscPivotFilterType.DateNotEqual;694 } else if ("dateOlderThan" === val) {695 res = c_oAscPivotFilterType.DateOlderThan;696 } else if ("dateOlderThanOrEqual" === val) {697 res = c_oAscPivotFilterType.DateOlderThanOrEqual;698 } else if ("dateNewerThan" === val) {699 res = c_oAscPivotFilterType.DateNewerThan;700 } else if ("dateNewerThanOrEqual" === val) {701 res = c_oAscPivotFilterType.DateNewerThanOrEqual;702 } else if ("dateBetween" === val) {703 res = c_oAscPivotFilterType.DateBetween;704 } else if ("dateNotBetween" === val) {705 res = c_oAscPivotFilterType.DateNotBetween;706 } else if ("tomorrow" === val) {707 res = c_oAscPivotFilterType.Tomorrow;708 } else if ("today" === val) {709 res = c_oAscPivotFilterType.Today;710 } else if ("yesterday" === val) {711 res = c_oAscPivotFilterType.Yesterday;712 } else if ("nextWeek" === val) {713 res = c_oAscPivotFilterType.NextWeek;714 } else if ("thisWeek" === val) {715 res = c_oAscPivotFilterType.ThisWeek;716 } else if ("lastWeek" === val) {717 res = c_oAscPivotFilterType.LastWeek;718 } else if ("nextMonth" === val) {719 res = c_oAscPivotFilterType.NextMonth;720 } else if ("thisMonth" === val) {721 res = c_oAscPivotFilterType.ThisMonth;722 } else if ("lastMonth" === val) {723 res = c_oAscPivotFilterType.LastMonth;724 } else if ("nextQuarter" === val) {725 res = c_oAscPivotFilterType.NextQuarter;726 } else if ("thisQuarter" === val) {727 res = c_oAscPivotFilterType.ThisQuarter;728 } else if ("lastQuarter" === val) {729 res = c_oAscPivotFilterType.LastQuarter;730 } else if ("nextYear" === val) {731 res = c_oAscPivotFilterType.NextYear;732 } else if ("thisYear" === val) {733 res = c_oAscPivotFilterType.ThisYear;734 } else if ("lastYear" === val) {735 res = c_oAscPivotFilterType.LastYear;736 } else if ("yearToDate" === val) {737 res = c_oAscPivotFilterType.YearToDate;738 } else if ("Q1" === val) {739 res = c_oAscPivotFilterType.Q1;740 } else if ("Q2" === val) {741 res = c_oAscPivotFilterType.Q2;742 } else if ("Q3" === val) {743 res = c_oAscPivotFilterType.Q3;744 } else if ("Q4" === val) {745 res = c_oAscPivotFilterType.Q4;746 } else if ("M1" === val) {747 res = c_oAscPivotFilterType.M1;748 } else if ("M2" === val) {749 res = c_oAscPivotFilterType.M2;750 } else if ("M3" === val) {751 res = c_oAscPivotFilterType.M3;752 } else if ("M4" === val) {753 res = c_oAscPivotFilterType.M4;754 } else if ("M5" === val) {755 res = c_oAscPivotFilterType.M5;756 } else if ("M6" === val) {757 res = c_oAscPivotFilterType.M6;758 } else if ("M7" === val) {759 res = c_oAscPivotFilterType.M7;760 } else if ("M8" === val) {761 res = c_oAscPivotFilterType.M8;762 } else if ("M9" === val) {763 res = c_oAscPivotFilterType.M9;764 } else if ("M10" === val) {765 res = c_oAscPivotFilterType.M10;766 } else if ("M11" === val) {767 res = c_oAscPivotFilterType.M11;768 } else if ("M12" === val) {769 res = c_oAscPivotFilterType.M12;770 }771 return res;772}773function ToXml_ST_PivotFilterType(val) {774 var res = "";775 if (c_oAscPivotFilterType.Unknown === val) {776 res = "unknown";777 } else if (c_oAscPivotFilterType.Count === val) {778 res = "count";779 } else if (c_oAscPivotFilterType.Percent === val) {780 res = "percent";781 } else if (c_oAscPivotFilterType.Sum === val) {782 res = "sum";783 } else if (c_oAscPivotFilterType.CaptionEqual === val) {784 res = "captionEqual";785 } else if (c_oAscPivotFilterType.CaptionNotEqual === val) {786 res = "captionNotEqual";787 } else if (c_oAscPivotFilterType.CaptionBeginsWith === val) {788 res = "captionBeginsWith";789 } else if (c_oAscPivotFilterType.CaptionNotBeginsWith === val) {790 res = "captionNotBeginsWith";791 } else if (c_oAscPivotFilterType.CaptionEndsWith === val) {792 res = "captionEndsWith";793 } else if (c_oAscPivotFilterType.CaptionNotEndsWith === val) {794 res = "captionNotEndsWith";795 } else if (c_oAscPivotFilterType.CaptionContains === val) {796 res = "captionContains";797 } else if (c_oAscPivotFilterType.CaptionNotContains === val) {798 res = "captionNotContains";799 } else if (c_oAscPivotFilterType.CaptionGreaterThan === val) {800 res = "captionGreaterThan";801 } else if (c_oAscPivotFilterType.CaptionGreaterThanOrEqual === val) {802 res = "captionGreaterThanOrEqual";803 } else if (c_oAscPivotFilterType.CaptionLessThan === val) {804 res = "captionLessThan";805 } else if (c_oAscPivotFilterType.CaptionLessThanOrEqual === val) {806 res = "captionLessThanOrEqual";807 } else if (c_oAscPivotFilterType.CaptionBetween === val) {808 res = "captionBetween";809 } else if (c_oAscPivotFilterType.CaptionNotBetween === val) {810 res = "captionNotBetween";811 } else if (c_oAscPivotFilterType.ValueEqual === val) {812 res = "valueEqual";813 } else if (c_oAscPivotFilterType.ValueNotEqual === val) {814 res = "valueNotEqual";815 } else if (c_oAscPivotFilterType.ValueGreaterThan === val) {816 res = "valueGreaterThan";817 } else if (c_oAscPivotFilterType.ValueGreaterThanOrEqual === val) {818 res = "valueGreaterThanOrEqual";819 } else if (c_oAscPivotFilterType.ValueLessThan === val) {820 res = "valueLessThan";821 } else if (c_oAscPivotFilterType.ValueLessThanOrEqual === val) {822 res = "valueLessThanOrEqual";823 } else if (c_oAscPivotFilterType.ValueBetween === val) {824 res = "valueBetween";825 } else if (c_oAscPivotFilterType.ValueNotBetween === val) {826 res = "valueNotBetween";827 } else if (c_oAscPivotFilterType.DateEqual === val) {828 res = "dateEqual";829 } else if (c_oAscPivotFilterType.DateNotEqual === val) {830 res = "dateNotEqual";831 } else if (c_oAscPivotFilterType.DateOlderThan === val) {832 res = "dateOlderThan";833 } else if (c_oAscPivotFilterType.DateOlderThanOrEqual === val) {834 res = "dateOlderThanOrEqual";835 } else if (c_oAscPivotFilterType.DateNewerThan === val) {836 res = "dateNewerThan";837 } else if (c_oAscPivotFilterType.DateNewerThanOrEqual === val) {838 res = "dateNewerThanOrEqual";839 } else if (c_oAscPivotFilterType.DateBetween === val) {840 res = "dateBetween";841 } else if (c_oAscPivotFilterType.DateNotBetween === val) {842 res = "dateNotBetween";843 } else if (c_oAscPivotFilterType.Tomorrow === val) {844 res = "tomorrow";845 } else if (c_oAscPivotFilterType.Today === val) {846 res = "today";847 } else if (c_oAscPivotFilterType.Yesterday === val) {848 res = "yesterday";849 } else if (c_oAscPivotFilterType.NextWeek === val) {850 res = "nextWeek";851 } else if (c_oAscPivotFilterType.ThisWeek === val) {852 res = "thisWeek";853 } else if (c_oAscPivotFilterType.LastWeek === val) {854 res = "lastWeek";855 } else if (c_oAscPivotFilterType.NextMonth === val) {856 res = "nextMonth";857 } else if (c_oAscPivotFilterType.ThisMonth === val) {858 res = "thisMonth";859 } else if (c_oAscPivotFilterType.LastMonth === val) {860 res = "lastMonth";861 } else if (c_oAscPivotFilterType.NextQuarter === val) {862 res = "nextQuarter";863 } else if (c_oAscPivotFilterType.ThisQuarter === val) {864 res = "thisQuarter";865 } else if (c_oAscPivotFilterType.LastQuarter === val) {866 res = "lastQuarter";867 } else if (c_oAscPivotFilterType.NextYear === val) {868 res = "nextYear";869 } else if (c_oAscPivotFilterType.ThisYear === val) {870 res = "thisYear";871 } else if (c_oAscPivotFilterType.LastYear === val) {872 res = "lastYear";873 } else if (c_oAscPivotFilterType.YearToDate === val) {874 res = "yearToDate";875 } else if (c_oAscPivotFilterType.Q1 === val) {876 res = "Q1";877 } else if (c_oAscPivotFilterType.Q2 === val) {878 res = "Q2";879 } else if (c_oAscPivotFilterType.Q3 === val) {880 res = "Q3";881 } else if (c_oAscPivotFilterType.Q4 === val) {882 res = "Q4";883 } else if (c_oAscPivotFilterType.M1 === val) {884 res = "M1";885 } else if (c_oAscPivotFilterType.M2 === val) {886 res = "M2";887 } else if (c_oAscPivotFilterType.M3 === val) {888 res = "M3";889 } else if (c_oAscPivotFilterType.M4 === val) {890 res = "M4";891 } else if (c_oAscPivotFilterType.M5 === val) {892 res = "M5";893 } else if (c_oAscPivotFilterType.M6 === val) {894 res = "M6";895 } else if (c_oAscPivotFilterType.M7 === val) {896 res = "M7";897 } else if (c_oAscPivotFilterType.M8 === val) {898 res = "M8";899 } else if (c_oAscPivotFilterType.M9 === val) {900 res = "M9";901 } else if (c_oAscPivotFilterType.M10 === val) {902 res = "M10";903 } else if (c_oAscPivotFilterType.M11 === val) {904 res = "M11";905 } else if (c_oAscPivotFilterType.M12 === val) {906 res = "M12";907 }908 return res;909}910function FromXml_ST_SortType(val) {911 var res = -1;912 if ("none" === val) {913 res = c_oAscSortType.None;914 } else if ("ascending" === val) {915 res = c_oAscSortType.Ascending;916 } else if ("descending" === val) {917 res = c_oAscSortType.Descending;918 } else if ("ascendingAlpha" === val) {919 res = c_oAscSortType.AscendingAlpha;920 } else if ("descendingAlpha" === val) {921 res = c_oAscSortType.DescendingAlpha;922 } else if ("ascendingNatural" === val) {923 res = c_oAscSortType.AscendingNatural;924 } else if ("descendingNatural" === val) {925 res = c_oAscSortType.DescendingNatural;926 }927 return res;928}929function ToXml_ST_SortType(val) {930 var res = "";931 if (c_oAscSortType.None === val) {932 res = "none";933 } else if (c_oAscSortType.Ascending === val) {934 res = "ascending";935 } else if (c_oAscSortType.Descending === val) {936 res = "descending";937 } else if (c_oAscSortType.AscendingAlpha === val) {938 res = "ascendingAlpha";939 } else if (c_oAscSortType.DescendingAlpha === val) {940 res = "descendingAlpha";941 } else if (c_oAscSortType.AscendingNatural === val) {942 res = "ascendingNatural";943 } else if (c_oAscSortType.DescendingNatural === val) {944 res = "descendingNatural";945 }946 return res;947}948function FromXml_ST_PivotAreaType(val) {949 var res = -1;950 if ("none" === val) {951 res = c_oAscPivotAreaType.None;952 } else if ("normal" === val) {953 res = c_oAscPivotAreaType.Normal;954 } else if ("data" === val) {955 res = c_oAscPivotAreaType.Data;956 } else if ("all" === val) {957 res = c_oAscPivotAreaType.All;958 } else if ("origin" === val) {959 res = c_oAscPivotAreaType.Origin;960 } else if ("button" === val) {961 res = c_oAscPivotAreaType.Button;962 } else if ("topEnd" === val) {963 res = c_oAscPivotAreaType.TopEnd;964 }965 return res;966}967function ToXml_ST_PivotAreaType(val) {968 var res = "";969 if (c_oAscPivotAreaType.None === val) {970 res = "none";971 } else if (c_oAscPivotAreaType.Normal === val) {972 res = "normal";973 } else if (c_oAscPivotAreaType.Data === val) {974 res = "data";975 } else if (c_oAscPivotAreaType.All === val) {976 res = "all";977 } else if (c_oAscPivotAreaType.Origin === val) {978 res = "origin";979 } else if (c_oAscPivotAreaType.Button === val) {980 res = "button";981 } else if (c_oAscPivotAreaType.TopEnd === val) {982 res = "topEnd";983 }984 return res;985}986function FromXml_ST_GroupBy(val) {987 var res = -1;988 if ("range" === val) {989 res = c_oAscGroupBy.Range;990 } else if ("seconds" === val) {991 res = c_oAscGroupBy.Seconds;992 } else if ("minutes" === val) {993 res = c_oAscGroupBy.Minutes;994 } else if ("hours" === val) {995 res = c_oAscGroupBy.Hours;996 } else if ("days" === val) {997 res = c_oAscGroupBy.Days;998 } else if ("months" === val) {999 res = c_oAscGroupBy.Months;1000 } else if ("quarters" === val) {1001 res = c_oAscGroupBy.Quarters;1002 } else if ("years" === val) {1003 res = c_oAscGroupBy.Years;1004 }1005 return res;1006}1007function ToXml_ST_GroupBy(val) {1008 var res = "";1009 if (c_oAscGroupBy.Range === val) {1010 res = "range";1011 } else if (c_oAscGroupBy.Seconds === val) {1012 res = "seconds";1013 } else if (c_oAscGroupBy.Minutes === val) {1014 res = "minutes";1015 } else if (c_oAscGroupBy.Hours === val) {1016 res = "hours";1017 } else if (c_oAscGroupBy.Days === val) {1018 res = "days";1019 } else if (c_oAscGroupBy.Months === val) {1020 res = "months";1021 } else if (c_oAscGroupBy.Quarters === val) {1022 res = "quarters";1023 } else if (c_oAscGroupBy.Years === val) {1024 res = "years";1025 }1026 return res;1027}1028function FromXml_ST_SortMethod(val) {1029 var res = -1;1030 if ("stroke" === val) {1031 res = c_oAscSortMethod.Stroke;1032 } else if ("pinYin" === val) {1033 res = c_oAscSortMethod.PinYin;1034 } else if ("none" === val) {1035 res = c_oAscSortMethod.None;1036 }1037 return res;1038}1039function ToXml_ST_SortMethod(val) {1040 var res = "";1041 if (c_oAscSortMethod.Stroke === val) {1042 res = "stroke";1043 } else if (c_oAscSortMethod.PinYin === val) {1044 res = "pinYin";1045 } else if (c_oAscSortMethod.None === val) {1046 res = "none";1047 }1048 return res;1049}1050function FromXml_ST_DynamicFilterType(val) {1051 var res = -1;1052 if ("null" === val) {1053 res = c_oAscDynamicFilterType.Null;1054 } else if ("aboveAverage" === val) {1055 res = c_oAscDynamicFilterType.AboveAverage;1056 } else if ("belowAverage" === val) {1057 res = c_oAscDynamicFilterType.BelowAverage;1058 } else if ("tomorrow" === val) {1059 res = c_oAscDynamicFilterType.Tomorrow;1060 } else if ("today" === val) {1061 res = c_oAscDynamicFilterType.Today;1062 } else if ("yesterday" === val) {1063 res = c_oAscDynamicFilterType.Yesterday;1064 } else if ("nextWeek" === val) {1065 res = c_oAscDynamicFilterType.NextWeek;1066 } else if ("thisWeek" === val) {1067 res = c_oAscDynamicFilterType.ThisWeek;1068 } else if ("lastWeek" === val) {1069 res = c_oAscDynamicFilterType.LastWeek;1070 } else if ("nextMonth" === val) {1071 res = c_oAscDynamicFilterType.NextMonth;1072 } else if ("thisMonth" === val) {1073 res = c_oAscDynamicFilterType.ThisMonth;1074 } else if ("lastMonth" === val) {1075 res = c_oAscDynamicFilterType.LastMonth;1076 } else if ("nextQuarter" === val) {1077 res = c_oAscDynamicFilterType.NextQuarter;1078 } else if ("thisQuarter" === val) {1079 res = c_oAscDynamicFilterType.ThisQuarter;1080 } else if ("lastQuarter" === val) {1081 res = c_oAscDynamicFilterType.LastQuarter;1082 } else if ("nextYear" === val) {1083 res = c_oAscDynamicFilterType.NextYear;1084 } else if ("thisYear" === val) {1085 res = c_oAscDynamicFilterType.ThisYear;1086 } else if ("lastYear" === val) {1087 res = c_oAscDynamicFilterType.LastYear;1088 } else if ("yearToDate" === val) {1089 res = c_oAscDynamicFilterType.YearToDate;1090 } else if ("Q1" === val) {1091 res = c_oAscDynamicFilterType.Q1;1092 } else if ("Q2" === val) {1093 res = c_oAscDynamicFilterType.Q2;1094 } else if ("Q3" === val) {1095 res = c_oAscDynamicFilterType.Q3;1096 } else if ("Q4" === val) {1097 res = c_oAscDynamicFilterType.Q4;1098 } else if ("M1" === val) {1099 res = c_oAscDynamicFilterType.M1;1100 } else if ("M2" === val) {1101 res = c_oAscDynamicFilterType.M2;1102 } else if ("M3" === val) {1103 res = c_oAscDynamicFilterType.M3;1104 } else if ("M4" === val) {1105 res = c_oAscDynamicFilterType.M4;1106 } else if ("M5" === val) {1107 res = c_oAscDynamicFilterType.M5;1108 } else if ("M6" === val) {1109 res = c_oAscDynamicFilterType.M6;1110 } else if ("M7" === val) {1111 res = c_oAscDynamicFilterType.M7;1112 } else if ("M8" === val) {1113 res = c_oAscDynamicFilterType.M8;1114 } else if ("M9" === val) {1115 res = c_oAscDynamicFilterType.M9;1116 } else if ("M10" === val) {1117 res = c_oAscDynamicFilterType.M10;1118 } else if ("M11" === val) {1119 res = c_oAscDynamicFilterType.M11;1120 } else if ("M12" === val) {1121 res = c_oAscDynamicFilterType.M12;1122 }1123 return res;1124}1125function ToXml_ST_DynamicFilterType(val) {1126 var res = "";1127 if (c_oAscDynamicFilterType.Null === val) {1128 res = "null";1129 } else if (c_oAscDynamicFilterType.AboveAverage === val) {1130 res = "aboveAverage";1131 } else if (c_oAscDynamicFilterType.BelowAverage === val) {1132 res = "belowAverage";1133 } else if (c_oAscDynamicFilterType.Tomorrow === val) {1134 res = "tomorrow";1135 } else if (c_oAscDynamicFilterType.Today === val) {1136 res = "today";1137 } else if (c_oAscDynamicFilterType.Yesterday === val) {1138 res = "yesterday";1139 } else if (c_oAscDynamicFilterType.NextWeek === val) {1140 res = "nextWeek";1141 } else if (c_oAscDynamicFilterType.ThisWeek === val) {1142 res = "thisWeek";1143 } else if (c_oAscDynamicFilterType.LastWeek === val) {1144 res = "lastWeek";1145 } else if (c_oAscDynamicFilterType.NextMonth === val) {1146 res = "nextMonth";1147 } else if (c_oAscDynamicFilterType.ThisMonth === val) {1148 res = "thisMonth";1149 } else if (c_oAscDynamicFilterType.LastMonth === val) {1150 res = "lastMonth";1151 } else if (c_oAscDynamicFilterType.NextQuarter === val) {1152 res = "nextQuarter";1153 } else if (c_oAscDynamicFilterType.ThisQuarter === val) {1154 res = "thisQuarter";1155 } else if (c_oAscDynamicFilterType.LastQuarter === val) {1156 res = "lastQuarter";1157 } else if (c_oAscDynamicFilterType.NextYear === val) {1158 res = "nextYear";1159 } else if (c_oAscDynamicFilterType.ThisYear === val) {1160 res = "thisYear";1161 } else if (c_oAscDynamicFilterType.LastYear === val) {1162 res = "lastYear";1163 } else if (c_oAscDynamicFilterType.YearToDate === val) {1164 res = "yearToDate";1165 } else if (c_oAscDynamicFilterType.Q1 === val) {1166 res = "Q1";1167 } else if (c_oAscDynamicFilterType.Q2 === val) {1168 res = "Q2";1169 } else if (c_oAscDynamicFilterType.Q3 === val) {1170 res = "Q3";1171 } else if (c_oAscDynamicFilterType.Q4 === val) {1172 res = "Q4";1173 } else if (c_oAscDynamicFilterType.M1 === val) {1174 res = "M1";1175 } else if (c_oAscDynamicFilterType.M2 === val) {1176 res = "M2";1177 } else if (c_oAscDynamicFilterType.M3 === val) {1178 res = "M3";1179 } else if (c_oAscDynamicFilterType.M4 === val) {1180 res = "M4";1181 } else if (c_oAscDynamicFilterType.M5 === val) {1182 res = "M5";1183 } else if (c_oAscDynamicFilterType.M6 === val) {1184 res = "M6";1185 } else if (c_oAscDynamicFilterType.M7 === val) {1186 res = "M7";1187 } else if (c_oAscDynamicFilterType.M8 === val) {1188 res = "M8";1189 } else if (c_oAscDynamicFilterType.M9 === val) {1190 res = "M9";1191 } else if (c_oAscDynamicFilterType.M10 === val) {1192 res = "M10";1193 } else if (c_oAscDynamicFilterType.M11 === val) {1194 res = "M11";1195 } else if (c_oAscDynamicFilterType.M12 === val) {1196 res = "M12";1197 }1198 return res;1199}1200function FromXml_ST_CalendarType(val) {1201 var res = -1;1202 if ("gregorian" === val) {1203 res = c_oAscCalendarType.Gregorian;1204 } else if ("gregorianUs" === val) {1205 res = c_oAscCalendarType.GregorianUs;1206 } else if ("gregorianMeFrench" === val) {1207 res = c_oAscCalendarType.GregorianMeFrench;1208 } else if ("gregorianArabic" === val) {1209 res = c_oAscCalendarType.GregorianArabic;1210 } else if ("hijri" === val) {1211 res = c_oAscCalendarType.Hijri;1212 } else if ("hebrew" === val) {1213 res = c_oAscCalendarType.Hebrew;1214 } else if ("taiwan" === val) {1215 res = c_oAscCalendarType.Taiwan;1216 } else if ("japan" === val) {1217 res = c_oAscCalendarType.Japan;1218 } else if ("thai" === val) {1219 res = c_oAscCalendarType.Thai;1220 } else if ("korea" === val) {1221 res = c_oAscCalendarType.Korea;1222 } else if ("saka" === val) {1223 res = c_oAscCalendarType.Saka;1224 } else if ("gregorianXlitEnglish" === val) {1225 res = c_oAscCalendarType.GregorianXlitEnglish;1226 } else if ("gregorianXlitFrench" === val) {1227 res = c_oAscCalendarType.GregorianXlitFrench;1228 } else if ("none" === val) {1229 res = c_oAscCalendarType.None;1230 }1231 return res;1232}1233function ToXml_ST_CalendarType(val) {1234 var res = "";1235 if (c_oAscCalendarType.Gregorian === val) {1236 res = "gregorian";1237 } else if (c_oAscCalendarType.GregorianUs === val) {1238 res = "gregorianUs";1239 } else if (c_oAscCalendarType.GregorianMeFrench === val) {1240 res = "gregorianMeFrench";1241 } else if (c_oAscCalendarType.GregorianArabic === val) {1242 res = "gregorianArabic";1243 } else if (c_oAscCalendarType.Hijri === val) {1244 res = "hijri";1245 } else if (c_oAscCalendarType.Hebrew === val) {1246 res = "hebrew";1247 } else if (c_oAscCalendarType.Taiwan === val) {1248 res = "taiwan";1249 } else if (c_oAscCalendarType.Japan === val) {1250 res = "japan";1251 } else if (c_oAscCalendarType.Thai === val) {1252 res = "thai";1253 } else if (c_oAscCalendarType.Korea === val) {1254 res = "korea";1255 } else if (c_oAscCalendarType.Saka === val) {1256 res = "saka";1257 } else if (c_oAscCalendarType.GregorianXlitEnglish === val) {1258 res = "gregorianXlitEnglish";1259 } else if (c_oAscCalendarType.GregorianXlitFrench === val) {1260 res = "gregorianXlitFrench";1261 } else if (c_oAscCalendarType.None === val) {1262 res = "none";1263 }1264 return res;1265}1266function FromXml_ST_IconSetType(val) {1267 var res = -1;1268 if ("3Arrows" === val) {1269 res = c_oAscIconSetType.ThreeArrows;1270 } else if ("3ArrowsGray" === val) {1271 res = c_oAscIconSetType.ThreeArrowsGray;1272 } else if ("3Flags" === val) {1273 res = c_oAscIconSetType.ThreeFlags;1274 } else if ("3TrafficLights1" === val) {1275 res = c_oAscIconSetType.ThreeTrafficLights1;1276 } else if ("3TrafficLights2" === val) {1277 res = c_oAscIconSetType.ThreeTrafficLights2;1278 } else if ("3Signs" === val) {1279 res = c_oAscIconSetType.ThreeSigns;1280 } else if ("3Symbols" === val) {1281 res = c_oAscIconSetType.ThreeSymbols;1282 } else if ("3Symbols2" === val) {1283 res = c_oAscIconSetType.ThreeSymbols2;1284 } else if ("4Arrows" === val) {1285 res = c_oAscIconSetType.FourArrows;1286 } else if ("4ArrowsGray" === val) {1287 res = c_oAscIconSetType.FourArrowsGray;1288 } else if ("4RedToBlack" === val) {1289 res = c_oAscIconSetType.FourRedToBlack;1290 } else if ("4Rating" === val) {1291 res = c_oAscIconSetType.FourRating;1292 } else if ("4TrafficLights" === val) {1293 res = c_oAscIconSetType.FourTrafficLights;1294 } else if ("5Arrows" === val) {1295 res = c_oAscIconSetType.FiveArrows;1296 } else if ("5ArrowsGray" === val) {1297 res = c_oAscIconSetType.FiveArrowsGray;1298 } else if ("5Rating" === val) {1299 res = c_oAscIconSetType.FiveRating;1300 } else if ("5Quarters" === val) {1301 res = c_oAscIconSetType.FiveQuarters;1302 }1303 return res;1304}1305function ToXml_ST_IconSetType(val) {1306 var res = "";1307 if (c_oAscIconSetType.ThreeArrows === val) {1308 res = "3Arrows";1309 } else if (c_oAscIconSetType.ThreeArrowsGray === val) {1310 res = "3ArrowsGray";1311 } else if (c_oAscIconSetType.ThreeFlags === val) {1312 res = "3Flags";1313 } else if (c_oAscIconSetType.ThreeTrafficLights1 === val) {1314 res = "3TrafficLights1";1315 } else if (c_oAscIconSetType.ThreeTrafficLights2 === val) {1316 res = "3TrafficLights2";1317 } else if (c_oAscIconSetType.ThreeSigns === val) {1318 res = "3Signs";1319 } else if (c_oAscIconSetType.ThreeSymbols === val) {1320 res = "3Symbols";1321 } else if (c_oAscIconSetType.ThreeSymbols2 === val) {1322 res = "3Symbols2";1323 } else if (c_oAscIconSetType.FourArrows === val) {1324 res = "4Arrows";1325 } else if (c_oAscIconSetType.FourArrowsGray === val) {1326 res = "4ArrowsGray";1327 } else if (c_oAscIconSetType.FourRedToBlack === val) {1328 res = "4RedToBlack";1329 } else if (c_oAscIconSetType.FourRating === val) {1330 res = "4Rating";1331 } else if (c_oAscIconSetType.FourTrafficLights === val) {1332 res = "4TrafficLights";1333 } else if (c_oAscIconSetType.FiveArrows === val) {1334 res = "5Arrows";1335 } else if (c_oAscIconSetType.FiveArrowsGray === val) {1336 res = "5ArrowsGray";1337 } else if (c_oAscIconSetType.FiveRating === val) {1338 res = "5Rating";1339 } else if (c_oAscIconSetType.FiveQuarters === val) {1340 res = "5Quarters";1341 }1342 return res;1343}1344function FromXml_ST_SortBy(val) {1345 var res = -1;1346 if ("value" === val) {1347 res = c_oAscSortBy.Value;1348 } else if ("cellColor" === val) {1349 res = c_oAscSortBy.CellColor;1350 } else if ("fontColor" === val) {1351 res = c_oAscSortBy.FontColor;1352 } else if ("icon" === val) {1353 res = c_oAscSortBy.Icon;1354 }1355 return res;1356}1357function ToXml_ST_SortBy(val) {1358 var res = "";1359 if (c_oAscSortBy.Value === val) {1360 res = "value";1361 } else if (c_oAscSortBy.CellColor === val) {1362 res = "cellColor";1363 } else if (c_oAscSortBy.FontColor === val) {1364 res = "fontColor";1365 } else if (c_oAscSortBy.Icon === val) {1366 res = "icon";1367 }1368 return res;1369}1370function FromXml_ST_FilterOperator(val) {1371 var res = -1;1372 if ("equal" === val) {1373 res = c_oAscFilterOperator.Equal;1374 } else if ("lessThan" === val) {1375 res = c_oAscFilterOperator.LessThan;1376 } else if ("lessThanOrEqual" === val) {1377 res = c_oAscFilterOperator.LessThanOrEqual;1378 } else if ("notEqual" === val) {1379 res = c_oAscFilterOperator.NotEqual;1380 } else if ("greaterThanOrEqual" === val) {1381 res = c_oAscFilterOperator.GreaterThanOrEqual;1382 } else if ("greaterThan" === val) {1383 res = c_oAscFilterOperator.GreaterThan;1384 }1385 return res;1386}1387function ToXml_ST_FilterOperator(val) {1388 var res = "";1389 if (c_oAscFilterOperator.Equal === val) {1390 res = "equal";1391 } else if (c_oAscFilterOperator.LessThan === val) {1392 res = "lessThan";1393 } else if (c_oAscFilterOperator.LessThanOrEqual === val) {1394 res = "lessThanOrEqual";1395 } else if (c_oAscFilterOperator.NotEqual === val) {1396 res = "notEqual";1397 } else if (c_oAscFilterOperator.GreaterThanOrEqual === val) {1398 res = "greaterThanOrEqual";1399 } else if (c_oAscFilterOperator.GreaterThan === val) {1400 res = "greaterThan";1401 }1402 return res;1403}1404function FromXml_ST_DateTimeGrouping(val) {1405 var res = -1;1406 if ("year" === val) {1407 res = c_oAscDateTimeGrouping.Year;1408 } else if ("month" === val) {1409 res = c_oAscDateTimeGrouping.Month;1410 } else if ("day" === val) {1411 res = c_oAscDateTimeGrouping.Day;1412 } else if ("hour" === val) {1413 res = c_oAscDateTimeGrouping.Hour;1414 } else if ("minute" === val) {1415 res = c_oAscDateTimeGrouping.Minute;1416 } else if ("second" === val) {1417 res = c_oAscDateTimeGrouping.Second;1418 }1419 return res;1420}1421function ToXml_ST_DateTimeGrouping(val) {1422 var res = "";1423 if (c_oAscDateTimeGrouping.Year === val) {1424 res = "year";1425 } else if (c_oAscDateTimeGrouping.Month === val) {1426 res = "month";1427 } else if (c_oAscDateTimeGrouping.Day === val) {1428 res = "day";1429 } else if (c_oAscDateTimeGrouping.Hour === val) {1430 res = "hour";1431 } else if (c_oAscDateTimeGrouping.Minute === val) {1432 res = "minute";1433 } else if (c_oAscDateTimeGrouping.Second === val) {1434 res = "second";1435 }1436 return res;1437}1438function FromXml_ST_AllocationMethod(val) {1439 var res = -1;1440 if ("equalAllocation" === val) {1441 res = c_oAscAllocationMethod.EqualAllocation;1442 } else if ("equalIncrement" === val) {1443 res = c_oAscAllocationMethod.EqualIncrement;1444 } else if ("weightedAllocation" === val) {1445 res = c_oAscAllocationMethod.WeightedAllocation;1446 } else if ("weightedIncrement" === val) {1447 res = c_oAscAllocationMethod.WeightedIncrement;1448 }1449 return res;1450}1451function ToXml_ST_AllocationMethod(val) {1452 var res = "";1453 if (c_oAscAllocationMethod.EqualAllocation === val) {1454 res = "equalAllocation";1455 } else if (c_oAscAllocationMethod.EqualIncrement === val) {1456 res = "equalIncrement";1457 } else if (c_oAscAllocationMethod.WeightedAllocation === val) {1458 res = "weightedAllocation";1459 } else if (c_oAscAllocationMethod.WeightedIncrement === val) {1460 res = "weightedIncrement";1461 }1462 return res;1463}1464function CT_PivotCacheDefinition() {1465//Attributes1466 this.id = null;1467 this.invalid = null;//false1468 this.saveData = null;//true1469 this.refreshOnLoad = null;//false1470 this.optimizeMemory = null;//false1471 this.enableRefresh = null;//true1472 this.refreshedBy = null;1473 this.refreshedDate = null;1474 this.backgroundQuery = null;//false1475 this.missingItemsLimit = null;1476 this.createdVersion = null;//01477 this.refreshedVersion = null;//01478 this.minRefreshableVersion = null;//01479 this.recordCount = null;1480 this.upgradeOnRefresh = null;//false1481 this.tupleCache = null;//false1482 this.supportSubquery = null;//false1483 this.supportAdvancedDrill = null;//false1484//Members1485 this.cacheSource = null;1486 this.cacheFields = null;1487 this.cacheHierarchies = null;1488 this.kpis = null;1489 this.tupleCache = null;1490 this.calculatedItems = null;1491 this.calculatedMembers = null;1492 this.dimensions = null;1493 this.measureGroups = null;1494 this.maps = null;1495 this.extLst = null;1496 //editor1497 this.cacheRecords = null;1498}1499CT_PivotCacheDefinition.prototype.readAttributes = function(attr, uq) {1500 if (attr()) {1501 var vals = attr();1502 var val;1503 val = vals["r:id"];1504 if (undefined !== val) {1505 this.id = uq(val);1506 }1507 val = vals["invalid"];1508 if (undefined !== val) {1509 this.invalid = getBoolFromXml(val);1510 }1511 val = vals["saveData"];1512 if (undefined !== val) {1513 this.saveData = getBoolFromXml(val);1514 }1515 val = vals["refreshOnLoad"];1516 if (undefined !== val) {1517 this.refreshOnLoad = getBoolFromXml(val);1518 }1519 val = vals["optimizeMemory"];1520 if (undefined !== val) {1521 this.optimizeMemory = getBoolFromXml(val);1522 }1523 val = vals["enableRefresh"];1524 if (undefined !== val) {1525 this.enableRefresh = getBoolFromXml(val);1526 }1527 val = vals["refreshedBy"];1528 if (undefined !== val) {1529 this.refreshedBy = uq(val);1530 }1531 val = vals["refreshedDate"];1532 if (undefined !== val) {1533 this.refreshedDate = val - 0;1534 }1535 val = vals["backgroundQuery"];1536 if (undefined !== val) {1537 this.backgroundQuery = getBoolFromXml(val);1538 }1539 val = vals["missingItemsLimit"];1540 if (undefined !== val) {1541 this.missingItemsLimit = val - 0;1542 }1543 val = vals["createdVersion"];1544 if (undefined !== val) {1545 this.createdVersion = val - 0;1546 }1547 val = vals["refreshedVersion"];1548 if (undefined !== val) {1549 this.refreshedVersion = val - 0;1550 }1551 val = vals["minRefreshableVersion"];1552 if (undefined !== val) {1553 this.minRefreshableVersion = val - 0;1554 }1555 val = vals["recordCount"];1556 if (undefined !== val) {1557 this.recordCount = val - 0;1558 }1559 val = vals["upgradeOnRefresh"];1560 if (undefined !== val) {1561 this.upgradeOnRefresh = getBoolFromXml(val);1562 }1563 val = vals["tupleCache"];1564 if (undefined !== val) {1565 this.tupleCache = getBoolFromXml(val);1566 }1567 val = vals["supportSubquery"];1568 if (undefined !== val) {1569 this.supportSubquery = getBoolFromXml(val);1570 }1571 val = vals["supportAdvancedDrill"];1572 if (undefined !== val) {1573 this.supportAdvancedDrill = getBoolFromXml(val);1574 }1575 }1576};1577CT_PivotCacheDefinition.prototype.onStartNode = function(elem, attr, uq) {1578 var newContext = this;1579 if ("pivotCacheDefinition" === elem) {1580 if (newContext.readAttributes) {1581 newContext.readAttributes(attr, uq);1582 }1583 } else if ("cacheSource" === elem) {1584 newContext = new CT_CacheSource();1585 if (newContext.readAttributes) {1586 newContext.readAttributes(attr, uq);1587 }1588 this.cacheSource = newContext;1589 } else if ("cacheFields" === elem) {1590 newContext = new CT_CacheFields();1591 if (newContext.readAttributes) {1592 newContext.readAttributes(attr, uq);1593 }1594 this.cacheFields = newContext;1595 } else if ("cacheHierarchies" === elem) {1596 newContext = new CT_CacheHierarchies();1597 if (newContext.readAttributes) {1598 newContext.readAttributes(attr, uq);1599 }1600 this.cacheHierarchies = newContext;1601 } else if ("kpis" === elem) {1602 newContext = new CT_PCDKPIs();1603 if (newContext.readAttributes) {1604 newContext.readAttributes(attr, uq);1605 }1606 this.kpis = newContext;1607 } else if ("tupleCache" === elem) {1608 newContext = new CT_TupleCache();1609 if (newContext.readAttributes) {1610 newContext.readAttributes(attr, uq);1611 }1612 this.tupleCache = newContext;1613 } else if ("calculatedItems" === elem) {1614 newContext = new CT_CalculatedItems();1615 if (newContext.readAttributes) {1616 newContext.readAttributes(attr, uq);1617 }1618 this.calculatedItems = newContext;1619 } else if ("calculatedMembers" === elem) {1620 newContext = new CT_CalculatedMembers();1621 if (newContext.readAttributes) {1622 newContext.readAttributes(attr, uq);1623 }1624 this.calculatedMembers = newContext;1625 } else if ("dimensions" === elem) {1626 newContext = new CT_Dimensions();1627 if (newContext.readAttributes) {1628 newContext.readAttributes(attr, uq);1629 }1630 this.dimensions = newContext;1631 } else if ("measureGroups" === elem) {1632 newContext = new CT_MeasureGroups();1633 if (newContext.readAttributes) {1634 newContext.readAttributes(attr, uq);1635 }1636 this.measureGroups = newContext;1637 } else if ("maps" === elem) {1638 newContext = new CT_MeasureDimensionMaps();1639 if (newContext.readAttributes) {1640 newContext.readAttributes(attr, uq);1641 }1642 this.maps = newContext;1643 } else if ("extLst" === elem) {1644 newContext = new CT_ExtensionList();1645 if (newContext.readAttributes) {1646 newContext.readAttributes(attr, uq);1647 }1648 this.extLst = newContext;1649 } else {1650 newContext = null;1651 }1652 return newContext;1653};1654CT_PivotCacheDefinition.prototype.toXml = function(writer) {1655 writer.WriteXmlString("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");1656 writer.WriteXmlNodeStart("pivotCacheDefinition");1657 writer.WriteXmlString(1658 " xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"");1659 //todo1660 // if (null !== this.id) {1661 // writer.WriteXmlAttributeStringEncode("r:id", this.id);1662 // }1663 if (null !== this.invalid) {1664 writer.WriteXmlAttributeBool("invalid", this.invalid);1665 }1666 if (null !== this.saveData) {1667 writer.WriteXmlAttributeBool("saveData", this.saveData);1668 }1669 if (null !== this.refreshOnLoad) {1670 writer.WriteXmlAttributeBool("refreshOnLoad", this.refreshOnLoad);1671 }1672 if (null !== this.optimizeMemory) {1673 writer.WriteXmlAttributeBool("optimizeMemory", this.optimizeMemory);1674 }1675 if (null !== this.enableRefresh) {1676 writer.WriteXmlAttributeBool("enableRefresh", this.enableRefresh);1677 }1678 if (null !== this.refreshedBy) {1679 writer.WriteXmlAttributeStringEncode("refreshedBy", this.refreshedBy);1680 }1681 if (null !== this.refreshedDate) {1682 writer.WriteXmlAttributeNumber("refreshedDate", this.refreshedDate);1683 }1684 if (null !== this.backgroundQuery) {1685 writer.WriteXmlAttributeBool("backgroundQuery", this.backgroundQuery);1686 }1687 if (null !== this.missingItemsLimit) {1688 writer.WriteXmlAttributeNumber("missingItemsLimit", this.missingItemsLimit);1689 }1690 if (null !== this.createdVersion) {1691 writer.WriteXmlAttributeNumber("createdVersion", this.createdVersion);1692 }1693 if (null !== this.refreshedVersion) {1694 writer.WriteXmlAttributeNumber("refreshedVersion", this.refreshedVersion);1695 }1696 if (null !== this.minRefreshableVersion) {1697 writer.WriteXmlAttributeNumber("minRefreshableVersion", this.minRefreshableVersion);1698 }1699 if (null !== this.recordCount) {1700 writer.WriteXmlAttributeNumber("recordCount", this.recordCount);1701 }1702 if (null !== this.upgradeOnRefresh) {1703 writer.WriteXmlAttributeBool("upgradeOnRefresh", this.upgradeOnRefresh);1704 }1705 if (null !== this.tupleCache) {1706 writer.WriteXmlAttributeBool("tupleCache", this.tupleCache);1707 }1708 if (null !== this.supportSubquery) {1709 writer.WriteXmlAttributeBool("supportSubquery", this.supportSubquery);1710 }1711 if (null !== this.supportAdvancedDrill) {1712 writer.WriteXmlAttributeBool("supportAdvancedDrill", this.supportAdvancedDrill);1713 }1714 writer.WriteXmlNodeEnd("pivotCacheDefinition", true);1715 if (null !== this.cacheSource) {1716 this.cacheSource.toXml(writer, "cacheSource");1717 }1718 if (null !== this.cacheFields) {1719 this.cacheFields.toXml(writer, "cacheFields");1720 }1721 if (null !== this.cacheHierarchies) {1722 this.cacheHierarchies.toXml(writer, "cacheHierarchies");1723 }1724 if (null !== this.kpis) {1725 this.kpis.toXml(writer, "kpis");1726 }1727 if (null !== this.tupleCache) {1728 this.tupleCache.toXml(writer, "tupleCache");1729 }1730 if (null !== this.calculatedItems) {1731 this.calculatedItems.toXml(writer, "calculatedItems");1732 }1733 if (null !== this.calculatedMembers) {1734 this.calculatedMembers.toXml(writer, "calculatedMembers");1735 }1736 if (null !== this.dimensions) {1737 this.dimensions.toXml(writer, "dimensions");1738 }1739 if (null !== this.measureGroups) {1740 this.measureGroups.toXml(writer, "measureGroups");1741 }1742 if (null !== this.maps) {1743 this.maps.toXml(writer, "maps");1744 }1745 if (null !== this.extLst) {1746 this.extLst.toXml(writer, "extLst");1747 }1748 writer.WriteXmlNodeEnd("pivotCacheDefinition");1749};1750CT_PivotCacheDefinition.prototype.getFields = function () {1751 return this.cacheFields && this.cacheFields.cacheField;1752};1753CT_PivotCacheDefinition.prototype.getRecords = function () {1754 return this.cacheRecords && this.cacheRecords;1755};1756CT_PivotCacheDefinition.prototype.isValidCacheSource = function () {1757 return this.cacheSource && this.cacheSource.type === c_oAscSourceType.Worksheet;1758};1759function CT_PivotCacheRecords() {1760//Attributes1761 this.count = null;1762//Members1763 this.extLst = null;1764//internal1765 this._cols = [];1766 this._curColIndex = 0;1767}1768CT_PivotCacheRecords.prototype.readAttributes = function(attr, uq) {1769 if (attr()) {1770 var vals = attr();1771 var val;1772 val = vals["count"];1773 if (undefined !== val) {1774 this.count = val - 0;1775 }1776 }1777};1778CT_PivotCacheRecords.prototype.onStartNode = function(elem, attr, uq) {1779 var newContext = this;1780 if ("pivotCacheRecords" === elem) {1781 if (newContext.readAttributes) {1782 newContext.readAttributes(attr, uq);1783 }1784 } else if ("r" === elem) {1785 this._curColIndex = 0;1786 } else {1787 var newContextCandidate = this._getCol(this._curColIndex).onStartNode(elem, attr, uq);1788 if (newContextCandidate) {1789 newContext = newContextCandidate;1790 } else if ("extLst" === elem) {1791 newContext = new CT_ExtensionList();1792 if (newContext.readAttributes) {1793 newContext.readAttributes(attr, uq);1794 }1795 this.extLst = newContext;1796 } else {1797 newContext = null;1798 }1799 }1800 return newContext;1801};1802CT_PivotCacheRecords.prototype.onEndNode = function(prevContext, elem) {1803 if (this._getCol(this._curColIndex).onEndNode(prevContext, elem)) {1804 this._curColIndex++;1805 }1806};1807CT_PivotCacheRecords.prototype.toXml = function(writer) {1808 writer.WriteXmlString("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");1809 writer.WriteXmlNodeStart("pivotCacheRecords");1810 writer.WriteXmlString(1811 " xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"");1812 if (null !== this.count) {1813 writer.WriteXmlAttributeNumber("count", this.count);1814 }1815 writer.WriteXmlNodeEnd("pivotCacheRecords", true);1816 if (null !== this._cols) {1817 var rowsCount = this._cols[0].size;1818 for (var i = 0; i < rowsCount; ++i) {1819 writer.WriteXmlNodeStart("r", true);1820 for (var j = 0; j < this._cols.length; ++j) {1821 this._cols[j].toXml(writer, i);1822 }1823 writer.WriteXmlNodeEnd("r");1824 }1825 }1826 if (null !== this.extLst) {1827 this.extLst.toXml(writer, "extLst");1828 }1829 writer.WriteXmlNodeEnd("pivotCacheRecords");1830};1831CT_PivotCacheRecords.prototype.getRowsCount = function() {1832 return null !== this._cols ? this._cols[0].size : 0;1833};1834CT_PivotCacheRecords.prototype.get = function(row, col) {1835 var col = this._cols[col];1836 if (col) {1837 return col.get(row);1838 }1839};1840CT_PivotCacheRecords.prototype._getCol = function(index, type) {1841 var col = this._cols[index];1842 if(!col){1843 col = new PivotRecords();1844 col.setStartCount(this.count);1845 this._cols[index] = col;1846 }1847 return col;1848};1849function CT_pivotTableDefinition() {1850//Attributes1851 this.name = null;1852 this.cacheId = null;1853 this.dataOnRows = null;//false1854 this.dataPosition = null;1855 this.autoFormatId = null;1856 this.applyNumberFormats = null;1857 this.applyBorderFormats = null;1858 this.applyFontFormats = null;1859 this.applyPatternFormats = null;1860 this.applyAlignmentFormats = null;1861 this.applyWidthHeightFormats = null;1862 this.dataCaption = null;1863 this.grandTotalCaption = null;1864 this.errorCaption = null;1865 this.showError = null;//false1866 this.missingCaption = null;1867 this.showMissing = null;//true1868 this.pageStyle = null;1869 this.pivotTableStyle = null;1870 this.vacatedStyle = null;1871 this.tag = null;1872 this.updatedVersion = null;//01873 this.minRefreshableVersion = null;//01874 this.asteriskTotals = null;//false1875 this.showItems = null;//true1876 this.editData = null;//false1877 this.disableFieldList = null;//false1878 this.showCalcMbrs = null;//true1879 this.visualTotals = null;//true1880 this.showMultipleLabel = null;//true1881 this.showDataDropDown = null;//true1882 this.showDrill = null;//true1883 this.printDrill = null;//false1884 this.showMemberPropertyTips = null;//true1885 this.showDataTips = null;//true1886 this.enableWizard = null;//true1887 this.enableDrill = null;//true1888 this.enableFieldProperties = null;//true1889 this.preserveFormatting = null;//true1890 this.useAutoFormatting = null;//false1891 this.pageWrap = null;//01892 this.pageOverThenDown = null;//false1893 this.subtotalHiddenItems = null;//false1894 this.rowGrandTotals = null;//true1895 this.colGrandTotals = null;//true1896 this.fieldPrintTitles = null;//false1897 this.itemPrintTitles = null;//false1898 this.mergeItem = null;//false1899 this.showDropZones = null;//true1900 this.createdVersion = null;//01901 this.indent = null;//11902 this.showEmptyRow = null;//false1903 this.showEmptyCol = null;//false1904 this.showHeaders = null;//true1905 this.compact = null;//true1906 this.outline = null;//false1907 this.outlineData = null;//false1908 this.compactData = null;//true1909 this.published = null;//false1910 this.gridDropZones = null;//false1911 this.immersive = null;//true1912 this.multipleFieldFilters = null;//true1913 this.chartFormat = null;//01914 this.rowHeaderCaption = null;1915 this.colHeaderCaption = null;1916 this.fieldListSortAscending = null;//false1917 this.mdxSubqueries = null;//false1918 this.customListSort = null;//true1919//Members1920 this.location = null;1921 this.pivotFields = null;1922 this.rowFields = null;1923 this.rowItems = null;1924 this.colFields = null;1925 this.colItems = null;1926 this.pageFields = null;1927 this.dataFields = null;1928 this.formats = null;1929 this.conditionalFormats = null;1930 this.chartFormats = null;1931 this.pivotHierarchies = null;1932 this.pivotTableStyleInfo = null;1933 this.filters = null;1934 this.rowHierarchiesUsage = null;1935 this.colHierarchiesUsage = null;1936 //ext1937 this.pivotTableDefinitionX14 = null;1938 //editor1939 this.cacheDefinition = null;1940 this.isInit = false;1941 this.pageFieldsPositions = null;1942 this.clearGrid = false;1943 this.hasCompact = true;1944}1945CT_pivotTableDefinition.prototype.readAttributes = function(attr, uq) {1946 if (attr()) {1947 var vals = attr();1948 var val;1949 val = vals["name"];1950 if (undefined !== val) {1951 this.name = uq(val);1952 }1953 val = vals["cacheId"];1954 if (undefined !== val) {1955 this.cacheId = val - 0;1956 }1957 val = vals["dataOnRows"];1958 if (undefined !== val) {1959 this.dataOnRows = getBoolFromXml(val);1960 }1961 val = vals["dataPosition"];1962 if (undefined !== val) {1963 this.dataPosition = val - 0;1964 }1965 val = vals["autoFormatId"];1966 if (undefined !== val) {1967 this.autoFormatId = val - 0;1968 }1969 val = vals["applyNumberFormats"];1970 if (undefined !== val) {1971 this.applyNumberFormats = getBoolFromXml(val);1972 }1973 val = vals["applyBorderFormats"];1974 if (undefined !== val) {1975 this.applyBorderFormats = getBoolFromXml(val);1976 }1977 val = vals["applyFontFormats"];1978 if (undefined !== val) {1979 this.applyFontFormats = getBoolFromXml(val);1980 }1981 val = vals["applyPatternFormats"];1982 if (undefined !== val) {1983 this.applyPatternFormats = getBoolFromXml(val);1984 }1985 val = vals["applyAlignmentFormats"];1986 if (undefined !== val) {1987 this.applyAlignmentFormats = getBoolFromXml(val);1988 }1989 val = vals["applyWidthHeightFormats"];1990 if (undefined !== val) {1991 this.applyWidthHeightFormats = getBoolFromXml(val);1992 }1993 val = vals["dataCaption"];1994 if (undefined !== val) {1995 this.dataCaption = uq(val);1996 }1997 val = vals["grandTotalCaption"];1998 if (undefined !== val) {1999 this.grandTotalCaption = uq(val);2000 }2001 val = vals["errorCaption"];2002 if (undefined !== val) {2003 this.errorCaption = uq(val);2004 }2005 val = vals["showError"];2006 if (undefined !== val) {2007 this.showError = getBoolFromXml(val);2008 }2009 val = vals["missingCaption"];2010 if (undefined !== val) {2011 this.missingCaption = uq(val);2012 }2013 val = vals["showMissing"];2014 if (undefined !== val) {2015 this.showMissing = getBoolFromXml(val);2016 }2017 val = vals["pageStyle"];2018 if (undefined !== val) {2019 this.pageStyle = uq(val);2020 }2021 val = vals["pivotTableStyle"];2022 if (undefined !== val) {2023 this.pivotTableStyle = uq(val);2024 }2025 val = vals["vacatedStyle"];2026 if (undefined !== val) {2027 this.vacatedStyle = uq(val);2028 }2029 val = vals["tag"];2030 if (undefined !== val) {2031 this.tag = uq(val);2032 }2033 val = vals["updatedVersion"];2034 if (undefined !== val) {2035 this.updatedVersion = val - 0;2036 }2037 val = vals["minRefreshableVersion"];2038 if (undefined !== val) {2039 this.minRefreshableVersion = val - 0;2040 }2041 val = vals["asteriskTotals"];2042 if (undefined !== val) {2043 this.asteriskTotals = getBoolFromXml(val);2044 }2045 val = vals["showItems"];2046 if (undefined !== val) {2047 this.showItems = getBoolFromXml(val);2048 }2049 val = vals["editData"];2050 if (undefined !== val) {2051 this.editData = getBoolFromXml(val);2052 }2053 val = vals["disableFieldList"];2054 if (undefined !== val) {2055 this.disableFieldList = getBoolFromXml(val);2056 }2057 val = vals["showCalcMbrs"];2058 if (undefined !== val) {2059 this.showCalcMbrs = getBoolFromXml(val);2060 }2061 val = vals["visualTotals"];2062 if (undefined !== val) {2063 this.visualTotals = getBoolFromXml(val);2064 }2065 val = vals["showMultipleLabel"];2066 if (undefined !== val) {2067 this.showMultipleLabel = getBoolFromXml(val);2068 }2069 val = vals["showDataDropDown"];2070 if (undefined !== val) {2071 this.showDataDropDown = getBoolFromXml(val);2072 }2073 val = vals["showDrill"];2074 if (undefined !== val) {2075 this.showDrill = getBoolFromXml(val);2076 }2077 val = vals["printDrill"];2078 if (undefined !== val) {2079 this.printDrill = getBoolFromXml(val);2080 }2081 val = vals["showMemberPropertyTips"];2082 if (undefined !== val) {2083 this.showMemberPropertyTips = getBoolFromXml(val);2084 }2085 val = vals["showDataTips"];2086 if (undefined !== val) {2087 this.showDataTips = getBoolFromXml(val);2088 }2089 val = vals["enableWizard"];2090 if (undefined !== val) {2091 this.enableWizard = getBoolFromXml(val);2092 }2093 val = vals["enableDrill"];2094 if (undefined !== val) {2095 this.enableDrill = getBoolFromXml(val);2096 }2097 val = vals["enableFieldProperties"];2098 if (undefined !== val) {2099 this.enableFieldProperties = getBoolFromXml(val);2100 }2101 val = vals["preserveFormatting"];2102 if (undefined !== val) {2103 this.preserveFormatting = getBoolFromXml(val);2104 }2105 val = vals["useAutoFormatting"];2106 if (undefined !== val) {2107 this.useAutoFormatting = getBoolFromXml(val);2108 }2109 val = vals["pageWrap"];2110 if (undefined !== val) {2111 this.pageWrap = val - 0;2112 }2113 val = vals["pageOverThenDown"];2114 if (undefined !== val) {2115 this.pageOverThenDown = getBoolFromXml(val);2116 }2117 val = vals["subtotalHiddenItems"];2118 if (undefined !== val) {2119 this.subtotalHiddenItems = getBoolFromXml(val);2120 }2121 val = vals["rowGrandTotals"];2122 if (undefined !== val) {2123 this.rowGrandTotals = getBoolFromXml(val);2124 }2125 val = vals["colGrandTotals"];2126 if (undefined !== val) {2127 this.colGrandTotals = getBoolFromXml(val);2128 }2129 val = vals["fieldPrintTitles"];2130 if (undefined !== val) {2131 this.fieldPrintTitles = getBoolFromXml(val);2132 }2133 val = vals["itemPrintTitles"];2134 if (undefined !== val) {2135 this.itemPrintTitles = getBoolFromXml(val);2136 }2137 val = vals["mergeItem"];2138 if (undefined !== val) {2139 this.mergeItem = getBoolFromXml(val);2140 }2141 val = vals["showDropZones"];2142 if (undefined !== val) {2143 this.showDropZones = getBoolFromXml(val);2144 }2145 val = vals["createdVersion"];2146 if (undefined !== val) {2147 this.createdVersion = val - 0;2148 }2149 val = vals["indent"];2150 if (undefined !== val) {2151 this.indent = val - 0;2152 }2153 val = vals["showEmptyRow"];2154 if (undefined !== val) {2155 this.showEmptyRow = getBoolFromXml(val);2156 }2157 val = vals["showEmptyCol"];2158 if (undefined !== val) {2159 this.showEmptyCol = getBoolFromXml(val);2160 }2161 val = vals["showHeaders"];2162 if (undefined !== val) {2163 this.showHeaders = getBoolFromXml(val);2164 }2165 val = vals["compact"];2166 if (undefined !== val) {2167 this.compact = getBoolFromXml(val);2168 }2169 val = vals["outline"];2170 if (undefined !== val) {2171 this.outline = getBoolFromXml(val);2172 }2173 val = vals["outlineData"];2174 if (undefined !== val) {2175 this.outlineData = getBoolFromXml(val);2176 }2177 val = vals["compactData"];2178 if (undefined !== val) {2179 this.compactData = getBoolFromXml(val);2180 }2181 val = vals["published"];2182 if (undefined !== val) {2183 this.published = getBoolFromXml(val);2184 }2185 val = vals["gridDropZones"];2186 if (undefined !== val) {2187 this.gridDropZones = getBoolFromXml(val);2188 }2189 val = vals["immersive"];2190 if (undefined !== val) {2191 this.immersive = getBoolFromXml(val);2192 }2193 val = vals["multipleFieldFilters"];2194 if (undefined !== val) {2195 this.multipleFieldFilters = getBoolFromXml(val);2196 }2197 val = vals["chartFormat"];2198 if (undefined !== val) {2199 this.chartFormat = val - 0;2200 }2201 val = vals["rowHeaderCaption"];2202 if (undefined !== val) {2203 this.rowHeaderCaption = uq(val);2204 }2205 val = vals["colHeaderCaption"];2206 if (undefined !== val) {2207 this.colHeaderCaption = uq(val);2208 }2209 val = vals["fieldListSortAscending"];2210 if (undefined !== val) {2211 this.fieldListSortAscending = getBoolFromXml(val);2212 }2213 val = vals["mdxSubqueries"];2214 if (undefined !== val) {2215 this.mdxSubqueries = getBoolFromXml(val);2216 }2217 val = vals["customListSort"];2218 if (undefined !== val) {2219 this.customListSort = getBoolFromXml(val);2220 }2221 }2222};2223CT_pivotTableDefinition.prototype.onStartNode = function(elem, attr, uq) {2224 var newContext = this;2225 if ("pivotTableDefinition" === elem) {2226 if (newContext.readAttributes) {2227 newContext.readAttributes(attr, uq);2228 }2229 } else if ("location" === elem) {2230 newContext = new CT_Location();2231 if (newContext.readAttributes) {2232 newContext.readAttributes(attr, uq);2233 }2234 this.location = newContext;2235 } else if ("pivotFields" === elem) {2236 newContext = new CT_PivotFields();2237 if (newContext.readAttributes) {2238 newContext.readAttributes(attr, uq);2239 }2240 this.pivotFields = newContext;2241 } else if ("rowFields" === elem) {2242 newContext = new CT_RowFields();2243 if (newContext.readAttributes) {2244 newContext.readAttributes(attr, uq);2245 }2246 this.rowFields = newContext;2247 } else if ("rowItems" === elem) {2248 newContext = new CT_rowItems();2249 if (newContext.readAttributes) {2250 newContext.readAttributes(attr, uq);2251 }2252 this.rowItems = newContext;2253 } else if ("colFields" === elem) {2254 newContext = new CT_ColFields();2255 if (newContext.readAttributes) {2256 newContext.readAttributes(attr, uq);2257 }2258 this.colFields = newContext;2259 } else if ("colItems" === elem) {2260 newContext = new CT_colItems();2261 if (newContext.readAttributes) {2262 newContext.readAttributes(attr, uq);2263 }2264 this.colItems = newContext;2265 } else if ("pageFields" === elem) {2266 newContext = new CT_PageFields();2267 if (newContext.readAttributes) {2268 newContext.readAttributes(attr, uq);2269 }2270 this.pageFields = newContext;2271 } else if ("dataFields" === elem) {2272 newContext = new CT_DataFields();2273 if (newContext.readAttributes) {2274 newContext.readAttributes(attr, uq);2275 }2276 this.dataFields = newContext;2277 } else if ("formats" === elem) {2278 newContext = new CT_Formats();2279 if (newContext.readAttributes) {2280 newContext.readAttributes(attr, uq);2281 }2282 this.formats = newContext;2283 } else if ("conditionalFormats" === elem) {2284 newContext = new CT_ConditionalFormats();2285 if (newContext.readAttributes) {2286 newContext.readAttributes(attr, uq);2287 }2288 this.conditionalFormats = newContext;2289 } else if ("chartFormats" === elem) {2290 newContext = new CT_ChartFormats();2291 if (newContext.readAttributes) {2292 newContext.readAttributes(attr, uq);2293 }2294 this.chartFormats = newContext;2295 } else if ("pivotHierarchies" === elem) {2296 newContext = new CT_PivotHierarchies();2297 if (newContext.readAttributes) {2298 newContext.readAttributes(attr, uq);2299 }2300 this.pivotHierarchies = newContext;2301 } else if ("pivotTableStyleInfo" === elem) {2302 newContext = new CT_PivotTableStyle();2303 if (newContext.readAttributes) {2304 newContext.readAttributes(attr, uq);2305 }2306 this.pivotTableStyleInfo = newContext;2307 } else if ("filters" === elem) {2308 newContext = new CT_PivotFilters();2309 if (newContext.readAttributes) {2310 newContext.readAttributes(attr, uq);2311 }2312 this.filters = newContext;2313 } else if ("rowHierarchiesUsage" === elem) {2314 newContext = new CT_RowHierarchiesUsage();2315 if (newContext.readAttributes) {2316 newContext.readAttributes(attr, uq);2317 }2318 this.rowHierarchiesUsage = newContext;2319 } else if ("colHierarchiesUsage" === elem) {2320 newContext = new CT_ColHierarchiesUsage();2321 if (newContext.readAttributes) {2322 newContext.readAttributes(attr, uq);2323 }2324 this.colHierarchiesUsage = newContext;2325 } else if ("extLst" === elem) {2326 newContext = new CT_ExtensionList();2327 if (newContext.readAttributes) {2328 newContext.readAttributes(attr, uq);2329 }2330 } else {2331 newContext = null;2332 }2333 return newContext;2334};2335CT_pivotTableDefinition.prototype.onEndNode = function(prevContext, elem) {2336 if ("extLst" === elem) {2337 for (var i = 0; i < prevContext.ext.length; ++i) {2338 var ext = prevContext.ext[i];2339 if ('{962EF5D1-5CA2-4c93-8EF4-DBF5C05439D2}' == ext.uri) {2340 this.pivotTableDefinitionX14 = ext.elem;2341 }2342 }2343 }2344};2345CT_pivotTableDefinition.prototype.toXml = function(writer) {2346 writer.WriteXmlString("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");2347 writer.WriteXmlNodeStart("pivotTableDefinition");2348 writer.WriteXmlString(2349 " xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"");2350 if (null !== this.name) {2351 writer.WriteXmlAttributeStringEncode("name", this.name);2352 }2353 if (null !== this.cacheId) {2354 writer.WriteXmlAttributeNumber("cacheId", this.cacheId);2355 }2356 if (null !== this.dataOnRows) {2357 writer.WriteXmlAttributeBool("dataOnRows", this.dataOnRows);2358 }2359 if (null !== this.dataPosition) {2360 writer.WriteXmlAttributeNumber("dataPosition", this.dataPosition);2361 }2362 if (null !== this.autoFormatId) {2363 writer.WriteXmlAttributeNumber("autoFormatId", this.autoFormatId);2364 }2365 if (null !== this.applyNumberFormats) {2366 writer.WriteXmlAttributeBool("applyNumberFormats", this.applyNumberFormats);2367 }2368 if (null !== this.applyBorderFormats) {2369 writer.WriteXmlAttributeBool("applyBorderFormats", this.applyBorderFormats);2370 }2371 if (null !== this.applyFontFormats) {2372 writer.WriteXmlAttributeBool("applyFontFormats", this.applyFontFormats);2373 }2374 if (null !== this.applyPatternFormats) {2375 writer.WriteXmlAttributeBool("applyPatternFormats", this.applyPatternFormats);2376 }2377 if (null !== this.applyAlignmentFormats) {2378 writer.WriteXmlAttributeBool("applyAlignmentFormats", this.applyAlignmentFormats);2379 }2380 if (null !== this.applyWidthHeightFormats) {2381 writer.WriteXmlAttributeBool("applyWidthHeightFormats", this.applyWidthHeightFormats);2382 }2383 if (null !== this.dataCaption) {2384 writer.WriteXmlAttributeStringEncode("dataCaption", this.dataCaption);2385 }2386 if (null !== this.grandTotalCaption) {2387 writer.WriteXmlAttributeStringEncode("grandTotalCaption", this.grandTotalCaption);2388 }2389 if (null !== this.errorCaption) {2390 writer.WriteXmlAttributeStringEncode("errorCaption", this.errorCaption);2391 }2392 if (null !== this.showError) {2393 writer.WriteXmlAttributeBool("showError", this.showError);2394 }2395 if (null !== this.missingCaption) {2396 writer.WriteXmlAttributeStringEncode("missingCaption", this.missingCaption);2397 }2398 if (null !== this.showMissing) {2399 writer.WriteXmlAttributeBool("showMissing", this.showMissing);2400 }2401 if (null !== this.pageStyle) {2402 writer.WriteXmlAttributeStringEncode("pageStyle", this.pageStyle);2403 }2404 if (null !== this.pivotTableStyle) {2405 writer.WriteXmlAttributeStringEncode("pivotTableStyle", this.pivotTableStyle);2406 }2407 if (null !== this.vacatedStyle) {2408 writer.WriteXmlAttributeStringEncode("vacatedStyle", this.vacatedStyle);2409 }2410 if (null !== this.tag) {2411 writer.WriteXmlAttributeStringEncode("tag", this.tag);2412 }2413 if (null !== this.updatedVersion) {2414 writer.WriteXmlAttributeNumber("updatedVersion", this.updatedVersion);2415 }2416 if (null !== this.minRefreshableVersion) {2417 writer.WriteXmlAttributeNumber("minRefreshableVersion", this.minRefreshableVersion);2418 }2419 if (null !== this.asteriskTotals) {2420 writer.WriteXmlAttributeBool("asteriskTotals", this.asteriskTotals);2421 }2422 if (null !== this.showItems) {2423 writer.WriteXmlAttributeBool("showItems", this.showItems);2424 }2425 if (null !== this.editData) {2426 writer.WriteXmlAttributeBool("editData", this.editData);2427 }2428 if (null !== this.disableFieldList) {2429 writer.WriteXmlAttributeBool("disableFieldList", this.disableFieldList);2430 }2431 if (null !== this.showCalcMbrs) {2432 writer.WriteXmlAttributeBool("showCalcMbrs", this.showCalcMbrs);2433 }2434 if (null !== this.visualTotals) {2435 writer.WriteXmlAttributeBool("visualTotals", this.visualTotals);2436 }2437 if (null !== this.showMultipleLabel) {2438 writer.WriteXmlAttributeBool("showMultipleLabel", this.showMultipleLabel);2439 }2440 if (null !== this.showDataDropDown) {2441 writer.WriteXmlAttributeBool("showDataDropDown", this.showDataDropDown);2442 }2443 if (null !== this.showDrill) {2444 writer.WriteXmlAttributeBool("showDrill", this.showDrill);2445 }2446 if (null !== this.printDrill) {2447 writer.WriteXmlAttributeBool("printDrill", this.printDrill);2448 }2449 if (null !== this.showMemberPropertyTips) {2450 writer.WriteXmlAttributeBool("showMemberPropertyTips", this.showMemberPropertyTips);2451 }2452 if (null !== this.showDataTips) {2453 writer.WriteXmlAttributeBool("showDataTips", this.showDataTips);2454 }2455 if (null !== this.enableWizard) {2456 writer.WriteXmlAttributeBool("enableWizard", this.enableWizard);2457 }2458 if (null !== this.enableDrill) {2459 writer.WriteXmlAttributeBool("enableDrill", this.enableDrill);2460 }2461 if (null !== this.enableFieldProperties) {2462 writer.WriteXmlAttributeBool("enableFieldProperties", this.enableFieldProperties);2463 }2464 if (null !== this.preserveFormatting) {2465 writer.WriteXmlAttributeBool("preserveFormatting", this.preserveFormatting);2466 }2467 if (null !== this.useAutoFormatting) {2468 writer.WriteXmlAttributeBool("useAutoFormatting", this.useAutoFormatting);2469 }2470 if (null !== this.pageWrap) {2471 writer.WriteXmlAttributeNumber("pageWrap", this.pageWrap);2472 }2473 if (null !== this.pageOverThenDown) {2474 writer.WriteXmlAttributeBool("pageOverThenDown", this.pageOverThenDown);2475 }2476 if (null !== this.subtotalHiddenItems) {2477 writer.WriteXmlAttributeBool("subtotalHiddenItems", this.subtotalHiddenItems);2478 }2479 if (null !== this.rowGrandTotals) {2480 writer.WriteXmlAttributeBool("rowGrandTotals", this.rowGrandTotals);2481 }2482 if (null !== this.colGrandTotals) {2483 writer.WriteXmlAttributeBool("colGrandTotals", this.colGrandTotals);2484 }2485 if (null !== this.fieldPrintTitles) {2486 writer.WriteXmlAttributeBool("fieldPrintTitles", this.fieldPrintTitles);2487 }2488 if (null !== this.itemPrintTitles) {2489 writer.WriteXmlAttributeBool("itemPrintTitles", this.itemPrintTitles);2490 }2491 if (null !== this.mergeItem) {2492 writer.WriteXmlAttributeBool("mergeItem", this.mergeItem);2493 }2494 if (null !== this.showDropZones) {2495 writer.WriteXmlAttributeBool("showDropZones", this.showDropZones);2496 }2497 if (null !== this.createdVersion) {2498 writer.WriteXmlAttributeNumber("createdVersion", this.createdVersion);2499 }2500 if (null !== this.indent) {2501 writer.WriteXmlAttributeNumber("indent", this.indent);2502 }2503 if (null !== this.showEmptyRow) {2504 writer.WriteXmlAttributeBool("showEmptyRow", this.showEmptyRow);2505 }2506 if (null !== this.showEmptyCol) {2507 writer.WriteXmlAttributeBool("showEmptyCol", this.showEmptyCol);2508 }2509 if (null !== this.showHeaders) {2510 writer.WriteXmlAttributeBool("showHeaders", this.showHeaders);2511 }2512 if (null !== this.compact) {2513 writer.WriteXmlAttributeBool("compact", this.compact);2514 }2515 if (null !== this.outline) {2516 writer.WriteXmlAttributeBool("outline", this.outline);2517 }2518 if (null !== this.outlineData) {2519 writer.WriteXmlAttributeBool("outlineData", this.outlineData);2520 }2521 if (null !== this.compactData) {2522 writer.WriteXmlAttributeBool("compactData", this.compactData);2523 }2524 if (null !== this.published) {2525 writer.WriteXmlAttributeBool("published", this.published);2526 }2527 if (null !== this.gridDropZones) {2528 writer.WriteXmlAttributeBool("gridDropZones", this.gridDropZones);2529 }2530 if (null !== this.immersive) {2531 writer.WriteXmlAttributeBool("immersive", this.immersive);2532 }2533 if (null !== this.multipleFieldFilters) {2534 writer.WriteXmlAttributeBool("multipleFieldFilters", this.multipleFieldFilters);2535 }2536 if (null !== this.chartFormat) {2537 writer.WriteXmlAttributeNumber("chartFormat", this.chartFormat);2538 }2539 if (null !== this.rowHeaderCaption) {2540 writer.WriteXmlAttributeStringEncode("rowHeaderCaption", this.rowHeaderCaption);2541 }2542 if (null !== this.colHeaderCaption) {2543 writer.WriteXmlAttributeStringEncode("colHeaderCaption", this.colHeaderCaption);2544 }2545 if (null !== this.fieldListSortAscending) {2546 writer.WriteXmlAttributeBool("fieldListSortAscending", this.fieldListSortAscending);2547 }2548 if (null !== this.mdxSubqueries) {2549 writer.WriteXmlAttributeBool("mdxSubqueries", this.mdxSubqueries);2550 }2551 if (null !== this.customListSort) {2552 writer.WriteXmlAttributeBool("customListSort", this.customListSort);2553 }2554 writer.WriteXmlNodeEnd("pivotTableDefinition", true);2555 if (null !== this.location) {2556 this.location.toXml(writer, "location");2557 }2558 if (null !== this.pivotFields) {2559 this.pivotFields.toXml(writer, "pivotFields");2560 }2561 if (null !== this.rowFields) {2562 this.rowFields.toXml(writer, "rowFields");2563 }2564 if (null !== this.rowItems) {2565 this.rowItems.toXml(writer, "rowItems");2566 }2567 if (null !== this.colFields) {2568 this.colFields.toXml(writer, "colFields");2569 }2570 if (null !== this.colItems) {2571 this.colItems.toXml(writer, "colItems");2572 }2573 if (null !== this.pageFields) {2574 this.pageFields.toXml(writer, "pageFields");2575 }2576 if (null !== this.dataFields) {2577 this.dataFields.toXml(writer, "dataFields");2578 }2579 if (null !== this.formats) {2580 this.formats.toXml(writer, "formats");2581 }2582 if (null !== this.conditionalFormats) {2583 this.conditionalFormats.toXml(writer, "conditionalFormats");2584 }2585 if (null !== this.chartFormats) {2586 this.chartFormats.toXml(writer, "chartFormats");2587 }2588 if (null !== this.pivotHierarchies) {2589 this.pivotHierarchies.toXml(writer, "pivotHierarchies");2590 }2591 if (null !== this.pivotTableStyleInfo) {2592 this.pivotTableStyleInfo.toXml(writer, "pivotTableStyleInfo");2593 }2594 if (null !== this.filters) {2595 this.filters.toXml(writer, "filters");2596 }2597 if (null !== this.rowHierarchiesUsage) {2598 this.rowHierarchiesUsage.toXml(writer, "rowHierarchiesUsage");2599 }2600 if (null !== this.colHierarchiesUsage) {2601 this.colHierarchiesUsage.toXml(writer, "colHierarchiesUsage");2602 }2603 if (null !== this.pivotTableDefinitionX14) {2604 var ext = new CT_Extension();2605 ext.uri = "{962EF5D1-5CA2-4c93-8EF4-DBF5C05439D2}";2606 ext.elem = this.pivotTableDefinitionX14;2607 var extList = new CT_ExtensionList();2608 extList.ext.push(ext);2609 extList.toXml(writer, "extLst");2610 }2611 writer.WriteXmlNodeEnd("pivotTableDefinition");2612};2613CT_pivotTableDefinition.prototype.init = function () {2614 this.isInit = true;2615 this.pageFieldsPositions = [];2616 var rowPageCount = null, colPageCount = null;2617 if (this.pageFields) {2618 var wrap, pageOverThenDown;2619 var l = this.pageFields.pageField.length;2620 var dr;2621 if (0 < l) {2622 if (this.pageWrap) {2623 dr = this.pageOverThenDown ? Math.ceil(l / this.pageWrap) : Math.min(this.pageWrap, l);2624 } else {2625 dr = this.pageOverThenDown ? 1 : l;2626 }2627 var range = this.getRange();2628 var _c = range.c1;2629 var _r = range.r1 - 1 - dr;2630 var c = _c, r = _r;2631 var minC = _c, minR = _r, maxC = _c, maxR = _r;2632 for (var i = 0; i < l; ++i) {2633 this.pageFieldsPositions.push(new AscCommon.CellBase(r, c));2634 maxR = Math.max(maxR, r);2635 maxC = Math.max(maxC, c);2636 wrap = (this.pageWrap && 0 === (i + 1) % this.pageWrap);2637 pageOverThenDown = this.pageOverThenDown;2638 if (wrap) {2639 _r += pageOverThenDown;2640 _c += !pageOverThenDown;2641 pageOverThenDown = !pageOverThenDown;2642 }2643 if (pageOverThenDown) {2644 r = _r;2645 c += 3;2646 } else {2647 ++r;2648 c = _c;2649 }2650 }2651 rowPageCount = maxR - minR + 1;2652 colPageCount = (maxC - minC) / 3 + 1;2653 }2654 }2655 this.location.setPageCount(rowPageCount, colPageCount);2656 this.updatePivotType();2657};2658CT_pivotTableDefinition.prototype.updatePivotType = function () {2659 this.clearGrid = false;2660 this.hasCompact = false;2661 var field;2662 var pivotFields = this.asc_getPivotFields();2663 var rowFields = this.asc_getRowFields();2664 if (rowFields) {2665 for (var i = 0; i < rowFields.length; ++i) {2666 field = pivotFields[rowFields[i].asc_getIndex()];2667 if (false !== field.outline) {2668 this.clearGrid = true;2669 }2670 if (false !== field.compact) {2671 this.hasCompact = true;2672 }2673 }2674 }2675};2676CT_pivotTableDefinition.prototype.intersection = function (range) {2677 return (this.location && this.location.intersection(range)) || this.pageFieldsIntersection(range);2678};2679CT_pivotTableDefinition.prototype.isIntersectForShift = function (range, offset) {2680 var ref = this.location && (this.location.refWithPage || this.location.ref);2681 return (ref && range.isIntersectForShift(ref, offset));2682};2683CT_pivotTableDefinition.prototype.pageFieldsIntersection = function (range) {2684 return this.pageFieldsPositions && this.pageFieldsPositions.some(function (element) {2685 return Array.isArray(range) ? range.some(function (elementRange) {2686 return (elementRange.contains(element.col, element.row) ||2687 elementRange.contains(element.col + 1, element.row));2688 }) : (range.contains(element.col, element.row) || range.contains(element.col + 1, element.row));2689 });2690};2691CT_pivotTableDefinition.prototype.contains = function (col, row) {2692 return (this.location && this.location.contains(col, row)) ||2693 this.pageFieldsIntersection(new Asc.Range(col, row, col, row));2694};2695CT_pivotTableDefinition.prototype.getRange = function () {2696 return this.location && this.location.ref;2697};2698CT_pivotTableDefinition.prototype.getFirstHeaderRow0 = function () {2699 return this.location && (this.location.firstHeaderRow + this.getColumnFieldsCount() - 1);2700};2701CT_pivotTableDefinition.prototype.getFirstDataCol = function () {2702 return this.location && this.location.firstDataCol;2703};2704CT_pivotTableDefinition.prototype.getColumnFieldsCount = function (withoutValues) {2705 var res = 0;2706 if (this.colFields) {2707 res = this.colFields.field.length;2708 if (1 === res && withoutValues && st_VALUES === this.colFields.field[0].x) {2709 res = 0;2710 }2711 }2712 return res;2713};2714CT_pivotTableDefinition.prototype.getRowFieldsCount = function (compact) {2715 var t = this, res = 0, l;2716 if (this.rowFields) {2717 l = res = this.rowFields.field.length;2718 if (compact) {2719 this.getField(this.rowFields.field, function (element, i) {2720 if (i !== l - 1) {2721 var field = t.pivotFields.pivotField[element.asc_getIndex()];2722 res -= (field && false !== field.outline && false !== field.compact) ? 1 : 0;2723 }2724 });2725 }2726 }2727 return res;2728};2729CT_pivotTableDefinition.prototype.getRowFieldPos = function (index) {2730 var res = 0;2731 if (this.rowFields) {2732 var field, fields = this.rowFields.field;2733 for (var i = 0; i < index && i < fields.length; ++i) {2734 field = this.pivotFields.pivotField[fields[i].asc_getIndex()];2735 res += (field && (false === field.outline || false === field.compact) && 1);2736 }2737 }2738 return res;2739};2740CT_pivotTableDefinition.prototype.getDataFieldsCount = function () {2741 return (this.dataFields && this.dataFields.dataField.length) || 0;2742};2743CT_pivotTableDefinition.prototype.getField = function (arrFields, callback) {2744 return arrFields && arrFields.map(callback, this);2745};2746CT_pivotTableDefinition.prototype.getRowItems = function () {2747 return this.rowItems && this.rowItems.i;2748};2749CT_pivotTableDefinition.prototype.getColItems = function () {2750 return this.colItems && this.colItems.i;2751};2752CT_pivotTableDefinition.prototype.getRecords = function () {2753 return this.cacheDefinition.getRecords();2754};2755CT_pivotTableDefinition.prototype.getValues = function (records, rowIndexes, colIndex, value) {2756 var res = [];2757 var i;2758 if (rowIndexes) {2759 for (i = 0; i < rowIndexes.length; ++i) {2760 this._getValues(records, rowIndexes[i], colIndex, value, res);2761 }2762 } else {2763 for (i = 0; i < records.getRowsCount(); ++i) {2764 this._getValues(records, i, colIndex, value, res);2765 }2766 }2767 return res;2768};2769CT_pivotTableDefinition.prototype._getValues = function (records, rowIndex, colIndex, value, output) {2770 var elem = records.get(rowIndex, colIndex);2771 if (elem && elem.type === c_oAscPivotRecType.Index && value === elem.val) {2772 output.push(rowIndex);2773 }2774};2775CT_pivotTableDefinition.prototype.getValue = function (records, rowIndexes, index, subtotal) {2776 var cacheFields = this.asc_getCacheFields();2777 if (c_oAscItemType.Default === subtotal || c_oAscItemType.Data === subtotal || c_oAscItemType.Blank === subtotal) {2778 subtotal = c_oAscItemType.Sum;2779 }2780 var arg = [new AscCommonExcel.cNumber(subtotal)];2781 var i;2782 if(rowIndexes){2783 for (i = 0; i < rowIndexes.length; ++i) {2784 this._getValue(records, rowIndexes[i], index, cacheFields, arg);2785 }2786 } else {2787 for (i = 0; i < records.getRowsCount(); ++i) {2788 this._getValue(records, i, index, cacheFields, arg);2789 }2790 }2791 var res = (new AscCommonExcel.cSUBTOTAL()).Calculate(arg);2792 return res ? res.value : null;2793};2794CT_pivotTableDefinition.prototype._getValue = function (records, rowIndex, index, cacheFields, output) {2795 var elem = records.get(rowIndex, index);2796 if (elem.type === c_oAscPivotRecType.Index) {2797 elem = cacheFields[index].getSharedItem(elem.val);2798 }2799 if (elem.type === c_oAscPivotRecType.Number) {2800 output.push(new AscCommonExcel.cNumber(elem.val));2801 }2802};2803CT_pivotTableDefinition.prototype.asc_getName = function () {2804 return this.name;2805};2806CT_pivotTableDefinition.prototype.asc_getPageWrap = function () {2807 return this.pageWrap || 0;2808};2809CT_pivotTableDefinition.prototype.asc_getPageOverThenDown = function () {2810 return !!this.pageOverThenDown;2811};2812CT_pivotTableDefinition.prototype.asc_getRowGrandTotals = function () {2813 return null !== this.rowGrandTotals ? this.rowGrandTotals : true;2814};2815CT_pivotTableDefinition.prototype.asc_getColGrandTotals = function () {2816 return null !== this.colGrandTotals ? this.colGrandTotals : true;2817};2818CT_pivotTableDefinition.prototype.asc_getShowHeaders = function () {2819 return null !== this.showHeaders ? this.showHeaders : true;2820};2821CT_pivotTableDefinition.prototype.asc_getStyleInfo = function () {2822 return this.pivotTableStyleInfo;2823};2824CT_pivotTableDefinition.prototype.asc_getCacheFields = function () {2825 return this.cacheDefinition.getFields();2826};2827CT_pivotTableDefinition.prototype.asc_getPivotFields = function () {2828 return this.pivotFields && this.pivotFields.pivotField;2829};2830CT_pivotTableDefinition.prototype.asc_getPageFields = function () {2831 return this.pageFields && this.pageFields.pageField;2832};2833CT_pivotTableDefinition.prototype.asc_getColumnFields = function () {2834 return this.colFields && this.colFields.field;2835};2836CT_pivotTableDefinition.prototype.asc_getRowFields = function () {2837 return this.rowFields && this.rowFields.field;2838};2839CT_pivotTableDefinition.prototype.asc_getDataFields = function () {2840 return this.dataFields && this.dataFields.dataField;2841};2842CT_pivotTableDefinition.prototype.asc_set = function (api, newVal) {2843 var t = this;2844 api._changePivotStyle(this, function (ws) {2845 ws.clearPivotTable(t);2846 if (null !== newVal.rowGrandTotals && t.asc_getRowGrandTotals() !== newVal.rowGrandTotals) {2847 t.asc_setRowGrandTotals(newVal.rowGrandTotals ? null : false);2848 }2849 if (null !== newVal.colGrandTotals && t.asc_getColGrandTotals() !== newVal.colGrandTotals) {2850 t.asc_setColGrandTotals(newVal.colGrandTotals ? null : false);2851 }2852 ws.updatePivotTable(t);2853 });2854};2855CT_pivotTableDefinition.prototype.asc_setRowGrandTotals = function(newVal) {2856 var res;2857 this.rowGrandTotals = newVal;2858 if (this.rowFields && (res = this.changeGrandTotals(this.rowItems, newVal))) {2859 this.getRange().setOffsetLast(new AscCommonExcel.CRangeOffset(0, res));2860 }2861};2862CT_pivotTableDefinition.prototype.asc_setColGrandTotals = function(newVal) {2863 var res;2864 this.colGrandTotals = newVal;2865 if (this.colFields && (res = this.changeGrandTotals(this.colItems, newVal))) {2866 this.getRange().setOffsetLast(new AscCommonExcel.CRangeOffset(res, 0));2867 }2868};2869CT_pivotTableDefinition.prototype.asc_addPageField = function (api, index) {2870 var t = this;2871 api._changePivotStyle(this, function (ws) {2872 ws.clearPivotTable(t);2873 t.addPageField(index);2874 ws.updatePivotTable(t);2875 });2876};2877CT_pivotTableDefinition.prototype.asc_removeField = function (api, index) {2878 var t = this;2879 api._changePivotStyle(this, function (ws) {2880 ws.clearPivotTable(t);2881 t.removeField(index);2882 ws.updatePivotTable(t);2883 });2884};2885CT_pivotTableDefinition.prototype.addPageField = function (index) {2886 var pivotField = this.asc_getPivotFields()[index];2887 if (pivotField) {2888 if (c_oAscAxis.AxisPage !== pivotField.axis) {2889 this.removeField(index);2890 } else {2891 // ToDo move to end ?2892 }2893 if (!this.pageFields) {2894 this.pageFields = new CT_PageFields();2895 }2896 var newField = new CT_PageField();2897 newField.fld = index;2898 newField.hier = -1;2899 this.pageFields.add(newField);2900 pivotField.axis = c_oAscAxis.AxisPage;2901 }2902};2903CT_pivotTableDefinition.prototype.removeField = function (index) {2904 var pivotField = this.asc_getPivotFields()[index];2905 switch(pivotField.axis) {2906 case c_oAscAxis.AxisRow:2907 break;2908 case c_oAscAxis.AxisCol:2909 break;2910 case c_oAscAxis.AxisPage:2911 if (1 === this.pageFields.count) {2912 this.pageFields = null;2913 } else {2914 this.pageFields.remove(index);2915 }2916 break;2917 case c_oAscAxis.AxisValues:2918 break;2919 }2920 pivotField.axis = null;2921};2922CT_pivotTableDefinition.prototype.changeGrandTotals = function (items, newVal) {2923 var res = 0, last, i;2924 var l = items && items.i.length;2925 if (items && 0 < l) {2926 i = items.i;2927 last = i[l - 1];2928 if (null === newVal) {2929 // Add2930 if (AscCommonExcel.c_oAscItemType.Grand !== last.t) {2931 last = new CT_I();2932 last.t = AscCommonExcel.c_oAscItemType.Grand;2933 last.x.push(new CT_X());2934 i.push(last);2935 res = 1;2936 }2937 } else {2938 // Remove2939 if (AscCommonExcel.c_oAscItemType.Grand === last.t) {2940 i.pop();2941 res = -1;2942 }2943 }2944 items.count = i.length;2945 }2946 return res;2947};2948function CT_pivotTableDefinitionX14() {2949//Attributes2950 this.fillDownLabelsDefault = null;//false2951 this.visualTotalsForSets = null;//false2952 this.calculatedMembersInFilters = null;//false2953 this.altText = null;2954 this.altTextSummary = null;2955 this.enableEdit = null;//false2956 this.autoApply = null;//false2957 this.allocationMethod = null;//equalAllocation2958 this.weightExpression = null;2959 this.hideValuesRow = null;//false2960//Members2961 //this.pivotEdits = null;2962 //this.pivotChanges = null;2963 //this.conditionalFormats = null;2964}2965CT_pivotTableDefinitionX14.prototype.readAttributes = function(attr, uq) {2966 if (attr()) {2967 var vals = attr();2968 var val;2969 val = vals["fillDownLabelsDefault"];2970 if (undefined !== val) {2971 this.fillDownLabelsDefault = getBoolFromXml(val);2972 }2973 val = vals["visualTotalsForSets"];2974 if (undefined !== val) {2975 this.visualTotalsForSets = getBoolFromXml(val);2976 }2977 val = vals["calculatedMembersInFilters"];2978 if (undefined !== val) {2979 this.calculatedMembersInFilters = getBoolFromXml(val);2980 }2981 val = vals["altText"];2982 if (undefined !== val) {2983 this.altText = uq(val);2984 }2985 val = vals["altTextSummary"];2986 if (undefined !== val) {2987 this.altTextSummary = uq(val);2988 }2989 val = vals["enableEdit"];2990 if (undefined !== val) {2991 this.enableEdit = getBoolFromXml(val);2992 }2993 val = vals["autoApply"];2994 if (undefined !== val) {2995 this.autoApply = getBoolFromXml(val);2996 }2997 val = vals["allocationMethod"];2998 if (undefined !== val) {2999 val = FromXml_ST_AllocationMethod(val);3000 if (-1 !== val) {3001 this.allocationMethod = val;3002 }3003 }3004 val = vals["weightExpression"];3005 if (undefined !== val) {3006 this.weightExpression = uq(val);3007 }3008 val = vals["hideValuesRow"];3009 if (undefined !== val) {3010 this.hideValuesRow = getBoolFromXml(val);3011 }3012 }3013};3014CT_pivotTableDefinitionX14.prototype.onStartNode = function(elem, attr, uq) {3015 var newContext = this;3016 if ("pivotTableDefinition" === elem) {3017 if (newContext.readAttributes) {3018 newContext.readAttributes(attr, uq);3019 }3020 } else {3021 newContext = null;3022 }3023 return newContext;3024};3025CT_pivotTableDefinitionX14.prototype.toXml = function(writer) {3026 writer.WriteXmlNodeStart("x14:pivotTableDefinition");3027 writer.WriteXmlString(" xmlns:xm=\"http://schemas.microsoft.com/office/excel/2006/main\"");3028 if (null !== this.fillDownLabelsDefault) {3029 writer.WriteXmlAttributeBool("fillDownLabelsDefault", this.fillDownLabelsDefault);3030 }3031 if (null !== this.visualTotalsForSets) {3032 writer.WriteXmlAttributeBool("visualTotalsForSets", this.visualTotalsForSets);3033 }3034 if (null !== this.calculatedMembersInFilters) {3035 writer.WriteXmlAttributeBool("calculatedMembersInFilters", this.calculatedMembersInFilters);3036 }3037 if (null !== this.altText) {3038 writer.WriteXmlAttributeStringEncode("altText", this.altText);3039 }3040 if (null !== this.altTextSummary) {3041 writer.WriteXmlAttributeStringEncode("altTextSummary", this.altTextSummary);3042 }3043 if (null !== this.enableEdit) {3044 writer.WriteXmlAttributeBool("enableEdit", this.enableEdit);3045 }3046 if (null !== this.autoApply) {3047 writer.WriteXmlAttributeBool("autoApply", this.autoApply);3048 }3049 if (null !== this.allocationMethod) {3050 writer.WriteXmlAttributeStringEncode("allocationMethod", ToXml_ST_AllocationMethod(this.allocationMethod));3051 }3052 if (null !== this.weightExpression) {3053 writer.WriteXmlAttributeStringEncode("weightExpression", this.weightExpression);3054 }3055 if (null !== this.hideValuesRow) {3056 writer.WriteXmlAttributeBool("hideValuesRow", this.hideValuesRow);3057 }3058 writer.WriteXmlNodeEnd("pivotTableDefinition", true, true);3059};3060function CT_CacheSource() {3061//Attributes3062 this.type = null;3063 this.connectionId = null;//03064//Members3065 this.consolidation = null;3066 this.extLst = null;3067 this.worksheetSource = null;3068}3069CT_CacheSource.prototype.readAttributes = function(attr, uq) {3070 if (attr()) {3071 var vals = attr();3072 var val;3073 val = vals["type"];3074 if (undefined !== val) {3075 val = FromXml_ST_SourceType(val);3076 if (-1 !== val) {3077 this.type = val;3078 }3079 }3080 val = vals["connectionId"];3081 if (undefined !== val) {3082 this.connectionId = val - 0;3083 }3084 }3085};3086CT_CacheSource.prototype.onStartNode = function(elem, attr, uq) {3087 var newContext = this;3088 if ("consolidation" === elem) {3089 newContext = new CT_Consolidation();3090 if (newContext.readAttributes) {3091 newContext.readAttributes(attr, uq);3092 }3093 this.consolidation = newContext;3094 } else if ("extLst" === elem) {3095 newContext = new CT_ExtensionList();3096 if (newContext.readAttributes) {3097 newContext.readAttributes(attr, uq);3098 }3099 this.extLst = newContext;3100 } else if ("worksheetSource" === elem) {3101 newContext = new CT_WorksheetSource();3102 if (newContext.readAttributes) {3103 newContext.readAttributes(attr, uq);3104 }3105 this.worksheetSource = newContext;3106 } else {3107 newContext = null;3108 }3109 return newContext;3110};3111CT_CacheSource.prototype.toXml = function(writer, name) {3112 writer.WriteXmlNodeStart(name);3113 if (null !== this.type) {3114 writer.WriteXmlAttributeStringEncode("type", ToXml_ST_SourceType(this.type));3115 }3116 if (null !== this.connectionId) {3117 writer.WriteXmlAttributeNumber("connectionId", this.connectionId);3118 }3119 writer.WriteXmlNodeEnd(name, true);3120 if (null !== this.consolidation) {3121 this.consolidation.toXml(writer, "consolidation");3122 }3123 if (null !== this.extLst) {3124 this.extLst.toXml(writer, "extLst");3125 }3126 if (null !== this.worksheetSource) {3127 this.worksheetSource.toXml(writer, "worksheetSource");3128 }3129 writer.WriteXmlNodeEnd(name);3130};3131function CT_CacheFields() {3132//Attributes3133 this.count = null;3134//Members3135 this.cacheField = [];3136}3137CT_CacheFields.prototype.readAttributes = function(attr, uq) {3138 if (attr()) {3139 var vals = attr();3140 var val;3141 val = vals["count"];3142 if (undefined !== val) {3143 this.count = val - 0;3144 }3145 }3146};3147CT_CacheFields.prototype.onStartNode = function(elem, attr, uq) {3148 var newContext = this;3149 if ("cacheField" === elem) {3150 newContext = new CT_CacheField();3151 if (newContext.readAttributes) {3152 newContext.readAttributes(attr, uq);3153 }3154 this.cacheField.push(newContext);3155 } else {3156 newContext = null;3157 }3158 return newContext;3159};3160CT_CacheFields.prototype.toXml = function(writer, name) {3161 writer.WriteXmlNodeStart(name);3162 if (null !== this.count) {3163 writer.WriteXmlAttributeNumber("count", this.count);3164 }3165 writer.WriteXmlNodeEnd(name, true);3166 for (var i = 0; i < this.cacheField.length; ++i) {3167 var elem = this.cacheField[i];3168 elem.toXml(writer, "cacheField");3169 }3170 writer.WriteXmlNodeEnd(name);3171};3172function CT_CacheHierarchies() {3173//Attributes3174 this.count = null;3175//Members3176 this.cacheHierarchy = [];3177}3178CT_CacheHierarchies.prototype.readAttributes = function(attr, uq) {3179 if (attr()) {3180 var vals = attr();3181 var val;3182 val = vals["count"];3183 if (undefined !== val) {3184 this.count = val - 0;3185 }3186 }3187};3188CT_CacheHierarchies.prototype.onStartNode = function(elem, attr, uq) {3189 var newContext = this;3190 if ("cacheHierarchy" === elem) {3191 newContext = new CT_CacheHierarchy();3192 if (newContext.readAttributes) {3193 newContext.readAttributes(attr, uq);3194 }3195 this.cacheHierarchy.push(newContext);3196 } else {3197 newContext = null;3198 }3199 return newContext;3200};3201CT_CacheHierarchies.prototype.toXml = function(writer, name) {3202 writer.WriteXmlNodeStart(name);3203 if (null !== this.count) {3204 writer.WriteXmlAttributeNumber("count", this.count);3205 }3206 writer.WriteXmlNodeEnd(name, true);3207 for (var i = 0; i < this.cacheHierarchy.length; ++i) {3208 var elem = this.cacheHierarchy[i];3209 elem.toXml(writer, "cacheHierarchy");3210 }3211 writer.WriteXmlNodeEnd(name);3212};3213function CT_PCDKPIs() {3214//Attributes3215 this.count = null;3216//Members3217 this.kpi = [];3218}3219CT_PCDKPIs.prototype.readAttributes = function(attr, uq) {3220 if (attr()) {3221 var vals = attr();3222 var val;3223 val = vals["count"];3224 if (undefined !== val) {3225 this.count = val - 0;3226 }3227 }3228};3229CT_PCDKPIs.prototype.onStartNode = function(elem, attr, uq) {3230 var newContext = this;3231 if ("kpi" === elem) {3232 newContext = new CT_PCDKPI();3233 if (newContext.readAttributes) {3234 newContext.readAttributes(attr, uq);3235 }3236 this.kpi.push(newContext);3237 } else {3238 newContext = null;3239 }3240 return newContext;3241};3242CT_PCDKPIs.prototype.toXml = function(writer, name) {3243 writer.WriteXmlNodeStart(name);3244 if (null !== this.count) {3245 writer.WriteXmlAttributeNumber("count", this.count);3246 }3247 writer.WriteXmlNodeEnd(name, true);3248 for (var i = 0; i < this.kpi.length; ++i) {3249 var elem = this.kpi[i];3250 elem.toXml(writer, "kpi");3251 }3252 writer.WriteXmlNodeEnd(name);3253};3254function CT_TupleCache() {3255//Members3256 this.entries = null;3257 this.sets = null;3258 this.queryCache = null;3259 this.serverFormats = null;3260 this.extLst = null;3261}3262CT_TupleCache.prototype.onStartNode = function(elem, attr, uq) {3263 var newContext = this;3264 if ("entries" === elem) {3265 newContext = new CT_PCDSDTCEntries();3266 if (newContext.readAttributes) {3267 newContext.readAttributes(attr, uq);3268 }3269 this.entries = newContext;3270 } else if ("sets" === elem) {3271 newContext = new CT_Sets();3272 if (newContext.readAttributes) {3273 newContext.readAttributes(attr, uq);3274 }3275 this.sets = newContext;3276 } else if ("queryCache" === elem) {3277 newContext = new CT_QueryCache();3278 if (newContext.readAttributes) {3279 newContext.readAttributes(attr, uq);3280 }3281 this.queryCache = newContext;3282 } else if ("serverFormats" === elem) {3283 newContext = new CT_ServerFormats();3284 if (newContext.readAttributes) {3285 newContext.readAttributes(attr, uq);3286 }3287 this.serverFormats = newContext;3288 } else if ("extLst" === elem) {3289 newContext = new CT_ExtensionList();3290 if (newContext.readAttributes) {3291 newContext.readAttributes(attr, uq);3292 }3293 this.extLst = newContext;3294 } else {3295 newContext = null;3296 }3297 return newContext;3298};3299CT_TupleCache.prototype.toXml = function(writer, name) {3300 writer.WriteXmlNodeStart(name);3301 writer.WriteXmlNodeEnd(name, true);3302 if (null !== this.entries) {3303 this.entries.toXml(writer, "entries");3304 }3305 if (null !== this.sets) {3306 this.sets.toXml(writer, "sets");3307 }3308 if (null !== this.queryCache) {3309 this.queryCache.toXml(writer, "queryCache");3310 }3311 if (null !== this.serverFormats) {3312 this.serverFormats.toXml(writer, "serverFormats");3313 }3314 if (null !== this.extLst) {3315 this.extLst.toXml(writer, "extLst");3316 }3317 writer.WriteXmlNodeEnd(name);3318};3319function CT_CalculatedItems() {3320//Attributes3321 this.count = null;3322//Members3323 this.calculatedItem = [];3324}3325CT_CalculatedItems.prototype.readAttributes = function(attr, uq) {3326 if (attr()) {3327 var vals = attr();3328 var val;3329 val = vals["count"];3330 if (undefined !== val) {3331 this.count = val - 0;3332 }3333 }3334};3335CT_CalculatedItems.prototype.onStartNode = function(elem, attr, uq) {3336 var newContext = this;3337 if ("calculatedItem" === elem) {3338 newContext = new CT_CalculatedItem();3339 if (newContext.readAttributes) {3340 newContext.readAttributes(attr, uq);3341 }3342 this.calculatedItem.push(newContext);3343 } else {3344 newContext = null;3345 }3346 return newContext;3347};3348CT_CalculatedItems.prototype.toXml = function(writer, name) {3349 writer.WriteXmlNodeStart(name);3350 if (null !== this.count) {3351 writer.WriteXmlAttributeNumber("count", this.count);3352 }3353 writer.WriteXmlNodeEnd(name, true);3354 for (var i = 0; i < this.calculatedItem.length; ++i) {3355 var elem = this.calculatedItem[i];3356 elem.toXml(writer, "calculatedItem");3357 }3358 writer.WriteXmlNodeEnd(name);3359};3360function CT_CalculatedMembers() {3361//Attributes3362 this.count = null;3363//Members3364 this.calculatedMember = [];3365}3366CT_CalculatedMembers.prototype.readAttributes = function(attr, uq) {3367 if (attr()) {3368 var vals = attr();3369 var val;3370 val = vals["count"];3371 if (undefined !== val) {3372 this.count = val - 0;3373 }3374 }3375};3376CT_CalculatedMembers.prototype.onStartNode = function(elem, attr, uq) {3377 var newContext = this;3378 if ("calculatedMember" === elem) {3379 newContext = new CT_CalculatedMember();3380 if (newContext.readAttributes) {3381 newContext.readAttributes(attr, uq);3382 }3383 this.calculatedMember.push(newContext);3384 } else {3385 newContext = null;3386 }3387 return newContext;3388};3389CT_CalculatedMembers.prototype.toXml = function(writer, name) {3390 writer.WriteXmlNodeStart(name);3391 if (null !== this.count) {3392 writer.WriteXmlAttributeNumber("count", this.count);3393 }3394 writer.WriteXmlNodeEnd(name, true);3395 for (var i = 0; i < this.calculatedMember.length; ++i) {3396 var elem = this.calculatedMember[i];3397 elem.toXml(writer, "calculatedMember");3398 }3399 writer.WriteXmlNodeEnd(name);3400};3401function CT_Dimensions() {3402//Attributes3403 this.count = null;3404//Members3405 this.dimension = [];3406}3407CT_Dimensions.prototype.readAttributes = function(attr, uq) {3408 if (attr()) {3409 var vals = attr();3410 var val;3411 val = vals["count"];3412 if (undefined !== val) {3413 this.count = val - 0;3414 }3415 }3416};3417CT_Dimensions.prototype.onStartNode = function(elem, attr, uq) {3418 var newContext = this;3419 if ("dimension" === elem) {3420 newContext = new CT_PivotDimension();3421 if (newContext.readAttributes) {3422 newContext.readAttributes(attr, uq);3423 }3424 this.dimension.push(newContext);3425 } else {3426 newContext = null;3427 }3428 return newContext;3429};3430CT_Dimensions.prototype.toXml = function(writer, name) {3431 writer.WriteXmlNodeStart(name);3432 if (null !== this.count) {3433 writer.WriteXmlAttributeNumber("count", this.count);3434 }3435 writer.WriteXmlNodeEnd(name, true);3436 for (var i = 0; i < this.dimension.length; ++i) {3437 var elem = this.dimension[i];3438 elem.toXml(writer, "dimension");3439 }3440 writer.WriteXmlNodeEnd(name);3441};3442function CT_MeasureGroups() {3443//Attributes3444 this.count = null;3445//Members3446 this.measureGroup = [];3447}3448CT_MeasureGroups.prototype.readAttributes = function(attr, uq) {3449 if (attr()) {3450 var vals = attr();3451 var val;3452 val = vals["count"];3453 if (undefined !== val) {3454 this.count = val - 0;3455 }3456 }3457};3458CT_MeasureGroups.prototype.onStartNode = function(elem, attr, uq) {3459 var newContext = this;3460 if ("measureGroup" === elem) {3461 newContext = new CT_MeasureGroup();3462 if (newContext.readAttributes) {3463 newContext.readAttributes(attr, uq);3464 }3465 this.measureGroup.push(newContext);3466 } else {3467 newContext = null;3468 }3469 return newContext;3470};3471CT_MeasureGroups.prototype.toXml = function(writer, name) {3472 writer.WriteXmlNodeStart(name);3473 if (null !== this.count) {3474 writer.WriteXmlAttributeNumber("count", this.count);3475 }3476 writer.WriteXmlNodeEnd(name, true);3477 for (var i = 0; i < this.measureGroup.length; ++i) {3478 var elem = this.measureGroup[i];3479 elem.toXml(writer, "measureGroup");3480 }3481 writer.WriteXmlNodeEnd(name);3482};3483function CT_MeasureDimensionMaps() {3484//Attributes3485 this.count = null;3486//Members3487 this.map = [];3488}3489CT_MeasureDimensionMaps.prototype.readAttributes = function(attr, uq) {3490 if (attr()) {3491 var vals = attr();3492 var val;3493 val = vals["count"];3494 if (undefined !== val) {3495 this.count = val - 0;3496 }3497 }3498};3499CT_MeasureDimensionMaps.prototype.onStartNode = function(elem, attr, uq) {3500 var newContext = this;3501 if ("map" === elem) {3502 newContext = new CT_MeasureDimensionMap();3503 if (newContext.readAttributes) {3504 newContext.readAttributes(attr, uq);3505 }3506 this.map.push(newContext);3507 } else {3508 newContext = null;3509 }3510 return newContext;3511};3512CT_MeasureDimensionMaps.prototype.toXml = function(writer, name) {3513 writer.WriteXmlNodeStart(name);3514 if (null !== this.count) {3515 writer.WriteXmlAttributeNumber("count", this.count);3516 }3517 writer.WriteXmlNodeEnd(name, true);3518 for (var i = 0; i < this.map.length; ++i) {3519 var elem = this.map[i];3520 elem.toXml(writer, "map");3521 }3522 writer.WriteXmlNodeEnd(name);3523};3524function CT_ExtensionList() {3525//Members3526 this.ext = [];3527}3528CT_ExtensionList.prototype.onStartNode = function(elem, attr, uq) {3529 var newContext = this;3530 if ("ext" === elem) {3531 newContext = new CT_Extension();3532 if (newContext.readAttributes) {3533 newContext.readAttributes(attr, uq);3534 }3535 this.ext.push(newContext);3536 } else {3537 newContext = null;3538 }3539 return newContext;3540};3541CT_ExtensionList.prototype.toXml = function(writer, name) {3542 writer.WriteXmlNodeStart(name);3543 writer.WriteXmlNodeEnd(name, true);3544 for (var i = 0; i < this.ext.length; ++i) {3545 var elem = this.ext[i];3546 elem.toXml(writer, "ext");3547 }3548 writer.WriteXmlNodeEnd(name);3549};3550function CT_Boolean() {3551//Attributes3552 this.v = null;3553 this.u = null;3554 this.f = null;3555 this.c = null;3556 this.cp = null;3557//Members3558 this.x = [];3559}3560CT_Boolean.prototype.readAttributes = function(attr, uq) {3561 if (attr()) {3562 var vals = attr();3563 var val;3564 val = vals["v"];3565 if (undefined !== val) {3566 this.v = getBoolFromXml(val);3567 }3568 val = vals["u"];3569 if (undefined !== val) {3570 this.u = getBoolFromXml(val);3571 }3572 val = vals["f"];3573 if (undefined !== val) {3574 this.f = getBoolFromXml(val);3575 }3576 val = vals["c"];3577 if (undefined !== val) {3578 this.c = uq(val);3579 }3580 val = vals["cp"];3581 if (undefined !== val) {3582 this.cp = val - 0;3583 }3584 }3585};3586CT_Boolean.prototype.onStartNode = function(elem, attr, uq) {3587 var newContext = this;3588 if ("x" === elem) {3589 newContext = new CT_X();3590 if (newContext.readAttributes) {3591 newContext.readAttributes(attr, uq);3592 }3593 this.x.push(newContext);3594 } else {3595 newContext = null;3596 }3597 return newContext;3598};3599CT_Boolean.prototype.toXml = function(writer, name) {3600 this.toXml2(writer, name, this.v, this);3601};3602CT_Boolean.prototype.toXml2 = function(writer, name, val, obj) {3603 writer.WriteXmlNodeStart(name);3604 if (null !== val) {3605 writer.WriteXmlAttributeBool("v", val);3606 }3607 if (obj) {3608 if (null !== obj.u) {3609 writer.WriteXmlAttributeBool("u", obj.u);3610 }3611 if (null !== obj.f) {3612 writer.WriteXmlAttributeBool("f", obj.f);3613 }3614 if (null !== obj.c) {3615 writer.WriteXmlAttributeStringEncode("c", obj.c);3616 }3617 if (null !== obj.cp) {3618 writer.WriteXmlAttributeNumber("cp", obj.cp);3619 }3620 writer.WriteXmlNodeEnd(name, true);3621 for (var i = 0; i < obj.x.length; ++i) {3622 var elem = obj.x[i];3623 elem.toXml(writer, "x");3624 }3625 } else {3626 writer.WriteXmlNodeEnd(name, true);3627 }3628 writer.WriteXmlNodeEnd(name);3629};3630CT_Boolean.prototype.isSimpleValue = function() {3631 return null === this.u && null === this.f && null === this.c && null === this.cp && 0 === this.x.length;3632};3633CT_Boolean.prototype.clean = function() {3634 this.v = null;3635 this.u = null;3636 this.f = null;3637 this.c = null;3638 this.cp = null;3639 this.x = [];3640};3641function CT_DateTime() {3642//Attributes3643 this.v = null;3644 this.u = null;3645 this.f = null;3646 this.c = null;3647 this.cp = null;3648//Members3649 this.x = [];3650}3651CT_DateTime.prototype.readAttributes = function(attr, uq) {3652 if (attr()) {3653 var vals = attr();3654 var val;3655 val = vals["v"];3656 if (undefined !== val) {3657 var d = new Date(uq(val));3658 this.v = new Date(Date.UTC(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes(),3659 d.getSeconds(), d.getMilliseconds())).getExcelDateWithTime();3660 }3661 val = vals["u"];3662 if (undefined !== val) {3663 this.u = getBoolFromXml(val);3664 }3665 val = vals["f"];3666 if (undefined !== val) {3667 this.f = getBoolFromXml(val);3668 }3669 val = vals["c"];3670 if (undefined !== val) {3671 this.c = uq(val);3672 }3673 val = vals["cp"];3674 if (undefined !== val) {3675 this.cp = val - 0;3676 }3677 }3678};3679CT_DateTime.prototype.onStartNode = function(elem, attr, uq) {3680 var newContext = this;3681 if ("x" === elem) {3682 newContext = new CT_X();3683 if (newContext.readAttributes) {3684 newContext.readAttributes(attr, uq);3685 }3686 this.x.push(newContext);3687 } else {3688 newContext = null;3689 }3690 return newContext;3691};3692CT_DateTime.prototype.toXml = function(writer, name) {3693 this.toXml2(writer, name, this.v, this);3694};3695CT_DateTime.prototype.toXml2 = function(writer, name, val, obj) {3696 writer.WriteXmlNodeStart(name);3697 if (null !== val) {3698 writer.WriteXmlAttributeStringEncode("v", Date.prototype.getDateFromExcel(val).toISOString().slice(0, 19));3699 }3700 if (obj) {3701 if (null !== obj.u) {3702 writer.WriteXmlAttributeBool("u", obj.u);3703 }3704 if (null !== obj.f) {3705 writer.WriteXmlAttributeBool("f", obj.f);3706 }3707 if (null !== obj.c) {3708 writer.WriteXmlAttributeStringEncode("c", obj.c);3709 }3710 if (null !== obj.cp) {3711 writer.WriteXmlAttributeNumber("cp", obj.cp);3712 }3713 writer.WriteXmlNodeEnd(name, true);3714 for (var i = 0; i < obj.x.length; ++i) {3715 var elem = obj.x[i];3716 elem.toXml(writer, "x");3717 }3718 } else {3719 writer.WriteXmlNodeEnd(name, true);3720 }3721 writer.WriteXmlNodeEnd(name);3722};3723CT_DateTime.prototype.isSimpleValue = function() {3724 return null === this.u && null === this.f && null === this.c && null === this.cp && 0 === this.x.length;3725};3726CT_DateTime.prototype.clean = function() {3727 this.v = null;3728 this.u = null;3729 this.f = null;3730 this.c = null;3731 this.cp = null;3732 this.x = [];3733};3734function CT_Error() {3735//Attributes3736 this.v = null;3737 this.u = null;3738 this.f = null;3739 this.c = null;3740 this.cp = null;3741 this.in = null;3742 this.bc = null;3743 this.fc = null;3744 this.i = null;//false3745 this.un = null;//false3746 this.st = null;//false3747 this.b = null;//false3748//Members3749 this.tpls = [];3750 this.x = [];3751}3752CT_Error.prototype.readAttributes = function(attr, uq) {3753 if (attr()) {3754 var vals = attr();3755 var val;3756 val = vals["v"];3757 if (undefined !== val) {3758 this.v = AscCommonExcel.cError.prototype.getErrorTypeFromString(uq(val));3759 }3760 val = vals["u"];3761 if (undefined !== val) {3762 this.u = getBoolFromXml(val);3763 }3764 val = vals["f"];3765 if (undefined !== val) {3766 this.f = getBoolFromXml(val);3767 }3768 val = vals["c"];3769 if (undefined !== val) {3770 this.c = uq(val);3771 }3772 val = vals["cp"];3773 if (undefined !== val) {3774 this.cp = val - 0;3775 }3776 val = vals["in"];3777 if (undefined !== val) {3778 this.in = val - 0;3779 }3780 val = vals["bc"];3781 if (undefined !== val) {3782 this.bc = val - 0;3783 }3784 val = vals["fc"];3785 if (undefined !== val) {3786 this.fc = val - 0;3787 }3788 val = vals["i"];3789 if (undefined !== val) {3790 this.i = getBoolFromXml(val);3791 }3792 val = vals["un"];3793 if (undefined !== val) {3794 this.un = getBoolFromXml(val);3795 }3796 val = vals["st"];3797 if (undefined !== val) {3798 this.st = getBoolFromXml(val);3799 }3800 val = vals["b"];3801 if (undefined !== val) {3802 this.b = getBoolFromXml(val);3803 }3804 }3805};3806CT_Error.prototype.onStartNode = function(elem, attr, uq) {3807 var newContext = this;3808 if ("tpls" === elem) {3809 newContext = new CT_Tuples();3810 if (newContext.readAttributes) {3811 newContext.readAttributes(attr, uq);3812 }3813 this.tpls.push(newContext);3814 } else if ("x" === elem) {3815 newContext = new CT_X();3816 if (newContext.readAttributes) {3817 newContext.readAttributes(attr, uq);3818 }3819 this.x.push(newContext);3820 } else {3821 newContext = null;3822 }3823 return newContext;3824};3825CT_Error.prototype.toXml = function(writer, name) {3826 this.toXml2(writer, name, this.v, this);3827};3828CT_Error.prototype.toXml2 = function(writer, name, val, obj) {3829 writer.WriteXmlNodeStart(name);3830 if (null !== val) {3831 writer.WriteXmlAttributeStringEncode("v", AscCommonExcel.cError.prototype.getStringFromErrorType(val));3832 }3833 if (obj) {3834 if (null !== obj.u) {3835 writer.WriteXmlAttributeBool("u", obj.u);3836 }3837 if (null !== obj.f) {3838 writer.WriteXmlAttributeBool("f", obj.f);3839 }3840 if (null !== obj.c) {3841 writer.WriteXmlAttributeStringEncode("c", obj.c);3842 }3843 if (null !== obj.cp) {3844 writer.WriteXmlAttributeNumber("cp", obj.cp);3845 }3846 if (null !== obj.in) {3847 writer.WriteXmlAttributeNumber("in", obj.in);3848 }3849 if (null !== obj.bc) {3850 writer.WriteXmlAttributeNumber("bc", obj.bc);3851 }3852 if (null !== obj.fc) {3853 writer.WriteXmlAttributeNumber("fc", obj.fc);3854 }3855 if (null !== obj.i) {3856 writer.WriteXmlAttributeBool("i", obj.i);3857 }3858 if (null !== obj.un) {3859 writer.WriteXmlAttributeBool("un", obj.un);3860 }3861 if (null !== obj.st) {3862 writer.WriteXmlAttributeBool("st", obj.st);3863 }3864 if (null !== obj.b) {3865 writer.WriteXmlAttributeBool("b", obj.b);3866 }3867 writer.WriteXmlNodeEnd(name, true);3868 for (var i = 0; i < obj.tpls.length; ++i) {3869 var elem = obj.tpls[i];3870 elem.toXml(writer, "tpls");3871 }3872 for (var i = 0; i < obj.x.length; ++i) {3873 var elem = obj.x[i];3874 elem.toXml(writer, "x");3875 }3876 } else {3877 writer.WriteXmlNodeEnd(name, true);3878 }3879 writer.WriteXmlNodeEnd(name);3880};3881CT_Error.prototype.isSimpleValue = function() {3882 return null === this.u && null === this.f && null === this.c && null === this.cp && null === this.in &&3883 null === this.bc && null === this.fc && null === this.i && null === this.un && null === this.st &&3884 null === this.b && null === 0 === this.tpls.length && 0 === this.x.length;3885};3886CT_Error.prototype.clean = function() {3887 this.v = null;3888 this.u = null;3889 this.f = null;3890 this.c = null;3891 this.cp = null;3892 this.in = null;3893 this.bc = null;3894 this.fc = null;3895 this.i = null;//false3896 this.un = null;//false3897 this.st = null;//false3898 this.b = null;//false3899 this.tpls = [];3900 this.x = [];3901};3902function CT_Missing() {3903//Attributes3904 this.u = null;3905 this.f = null;3906 this.c = null;3907 this.cp = null;3908 this.in = null;3909 this.bc = null;3910 this.fc = null;3911 this.i = null;//false3912 this.un = null;//false3913 this.st = null;//false3914 this.b = null;//false3915//Members3916 this.tpls = [];3917 this.x = [];3918}3919CT_Missing.prototype.readAttributes = function(attr, uq) {3920 if (attr()) {3921 var vals = attr();3922 var val;3923 val = vals["u"];3924 if (undefined !== val) {3925 this.u = getBoolFromXml(val);3926 }3927 val = vals["f"];3928 if (undefined !== val) {3929 this.f = getBoolFromXml(val);3930 }3931 val = vals["c"];3932 if (undefined !== val) {3933 this.c = uq(val);3934 }3935 val = vals["cp"];3936 if (undefined !== val) {3937 this.cp = val - 0;3938 }3939 val = vals["in"];3940 if (undefined !== val) {3941 this.in = val - 0;3942 }3943 val = vals["bc"];3944 if (undefined !== val) {3945 this.bc = val - 0;3946 }3947 val = vals["fc"];3948 if (undefined !== val) {3949 this.fc = val - 0;3950 }3951 val = vals["i"];3952 if (undefined !== val) {3953 this.i = getBoolFromXml(val);3954 }3955 val = vals["un"];3956 if (undefined !== val) {3957 this.un = getBoolFromXml(val);3958 }3959 val = vals["st"];3960 if (undefined !== val) {3961 this.st = getBoolFromXml(val);3962 }3963 val = vals["b"];3964 if (undefined !== val) {3965 this.b = getBoolFromXml(val);3966 }3967 }3968};3969CT_Missing.prototype.onStartNode = function(elem, attr, uq) {3970 var newContext = this;3971 if ("tpls" === elem) {3972 newContext = new CT_Tuples();3973 if (newContext.readAttributes) {3974 newContext.readAttributes(attr, uq);3975 }3976 this.tpls.push(newContext);3977 } else if ("x" === elem) {3978 newContext = new CT_X();3979 if (newContext.readAttributes) {3980 newContext.readAttributes(attr, uq);3981 }3982 this.x.push(newContext);3983 } else {3984 newContext = null;3985 }3986 return newContext;3987};3988CT_Missing.prototype.toXml = function(writer, name) {3989 this.toXml2(writer, name, this);3990};3991CT_Missing.prototype.toXml2 = function(writer, name, obj) {3992 writer.WriteXmlNodeStart(name);3993 if (obj) {3994 if (null !== obj.u) {3995 writer.WriteXmlAttributeBool("u", obj.u);3996 }3997 if (null !== obj.f) {3998 writer.WriteXmlAttributeBool("f", obj.f);3999 }4000 if (null !== obj.c) {4001 writer.WriteXmlAttributeStringEncode("c", obj.c);4002 }4003 if (null !== obj.cp) {4004 writer.WriteXmlAttributeNumber("cp", obj.cp);4005 }4006 if (null !== obj.in) {4007 writer.WriteXmlAttributeNumber("in", obj.in);4008 }4009 if (null !== obj.bc) {4010 writer.WriteXmlAttributeNumber("bc", obj.bc);4011 }4012 if (null !== obj.fc) {4013 writer.WriteXmlAttributeNumber("fc", obj.fc);4014 }4015 if (null !== obj.i) {4016 writer.WriteXmlAttributeBool("i", obj.i);4017 }4018 if (null !== obj.un) {4019 writer.WriteXmlAttributeBool("un", obj.un);4020 }4021 if (null !== obj.st) {4022 writer.WriteXmlAttributeBool("st", obj.st);4023 }4024 if (null !== obj.b) {4025 writer.WriteXmlAttributeBool("b", obj.b);4026 }4027 writer.WriteXmlNodeEnd(name, true);4028 for (var i = 0; i < obj.tpls.length; ++i) {4029 var elem = obj.tpls[i];4030 elem.toXml(writer, "tpls");4031 }4032 for (var i = 0; i < obj.x.length; ++i) {4033 var elem = obj.x[i];4034 elem.toXml(writer, "x");4035 }4036 } else {4037 writer.WriteXmlNodeEnd(name, true);4038 }4039 writer.WriteXmlNodeEnd(name);4040};4041CT_Missing.prototype.isSimpleValue = function() {4042 return null === this.u && null === this.f && null === this.c && null === this.cp && null === this.in &&4043 null === this.bc && null === this.fc && null === this.i && null === this.un && null === this.st &&4044 null === this.b && 0 === this.tpls.length && 0 === this.x.length;4045};4046CT_Missing.prototype.clean = function() {4047 this.v = null;4048 this.u = null;4049 this.f = null;4050 this.c = null;4051 this.cp = null;4052 this.in = null;4053 this.bc = null;4054 this.fc = null;4055 this.i = null;//false4056 this.un = null;//false4057 this.st = null;//false4058 this.b = null;//false4059 this.tpls = [];4060 this.x = [];4061};4062function CT_Number() {4063//Attributes4064 this.v = null;4065 this.u = null;4066 this.f = null;4067 this.c = null;4068 this.cp = null;4069 this.in = null;4070 this.bc = null;4071 this.fc = null;4072 this.i = null;//false4073 this.un = null;//false4074 this.st = null;//false4075 this.b = null;//false4076//Members4077 this.tpls = [];4078 this.x = [];4079}4080CT_Number.prototype.readAttributes = function(attr, uq) {4081 if (attr()) {4082 var vals = attr();4083 var val;4084 val = vals["v"];4085 if (undefined !== val) {4086 this.v = val - 0;4087 }4088 val = vals["u"];4089 if (undefined !== val) {4090 this.u = getBoolFromXml(val);4091 }4092 val = vals["f"];4093 if (undefined !== val) {4094 this.f = getBoolFromXml(val);4095 }4096 val = vals["c"];4097 if (undefined !== val) {4098 this.c = uq(val);4099 }4100 val = vals["cp"];4101 if (undefined !== val) {4102 this.cp = val - 0;4103 }4104 val = vals["in"];4105 if (undefined !== val) {4106 this.in = val - 0;4107 }4108 val = vals["bc"];4109 if (undefined !== val) {4110 this.bc = val - 0;4111 }4112 val = vals["fc"];4113 if (undefined !== val) {4114 this.fc = val - 0;4115 }4116 val = vals["i"];4117 if (undefined !== val) {4118 this.i = getBoolFromXml(val);4119 }4120 val = vals["un"];4121 if (undefined !== val) {4122 this.un = getBoolFromXml(val);4123 }4124 val = vals["st"];4125 if (undefined !== val) {4126 this.st = getBoolFromXml(val);4127 }4128 val = vals["b"];4129 if (undefined !== val) {4130 this.b = getBoolFromXml(val);4131 }4132 }4133};4134CT_Number.prototype.onStartNode = function(elem, attr, uq) {4135 var newContext = this;4136 if ("tpls" === elem) {4137 newContext = new CT_Tuples();4138 if (newContext.readAttributes) {4139 newContext.readAttributes(attr, uq);4140 }4141 this.tpls.push(newContext);4142 } else if ("x" === elem) {4143 newContext = new CT_X();4144 if (newContext.readAttributes) {4145 newContext.readAttributes(attr, uq);4146 }4147 this.x.push(newContext);4148 } else {4149 newContext = null;4150 }4151 return newContext;4152};4153CT_Number.prototype.toXml = function(writer, name) {4154 this.toXml2(writer, name, this.v, this);4155};4156CT_Number.prototype.toXml2 = function(writer, name, val, obj) {4157 writer.WriteXmlNodeStart(name);4158 if (null !== val) {4159 writer.WriteXmlAttributeNumber("v", val);4160 }4161 if (obj) {4162 if (null !== obj.u) {4163 writer.WriteXmlAttributeBool("u", obj.u);4164 }4165 if (null !== obj.f) {4166 writer.WriteXmlAttributeBool("f", obj.f);4167 }4168 if (null !== obj.c) {4169 writer.WriteXmlAttributeStringEncode("c", obj.c);4170 }4171 if (null !== obj.cp) {4172 writer.WriteXmlAttributeNumber("cp", obj.cp);4173 }4174 if (null !== obj.in) {4175 writer.WriteXmlAttributeNumber("in", obj.in);4176 }4177 if (null !== obj.bc) {4178 writer.WriteXmlAttributeNumber("bc", obj.bc);4179 }4180 if (null !== obj.fc) {4181 writer.WriteXmlAttributeNumber("fc", obj.fc);4182 }4183 if (null !== obj.i) {4184 writer.WriteXmlAttributeBool("i", obj.i);4185 }4186 if (null !== obj.un) {4187 writer.WriteXmlAttributeBool("un", obj.un);4188 }4189 if (null !== obj.st) {4190 writer.WriteXmlAttributeBool("st", obj.st);4191 }4192 if (null !== obj.b) {4193 writer.WriteXmlAttributeBool("b", obj.b);4194 }4195 writer.WriteXmlNodeEnd(name, true);4196 for (var i = 0; i < obj.tpls.length; ++i) {4197 var elem = obj.tpls[i];4198 elem.toXml(writer, "tpls");4199 }4200 for (var i = 0; i < obj.x.length; ++i) {4201 var elem = obj.x[i];4202 elem.toXml(writer, "x");4203 }4204 } else {4205 writer.WriteXmlNodeEnd(name, true);4206 }4207 writer.WriteXmlNodeEnd(name);4208};4209CT_Number.prototype.isSimpleValue = function() {4210 return null === this.u && null === this.f && null === this.c && null === this.cp && null === this.in &&4211 null === this.bc && null === this.fc && null === this.i && null === this.un && null === this.st &&4212 null === this.b && 0 === this.tpls.length && 0 === this.x.length;4213};4214CT_Number.prototype.clean = function() {4215 this.v = null;4216 this.u = null;4217 this.f = null;4218 this.c = null;4219 this.cp = null;4220 this.in = null;4221 this.bc = null;4222 this.fc = null;4223 this.i = null;//false4224 this.un = null;//false4225 this.st = null;//false4226 this.b = null;//false4227 this.tpls = [];4228 this.x = [];4229};4230function CT_String() {4231//Attributes4232 this.v = null;4233 this.u = null;4234 this.f = null;4235 this.c = null;4236 this.cp = null;4237 this.in = null;4238 this.bc = null;4239 this.fc = null;4240 this.i = null;//false4241 this.un = null;//false4242 this.st = null;//false4243 this.b = null;//false4244//Members4245 this.tpls = [];4246 this.x = [];4247}4248CT_String.prototype.readAttributes = function(attr, uq) {4249 if (attr()) {4250 var vals = attr();4251 var val;4252 val = vals["v"];4253 if (undefined !== val) {4254 this.v = uq(val);4255 }4256 val = vals["u"];4257 if (undefined !== val) {4258 this.u = getBoolFromXml(val);4259 }4260 val = vals["f"];4261 if (undefined !== val) {4262 this.f = getBoolFromXml(val);4263 }4264 val = vals["c"];4265 if (undefined !== val) {4266 this.c = uq(val);4267 }4268 val = vals["cp"];4269 if (undefined !== val) {4270 this.cp = val - 0;4271 }4272 val = vals["in"];4273 if (undefined !== val) {4274 this.in = val - 0;4275 }4276 val = vals["bc"];4277 if (undefined !== val) {4278 this.bc = val - 0;4279 }4280 val = vals["fc"];4281 if (undefined !== val) {4282 this.fc = val - 0;4283 }4284 val = vals["i"];4285 if (undefined !== val) {4286 this.i = getBoolFromXml(val);4287 }4288 val = vals["un"];4289 if (undefined !== val) {4290 this.un = getBoolFromXml(val);4291 }4292 val = vals["st"];4293 if (undefined !== val) {4294 this.st = getBoolFromXml(val);4295 }4296 val = vals["b"];4297 if (undefined !== val) {4298 this.b = getBoolFromXml(val);4299 }4300 }4301};4302CT_String.prototype.onStartNode = function(elem, attr, uq) {4303 var newContext = this;4304 if ("tpls" === elem) {4305 newContext = new CT_Tuples();4306 if (newContext.readAttributes) {4307 newContext.readAttributes(attr, uq);4308 }4309 this.tpls.push(newContext);4310 } else if ("x" === elem) {4311 newContext = new CT_X();4312 if (newContext.readAttributes) {4313 newContext.readAttributes(attr, uq);4314 }4315 this.x.push(newContext);4316 } else {4317 newContext = null;4318 }4319 return newContext;4320};4321CT_String.prototype.toXml = function(writer, name) {4322 this.toXml2(writer, name, this.v, this);4323};4324CT_String.prototype.toXml2 = function(writer, name, val, obj) {4325 writer.WriteXmlNodeStart(name);4326 if (null !== val) {4327 writer.WriteXmlAttributeStringEncode("v", val);4328 }4329 if (obj) {4330 if (null !== obj.u) {4331 writer.WriteXmlAttributeBool("u", obj.u);4332 }4333 if (null !== obj.f) {4334 writer.WriteXmlAttributeBool("f", obj.f);4335 }4336 if (null !== obj.c) {4337 writer.WriteXmlAttributeStringEncode("c", obj.c);4338 }4339 if (null !== obj.cp) {4340 writer.WriteXmlAttributeNumber("cp", obj.cp);4341 }4342 if (null !== obj.in) {4343 writer.WriteXmlAttributeNumber("in", obj.in);4344 }4345 if (null !== obj.bc) {4346 writer.WriteXmlAttributeNumber("bc", obj.bc);4347 }4348 if (null !== obj.fc) {4349 writer.WriteXmlAttributeNumber("fc", obj.fc);4350 }4351 if (null !== obj.i) {4352 writer.WriteXmlAttributeBool("i", obj.i);4353 }4354 if (null !== obj.un) {4355 writer.WriteXmlAttributeBool("un", obj.un);4356 }4357 if (null !== obj.st) {4358 writer.WriteXmlAttributeBool("st", obj.st);4359 }4360 if (null !== obj.b) {4361 writer.WriteXmlAttributeBool("b", obj.b);4362 }4363 writer.WriteXmlNodeEnd(name, true);4364 for (var i = 0; i < obj.tpls.length; ++i) {4365 var elem = obj.tpls[i];4366 elem.toXml(writer, "tpls");4367 }4368 for (var i = 0; i < obj.x.length; ++i) {4369 var elem = obj.x[i];4370 elem.toXml(writer, "x");4371 }4372 } else {4373 writer.WriteXmlNodeEnd(name, true);4374 }4375 writer.WriteXmlNodeEnd(name);4376};4377CT_String.prototype.isSimpleValue = function() {4378 return null === this.u && null === this.f && null === this.c && null === this.cp && null === this.in &&4379 null === this.bc && null === this.fc && null === this.i && null === this.un && null === this.st &&4380 null === this.b && 0 === this.tpls.length && 0 === this.x.length;4381};4382CT_String.prototype.clean = function() {4383 this.v = null;4384 this.u = null;4385 this.f = null;4386 this.c = null;4387 this.cp = null;4388 this.in = null;4389 this.bc = null;4390 this.fc = null;4391 this.i = null;//false4392 this.un = null;//false4393 this.st = null;//false4394 this.b = null;//false4395 this.tpls = [];4396 this.x = [];4397};4398function CT_Index() {4399//Attributes4400 this.v = null;4401}4402CT_Index.prototype.readAttributes = function(attr, uq) {4403 if (attr()) {4404 var vals = attr();4405 var val;4406 val = vals["v"];4407 if (undefined !== val) {4408 this.v = val - 0;4409 }4410 }4411};4412CT_Index.prototype.toXml = function(writer, name) {4413 this.toXml2(writer, name, this.v);4414};4415CT_Index.prototype.toXml2 = function(writer, name, val) {4416 writer.WriteXmlNodeStart(name);4417 if (null !== val) {4418 writer.WriteXmlAttributeNumber("v", val);4419 }4420 writer.WriteXmlNodeEnd(name, true, true);4421};4422CT_Index.prototype.isSimpleValue = function() {4423 return true;4424};4425CT_Index.prototype.clean = function() {4426 this.v = null;4427};4428function CT_Location() {4429//Attributes4430 this.ref = null;4431 this.firstHeaderRow = null;4432 this.firstDataRow = null;4433 this.firstDataCol = null;4434 this.rowPageCount = null;//04435 this.colPageCount = null;//04436// private4437 this.refWithPage = null;4438}4439CT_Location.prototype.readAttributes = function(attr, uq) {4440 if (attr()) {4441 var vals = attr();4442 var val;4443 val = vals["ref"];4444 if (undefined !== val) {4445 this.ref = AscCommonExcel.g_oRangeCache.getAscRange(uq(val));4446 }4447 val = vals["firstHeaderRow"];4448 if (undefined !== val) {4449 this.firstHeaderRow = val - 0;4450 }4451 val = vals["firstDataRow"];4452 if (undefined !== val) {4453 this.firstDataRow = val - 0;4454 }4455 val = vals["firstDataCol"];4456 if (undefined !== val) {4457 this.firstDataCol = val - 0;4458 }4459 val = vals["rowPageCount"];4460 if (undefined !== val) {4461 this.rowPageCount = val - 0;4462 }4463 val = vals["colPageCount"];4464 if (undefined !== val) {4465 this.colPageCount = val - 0;4466 }4467 }4468};4469CT_Location.prototype.toXml = function(writer, name) {4470 writer.WriteXmlNodeStart(name);4471 if (null !== this.ref) {4472 writer.WriteXmlAttributeStringEncode("ref", this.ref.getName());4473 }4474 if (null !== this.firstHeaderRow) {4475 writer.WriteXmlAttributeNumber("firstHeaderRow", this.firstHeaderRow);4476 }4477 if (null !== this.firstDataRow) {4478 writer.WriteXmlAttributeNumber("firstDataRow", this.firstDataRow);4479 }4480 if (null !== this.firstDataCol) {4481 writer.WriteXmlAttributeNumber("firstDataCol", this.firstDataCol);4482 }4483 if (null !== this.rowPageCount) {4484 writer.WriteXmlAttributeNumber("rowPageCount", this.rowPageCount);4485 }4486 if (null !== this.colPageCount) {4487 writer.WriteXmlAttributeNumber("colPageCount", this.colPageCount);4488 }4489 writer.WriteXmlNodeEnd(name, true, true);4490};4491CT_Location.prototype.intersection = function (range) {4492 var t = this;4493 return this.ref && (Array.isArray(range) ? range.some(function (element) {4494 return t.ref.intersectionSimple(element);4495 }) : this.ref.intersectionSimple(range));4496};4497CT_Location.prototype.contains = function (col, row) {4498 return this.ref && this.ref.contains(col, row);4499};4500CT_Location.prototype.setPageCount = function (row, col) {4501 var c2;4502 this.rowPageCount = row;4503 this.colPageCount = col;4504 if (this.ref) {4505 this.refWithPage = this.ref.clone();4506 if (this.rowPageCount) {4507 this.refWithPage.setOffsetFirst(new AscCommonExcel.CRangeOffset(0, - (this.rowPageCount + 1)));4508 }4509 c2 = this.colPageCount * 3 - 1 - 1;4510 if (c2 > this.refWithPage.c2) {4511 this.refWithPage.setOffsetLast(new AscCommonExcel.CRangeOffset(c2 - this.refWithPage.c2, 0));4512 }4513 }4514};4515function CT_PivotFields() {4516//Attributes4517 this.count = null;4518//Members4519 this.pivotField = [];4520}4521CT_PivotFields.prototype.readAttributes = function(attr, uq) {4522 if (attr()) {4523 var vals = attr();4524 var val;4525 val = vals["count"];4526 if (undefined !== val) {4527 this.count = val - 0;4528 }4529 }4530};4531CT_PivotFields.prototype.onStartNode = function(elem, attr, uq) {4532 var newContext = this;4533 if ("pivotField" === elem) {4534 newContext = new CT_PivotField();4535 if (newContext.readAttributes) {4536 newContext.readAttributes(attr, uq);4537 }4538 this.pivotField.push(newContext);4539 } else {4540 newContext = null;4541 }4542 return newContext;4543};4544CT_PivotFields.prototype.toXml = function(writer, name) {4545 writer.WriteXmlNodeStart(name);4546 if (null !== this.count) {4547 writer.WriteXmlAttributeNumber("count", this.count);4548 }4549 writer.WriteXmlNodeEnd(name, true);4550 for (var i = 0; i < this.pivotField.length; ++i) {4551 var elem = this.pivotField[i];4552 elem.toXml(writer, "pivotField");4553 }4554 writer.WriteXmlNodeEnd(name);4555};4556function CT_RowFields() {4557//Attributes4558 this.count = null;//04559//Members4560 this.field = [];4561}4562CT_RowFields.prototype.readAttributes = function(attr, uq) {4563 if (attr()) {4564 var vals = attr();4565 var val;4566 val = vals["count"];4567 if (undefined !== val) {4568 this.count = val - 0;4569 }4570 }4571};4572CT_RowFields.prototype.onStartNode = function(elem, attr, uq) {4573 var newContext = this;4574 if ("field" === elem) {4575 newContext = new CT_Field();4576 if (newContext.readAttributes) {4577 newContext.readAttributes(attr, uq);4578 }4579 this.field.push(newContext);4580 } else {4581 newContext = null;4582 }4583 return newContext;4584};4585CT_RowFields.prototype.toXml = function(writer, name) {4586 writer.WriteXmlNodeStart(name);4587 if (null !== this.count) {4588 writer.WriteXmlAttributeNumber("count", this.count);4589 }4590 writer.WriteXmlNodeEnd(name, true);4591 for (var i = 0; i < this.field.length; ++i) {4592 var elem = this.field[i];4593 elem.toXml(writer, "field");4594 }4595 writer.WriteXmlNodeEnd(name);4596};4597function CT_rowItems() {4598//Attributes4599 this.count = null;4600//Members4601 this.i = [];4602}4603CT_rowItems.prototype.readAttributes = function(attr, uq) {4604 if (attr()) {4605 var vals = attr();4606 var val;4607 val = vals["count"];4608 if (undefined !== val) {4609 this.count = val - 0;4610 }4611 }4612};4613CT_rowItems.prototype.onStartNode = function(elem, attr, uq) {4614 var newContext = this;4615 if ("i" === elem) {4616 newContext = new CT_I();4617 if (newContext.readAttributes) {4618 newContext.readAttributes(attr, uq);4619 }4620 this.i.push(newContext);4621 } else {4622 newContext = null;4623 }4624 return newContext;4625};4626CT_rowItems.prototype.toXml = function(writer, name) {4627 writer.WriteXmlNodeStart(name);4628 if (null !== this.count) {4629 writer.WriteXmlAttributeNumber("count", this.count);4630 }4631 writer.WriteXmlNodeEnd(name, true);4632 for (var i = 0; i < this.i.length; ++i) {4633 var elem = this.i[i];4634 elem.toXml(writer, "i");4635 }4636 writer.WriteXmlNodeEnd(name);4637};4638function CT_ColFields() {4639//Attributes4640 this.count = null;//04641//Members4642 this.field = [];4643}4644CT_ColFields.prototype.readAttributes = function(attr, uq) {4645 if (attr()) {4646 var vals = attr();4647 var val;4648 val = vals["count"];4649 if (undefined !== val) {4650 this.count = val - 0;4651 }4652 }4653};4654CT_ColFields.prototype.onStartNode = function(elem, attr, uq) {4655 var newContext = this;4656 if ("field" === elem) {4657 newContext = new CT_Field();4658 if (newContext.readAttributes) {4659 newContext.readAttributes(attr, uq);4660 }4661 this.field.push(newContext);4662 } else {4663 newContext = null;4664 }4665 return newContext;4666};4667CT_ColFields.prototype.toXml = function(writer, name) {4668 writer.WriteXmlNodeStart(name);4669 if (null !== this.count) {4670 writer.WriteXmlAttributeNumber("count", this.count);4671 }4672 writer.WriteXmlNodeEnd(name, true);4673 for (var i = 0; i < this.field.length; ++i) {4674 var elem = this.field[i];4675 elem.toXml(writer, "field");4676 }4677 writer.WriteXmlNodeEnd(name);4678};4679function CT_colItems() {4680//Attributes4681 this.count = null;4682//Members4683 this.i = [];4684}4685CT_colItems.prototype.readAttributes = function(attr, uq) {4686 if (attr()) {4687 var vals = attr();4688 var val;4689 val = vals["count"];4690 if (undefined !== val) {4691 this.count = val - 0;4692 }4693 }4694};4695CT_colItems.prototype.onStartNode = function(elem, attr, uq) {4696 var newContext = this;4697 if ("i" === elem) {4698 newContext = new CT_I();4699 if (newContext.readAttributes) {4700 newContext.readAttributes(attr, uq);4701 }4702 this.i.push(newContext);4703 } else {4704 newContext = null;4705 }4706 return newContext;4707};4708CT_colItems.prototype.toXml = function(writer, name) {4709 writer.WriteXmlNodeStart(name);4710 if (null !== this.count) {4711 writer.WriteXmlAttributeNumber("count", this.count);4712 }4713 writer.WriteXmlNodeEnd(name, true);4714 for (var i = 0; i < this.i.length; ++i) {4715 var elem = this.i[i];4716 elem.toXml(writer, "i");4717 }4718 writer.WriteXmlNodeEnd(name);4719};4720function CT_PageFields() {4721//Attributes4722 this.count = null;4723//Members4724 this.pageField = [];4725}4726CT_PageFields.prototype.readAttributes = function(attr, uq) {4727 if (attr()) {4728 var vals = attr();4729 var val;4730 val = vals["count"];4731 if (undefined !== val) {4732 this.count = val - 0;4733 }4734 }4735};4736CT_PageFields.prototype.onStartNode = function(elem, attr, uq) {4737 var newContext = this;4738 if ("pageField" === elem) {4739 newContext = new CT_PageField();4740 if (newContext.readAttributes) {4741 newContext.readAttributes(attr, uq);4742 }4743 this.pageField.push(newContext);4744 } else {4745 newContext = null;4746 }4747 return newContext;4748};4749CT_PageFields.prototype.toXml = function(writer, name) {4750 writer.WriteXmlNodeStart(name);4751 if (null !== this.count) {4752 writer.WriteXmlAttributeNumber("count", this.count);4753 }4754 writer.WriteXmlNodeEnd(name, true);4755 for (var i = 0; i < this.pageField.length; ++i) {4756 var elem = this.pageField[i];4757 elem.toXml(writer, "pageField");4758 }4759 writer.WriteXmlNodeEnd(name);4760};4761CT_PageFields.prototype.add = function (newContext) {4762 this.pageField.push(newContext);4763 this.count = this.pageField.length;4764};4765CT_PageFields.prototype.remove = function (index) {4766 var deleteIndex = this.pageField.findIndex(function (element) {4767 return element.asc_getIndex() === index;4768 });4769 if (-1 !== deleteIndex) {4770 this.pageField.splice(deleteIndex, 1);4771 }4772 this.count = this.pageField.length;4773};4774function CT_DataFields() {4775//Attributes4776 this.count = null;4777//Members4778 this.dataField = [];4779}4780CT_DataFields.prototype.readAttributes = function(attr, uq) {4781 if (attr()) {4782 var vals = attr();4783 var val;4784 val = vals["count"];4785 if (undefined !== val) {4786 this.count = val - 0;4787 }4788 }4789};4790CT_DataFields.prototype.onStartNode = function(elem, attr, uq) {4791 var newContext = this;4792 if ("dataField" === elem) {4793 newContext = new CT_DataField();4794 if (newContext.readAttributes) {4795 newContext.readAttributes(attr, uq);4796 }4797 this.dataField.push(newContext);4798 } else {4799 newContext = null;4800 }4801 return newContext;4802};4803CT_DataFields.prototype.toXml = function(writer, name) {4804 writer.WriteXmlNodeStart(name);4805 if (null !== this.count) {4806 writer.WriteXmlAttributeNumber("count", this.count);4807 }4808 writer.WriteXmlNodeEnd(name, true);4809 for (var i = 0; i < this.dataField.length; ++i) {4810 var elem = this.dataField[i];4811 elem.toXml(writer, "dataField");4812 }4813 writer.WriteXmlNodeEnd(name);4814};4815function CT_Formats() {4816//Attributes4817 this.count = null;//04818//Members4819 this.format = [];4820}4821CT_Formats.prototype.readAttributes = function(attr, uq) {4822 if (attr()) {4823 var vals = attr();4824 var val;4825 val = vals["count"];4826 if (undefined !== val) {4827 this.count = val - 0;4828 }4829 }4830};4831CT_Formats.prototype.onStartNode = function(elem, attr, uq) {4832 var newContext = this;4833 if ("format" === elem) {4834 newContext = new CT_Format();4835 if (newContext.readAttributes) {4836 newContext.readAttributes(attr, uq);4837 }4838 this.format.push(newContext);4839 } else {4840 newContext = null;4841 }4842 return newContext;4843};4844CT_Formats.prototype.toXml = function(writer, name) {4845 writer.WriteXmlNodeStart(name);4846 if (null !== this.count) {4847 writer.WriteXmlAttributeNumber("count", this.count);4848 }4849 writer.WriteXmlNodeEnd(name, true);4850 for (var i = 0; i < this.format.length; ++i) {4851 var elem = this.format[i];4852 elem.toXml(writer, "format");4853 }4854 writer.WriteXmlNodeEnd(name);4855};4856function CT_ConditionalFormats() {4857//Attributes4858 this.count = null;//04859//Members4860 this.conditionalFormat = [];4861}4862CT_ConditionalFormats.prototype.readAttributes = function(attr, uq) {4863 if (attr()) {4864 var vals = attr();4865 var val;4866 val = vals["count"];4867 if (undefined !== val) {4868 this.count = val - 0;4869 }4870 }4871};4872CT_ConditionalFormats.prototype.onStartNode = function(elem, attr, uq) {4873 var newContext = this;4874 if ("conditionalFormat" === elem) {4875 newContext = new CT_ConditionalFormat();4876 if (newContext.readAttributes) {4877 newContext.readAttributes(attr, uq);4878 }4879 this.conditionalFormat.push(newContext);4880 } else {4881 newContext = null;4882 }4883 return newContext;4884};4885CT_ConditionalFormats.prototype.toXml = function(writer, name) {4886 writer.WriteXmlNodeStart(name);4887 if (null !== this.count) {4888 writer.WriteXmlAttributeNumber("count", this.count);4889 }4890 writer.WriteXmlNodeEnd(name, true);4891 for (var i = 0; i < this.conditionalFormat.length; ++i) {4892 var elem = this.conditionalFormat[i];4893 elem.toXml(writer, "conditionalFormat");4894 }4895 writer.WriteXmlNodeEnd(name);4896};4897function CT_ChartFormats() {4898//Attributes4899 this.count = null;//04900//Members4901 this.chartFormat = [];4902}4903CT_ChartFormats.prototype.readAttributes = function(attr, uq) {4904 if (attr()) {4905 var vals = attr();4906 var val;4907 val = vals["count"];4908 if (undefined !== val) {4909 this.count = val - 0;4910 }4911 }4912};4913CT_ChartFormats.prototype.onStartNode = function(elem, attr, uq) {4914 var newContext = this;4915 if ("chartFormat" === elem) {4916 newContext = new CT_ChartFormat();4917 if (newContext.readAttributes) {4918 newContext.readAttributes(attr, uq);4919 }4920 this.chartFormat.push(newContext);4921 } else {4922 newContext = null;4923 }4924 return newContext;4925};4926CT_ChartFormats.prototype.toXml = function(writer, name) {4927 writer.WriteXmlNodeStart(name);4928 if (null !== this.count) {4929 writer.WriteXmlAttributeNumber("count", this.count);4930 }4931 writer.WriteXmlNodeEnd(name, true);4932 for (var i = 0; i < this.chartFormat.length; ++i) {4933 var elem = this.chartFormat[i];4934 elem.toXml(writer, "chartFormat");4935 }4936 writer.WriteXmlNodeEnd(name);4937};4938function CT_PivotHierarchies() {4939//Attributes4940 this.count = null;4941//Members4942 this.pivotHierarchy = [];4943}4944CT_PivotHierarchies.prototype.readAttributes = function(attr, uq) {4945 if (attr()) {4946 var vals = attr();4947 var val;4948 val = vals["count"];4949 if (undefined !== val) {4950 this.count = val - 0;4951 }4952 }4953};4954CT_PivotHierarchies.prototype.onStartNode = function(elem, attr, uq) {4955 var newContext = this;4956 if ("pivotHierarchy" === elem) {4957 newContext = new CT_PivotHierarchy();4958 if (newContext.readAttributes) {4959 newContext.readAttributes(attr, uq);4960 }4961 this.pivotHierarchy.push(newContext);4962 } else {4963 newContext = null;4964 }4965 return newContext;4966};4967CT_PivotHierarchies.prototype.toXml = function(writer, name) {4968 writer.WriteXmlNodeStart(name);4969 if (null !== this.count) {4970 writer.WriteXmlAttributeNumber("count", this.count);4971 }4972 writer.WriteXmlNodeEnd(name, true);4973 for (var i = 0; i < this.pivotHierarchy.length; ++i) {4974 var elem = this.pivotHierarchy[i];4975 elem.toXml(writer, "pivotHierarchy");4976 }4977 writer.WriteXmlNodeEnd(name);4978};4979function CT_PivotTableStyle() {4980//Attributes4981 this.name = null;4982 this.showRowHeaders = null;4983 this.showColHeaders = null;4984 this.showRowStripes = null;4985 this.showColStripes = null;4986 this.showLastColumn = null;4987}4988CT_PivotTableStyle.prototype.readAttributes = function(attr, uq) {4989 if (attr()) {4990 var vals = attr();4991 var val;4992 val = vals["name"];4993 if (undefined !== val) {4994 this.name = uq(val);4995 }4996 val = vals["showRowHeaders"];4997 if (undefined !== val) {4998 this.showRowHeaders = getBoolFromXml(val);4999 }5000 val = vals["showColHeaders"];5001 if (undefined !== val) {5002 this.showColHeaders = getBoolFromXml(val);5003 }5004 val = vals["showRowStripes"];5005 if (undefined !== val) {5006 this.showRowStripes = getBoolFromXml(val);5007 }5008 val = vals["showColStripes"];5009 if (undefined !== val) {5010 this.showColStripes = getBoolFromXml(val);5011 }5012 val = vals["showLastColumn"];5013 if (undefined !== val) {5014 this.showLastColumn = getBoolFromXml(val);5015 }5016 }5017};5018CT_PivotTableStyle.prototype.toXml = function(writer, name) {5019 writer.WriteXmlNodeStart(name);5020 if (null !== this.name) {5021 writer.WriteXmlAttributeStringEncode("name", this.name);5022 }5023 if (null !== this.showRowHeaders) {5024 writer.WriteXmlAttributeBool("showRowHeaders", this.showRowHeaders);5025 }5026 if (null !== this.showColHeaders) {5027 writer.WriteXmlAttributeBool("showColHeaders", this.showColHeaders);5028 }5029 if (null !== this.showRowStripes) {5030 writer.WriteXmlAttributeBool("showRowStripes", this.showRowStripes);5031 }5032 if (null !== this.showColStripes) {5033 writer.WriteXmlAttributeBool("showColStripes", this.showColStripes);5034 }5035 if (null !== this.showLastColumn) {5036 writer.WriteXmlAttributeBool("showLastColumn", this.showLastColumn);5037 }5038 writer.WriteXmlNodeEnd(name, true, true);5039};5040CT_PivotTableStyle.prototype.set = function() {5041};5042CT_PivotTableStyle.prototype.asc_getName = function() {5043 return this.name;5044};5045CT_PivotTableStyle.prototype.asc_getShowRowHeaders = function() {5046 return this.showRowHeaders;5047};5048CT_PivotTableStyle.prototype.asc_getShowColHeaders = function() {5049 return this.showColHeaders;5050};5051CT_PivotTableStyle.prototype.asc_getShowRowStripes = function() {5052 return this.showRowStripes;5053};5054CT_PivotTableStyle.prototype.asc_getShowColStripes = function() {5055 return this.showColStripes;5056};5057CT_PivotTableStyle.prototype.asc_setName = function(api, pivot, newVal) {5058 if (newVal !== this.name) {5059 var t = this;5060 api._changePivotStyle(pivot, function(ws) {t._setName(newVal, pivot, ws)});5061 }5062};5063CT_PivotTableStyle.prototype.asc_setShowRowHeaders = function(api, pivot, newVal) {5064 if (newVal !== this.showRowHeaders) {5065 var t = this;5066 api._changePivotStyle(pivot, function(ws) {t._setShowRowHeaders(newVal, pivot, ws)});5067 }5068};5069CT_PivotTableStyle.prototype.asc_setShowColHeaders = function(api, pivot, newVal) {5070 if (newVal !== this.showColHeaders) {5071 var t = this;5072 api._changePivotStyle(pivot, function(ws) {t._setShowColHeaders(newVal, pivot, ws)});5073 }5074};5075CT_PivotTableStyle.prototype.asc_setShowRowStripes = function(api, pivot, newVal) {5076 if (newVal !== this.showRowStripes) {5077 var t = this;5078 api._changePivotStyle(pivot, function(ws) {t._setShowRowStripes(newVal, pivot, ws)});5079 }5080};5081CT_PivotTableStyle.prototype.asc_setShowColStripes = function(api, pivot, newVal) {5082 if (newVal !== this.showColStripes) {5083 var t = this;5084 api._changePivotStyle(pivot, function(ws) {t._setShowColStripes(newVal, pivot, ws)});5085 }5086};5087CT_PivotTableStyle.prototype._setName = function (newVal, pivot, ws) {5088 if (History.Is_On() && this.name !== newVal) {5089 History.Add(AscCommonExcel.g_oUndoRedoPivotTables, AscCH.historyitem_PivotTable_StyleName,5090 ws ? ws.getId() : null, null,5091 new AscCommonExcel.UndoRedoData_PivotTable(pivot && pivot.asc_getName(), this.name, newVal));5092 }5093 this.name = newVal;5094};5095CT_PivotTableStyle.prototype._setShowRowHeaders = function (newVal, pivot, ws) {5096 if (History.Is_On() && this.showRowHeaders !== newVal) {5097 History.Add(AscCommonExcel.g_oUndoRedoPivotTables, AscCH.historyitem_PivotTable_StyleShowRowHeaders,5098 ws ? ws.getId() : null, null,5099 new AscCommonExcel.UndoRedoData_PivotTable(pivot && pivot.asc_getName(), this.showRowHeaders, newVal));5100 }5101 this.showRowHeaders = newVal;5102};5103CT_PivotTableStyle.prototype._setShowColHeaders = function (newVal, pivot, ws) {5104 if (History.Is_On() && this.showColHeaders !== newVal) {5105 History.Add(AscCommonExcel.g_oUndoRedoPivotTables, AscCH.historyitem_PivotTable_StyleShowColHeaders,5106 ws ? ws.getId() : null, null,5107 new AscCommonExcel.UndoRedoData_PivotTable(pivot && pivot.asc_getName(), this.showColHeaders, newVal));5108 }5109 this.showColHeaders = newVal;5110};5111CT_PivotTableStyle.prototype._setShowRowStripes = function (newVal, pivot, ws) {5112 if (History.Is_On() && this.showRowStripes !== newVal) {5113 History.Add(AscCommonExcel.g_oUndoRedoPivotTables, AscCH.historyitem_PivotTable_StyleShowRowStripes,5114 ws ? ws.getId() : null, null,5115 new AscCommonExcel.UndoRedoData_PivotTable(pivot && pivot.asc_getName(), this.showRowStripes, newVal));5116 }5117 this.showRowStripes = newVal;5118};5119CT_PivotTableStyle.prototype._setShowColStripes = function (newVal, pivot, ws) {5120 if (History.Is_On() && this.showColStripes !== newVal) {5121 History.Add(AscCommonExcel.g_oUndoRedoPivotTables, AscCH.historyitem_PivotTable_StyleShowColStripes,5122 ws ? ws.getId() : null, null,5123 new AscCommonExcel.UndoRedoData_PivotTable(pivot && pivot.asc_getName(), this.showColStripes, newVal));5124 }5125 this.showColStripes = newVal;5126};5127function CT_PivotFilters() {5128//Attributes5129 this.count = null;//05130//Members5131 this.filter = [];5132}5133CT_PivotFilters.prototype.readAttributes = function(attr, uq) {5134 if (attr()) {5135 var vals = attr();5136 var val;5137 val = vals["count"];5138 if (undefined !== val) {5139 this.count = val - 0;5140 }5141 }5142};5143CT_PivotFilters.prototype.onStartNode = function(elem, attr, uq) {5144 var newContext = this;5145 if ("filter" === elem) {5146 newContext = new CT_PivotFilter();5147 if (newContext.readAttributes) {5148 newContext.readAttributes(attr, uq);5149 }5150 this.filter.push(newContext);5151 } else {5152 newContext = null;5153 }5154 return newContext;5155};5156CT_PivotFilters.prototype.toXml = function(writer, name) {5157 writer.WriteXmlNodeStart(name);5158 if (null !== this.count) {5159 writer.WriteXmlAttributeNumber("count", this.count);5160 }5161 writer.WriteXmlNodeEnd(name, true);5162 for (var i = 0; i < this.filter.length; ++i) {5163 var elem = this.filter[i];5164 elem.toXml(writer, "filter");5165 }5166 writer.WriteXmlNodeEnd(name);5167};5168function CT_RowHierarchiesUsage() {5169//Attributes5170 this.count = null;5171//Members5172 this.rowHierarchyUsage = [];5173}5174CT_RowHierarchiesUsage.prototype.readAttributes = function(attr, uq) {5175 if (attr()) {5176 var vals = attr();5177 var val;5178 val = vals["count"];5179 if (undefined !== val) {5180 this.count = val - 0;5181 }5182 }5183};5184CT_RowHierarchiesUsage.prototype.onStartNode = function(elem, attr, uq) {5185 var newContext = this;5186 if ("rowHierarchyUsage" === elem) {5187 newContext = new CT_HierarchyUsage();5188 if (newContext.readAttributes) {5189 newContext.readAttributes(attr, uq);5190 }5191 this.rowHierarchyUsage.push(newContext);5192 } else {5193 newContext = null;5194 }5195 return newContext;5196};5197CT_RowHierarchiesUsage.prototype.toXml = function(writer, name) {5198 writer.WriteXmlNodeStart(name);5199 if (null !== this.count) {5200 writer.WriteXmlAttributeNumber("count", this.count);5201 }5202 writer.WriteXmlNodeEnd(name, true);5203 for (var i = 0; i < this.rowHierarchyUsage.length; ++i) {5204 var elem = this.rowHierarchyUsage[i];5205 elem.toXml(writer, "rowHierarchyUsage");5206 }5207 writer.WriteXmlNodeEnd(name);5208};5209function CT_ColHierarchiesUsage() {5210//Attributes5211 this.count = null;5212//Members5213 this.colHierarchyUsage = [];5214}5215CT_ColHierarchiesUsage.prototype.readAttributes = function(attr, uq) {5216 if (attr()) {5217 var vals = attr();5218 var val;5219 val = vals["count"];5220 if (undefined !== val) {5221 this.count = val - 0;5222 }5223 }5224};5225CT_ColHierarchiesUsage.prototype.onStartNode = function(elem, attr, uq) {5226 var newContext = this;5227 if ("colHierarchyUsage" === elem) {5228 newContext = new CT_HierarchyUsage();5229 if (newContext.readAttributes) {5230 newContext.readAttributes(attr, uq);5231 }5232 this.colHierarchyUsage.push(newContext);5233 } else {5234 newContext = null;5235 }5236 return newContext;5237};5238CT_ColHierarchiesUsage.prototype.toXml = function(writer, name) {5239 writer.WriteXmlNodeStart(name);5240 if (null !== this.count) {5241 writer.WriteXmlAttributeNumber("count", this.count);5242 }5243 writer.WriteXmlNodeEnd(name, true);5244 for (var i = 0; i < this.colHierarchyUsage.length; ++i) {5245 var elem = this.colHierarchyUsage[i];5246 elem.toXml(writer, "colHierarchyUsage");5247 }5248 writer.WriteXmlNodeEnd(name);5249};5250function CT_Consolidation() {5251//Attributes5252 this.autoPage = null;//true5253//Members5254 this.pages = null;5255 this.rangeSets = null;5256}5257CT_Consolidation.prototype.readAttributes = function(attr, uq) {5258 if (attr()) {5259 var vals = attr();5260 var val;5261 val = vals["autoPage"];5262 if (undefined !== val) {5263 this.autoPage = getBoolFromXml(val);5264 }5265 }5266};5267CT_Consolidation.prototype.onStartNode = function(elem, attr, uq) {5268 var newContext = this;5269 if ("pages" === elem) {5270 newContext = new CT_Pages();5271 if (newContext.readAttributes) {5272 newContext.readAttributes(attr, uq);5273 }5274 this.pages = newContext;5275 } else if ("rangeSets" === elem) {5276 newContext = new CT_RangeSets();5277 if (newContext.readAttributes) {5278 newContext.readAttributes(attr, uq);5279 }5280 this.rangeSets = newContext;5281 } else {5282 newContext = null;5283 }5284 return newContext;5285};5286CT_Consolidation.prototype.toXml = function(writer, name) {5287 writer.WriteXmlNodeStart(name);5288 if (null !== this.autoPage) {5289 writer.WriteXmlAttributeBool("autoPage", this.autoPage);5290 }5291 writer.WriteXmlNodeEnd(name, true);5292 if (null !== this.pages) {5293 this.pages.toXml(writer, "pages");5294 }5295 if (null !== this.rangeSets) {5296 this.rangeSets.toXml(writer, "rangeSets");5297 }5298 writer.WriteXmlNodeEnd(name);5299};5300function CT_WorksheetSource() {5301//Attributes5302 this.ref = null;5303 this.name = null;5304 this.sheet = null;5305 this.id = null;5306//Private5307 this.formula = null;5308}5309CT_WorksheetSource.prototype.onFormulaEvent = function (type, eventData) {5310 if (AscCommon.c_oNotifyParentType.CanDo === type) {5311 return true;5312 } else if (AscCommon.c_oNotifyParentType.ChangeFormula === type) {5313 // ToDo update formula with eventData.assemble;5314 }5315};5316CT_WorksheetSource.prototype.readAttributes = function(attr, uq) {5317 if (attr()) {5318 var vals = attr();5319 var val;5320 val = vals["ref"];5321 if (undefined !== val) {5322 this.ref = uq(val);5323 }5324 val = vals["name"];5325 if (undefined !== val) {5326 this.name = uq(val);5327 }5328 val = vals["sheet"];5329 if (undefined !== val) {5330 this.sheet = uq(val);5331 }5332 val = vals["r:id"];5333 if (undefined !== val) {5334 this.id = uq(val);5335 }5336 var text;5337 if (this.name) {5338 text = this.name;5339 } else if (this.ref && this.sheet) {5340 text = AscCommon.parserHelp.get3DRef(this.sheet, this.ref);5341 }5342 if (text) {5343 this.formula = new AscCommonExcel.parserFormula(text, this, AscCommonExcel.g_DefNameWorksheet);5344 this.formula.parse();5345 this.formula.buildDependencies();5346 }5347 }5348};5349CT_WorksheetSource.prototype.toXml = function(writer, name) {5350 writer.WriteXmlNodeStart(name);5351 if (null !== this.ref) {5352 writer.WriteXmlAttributeStringEncode("ref", this.ref);5353 }5354 if (null !== this.name) {5355 writer.WriteXmlAttributeStringEncode("name", this.name);5356 }5357 if (null !== this.sheet) {5358 writer.WriteXmlAttributeStringEncode("sheet", this.sheet);5359 }5360 //todo5361 // if (null !== this.id) {5362 // writer.WriteXmlAttributeStringEncode("r:id", this.id);5363 // }5364 writer.WriteXmlNodeEnd(name, true, true);5365};5366function CT_CacheField() {5367//Attributes5368 this.name = null;5369 this.caption = null;5370 this.propertyName = null;5371 this.serverField = null;//false5372 this.uniqueList = null;//true5373 this.numFmtId = null;5374 this.formula = null;5375 this.sqlType = null;//05376 this.hierarchy = null;//05377 this.level = null;//05378 this.databaseField = null;//true5379 this.mappingCount = null;5380 this.memberPropertyField = null;//false5381//Members5382 this.sharedItems = null;5383 this.fieldGroup = null;5384 this.mpMap = [];5385 this.extLst = null;5386}5387CT_CacheField.prototype.readAttributes = function(attr, uq) {5388 if (attr()) {5389 var vals = attr();5390 var val;5391 val = vals["name"];5392 if (undefined !== val) {5393 this.name = uq(val);5394 }5395 val = vals["caption"];5396 if (undefined !== val) {5397 this.caption = uq(val);5398 }5399 val = vals["propertyName"];5400 if (undefined !== val) {5401 this.propertyName = uq(val);5402 }5403 val = vals["serverField"];5404 if (undefined !== val) {5405 this.serverField = getBoolFromXml(val);5406 }5407 val = vals["uniqueList"];5408 if (undefined !== val) {5409 this.uniqueList = getBoolFromXml(val);5410 }5411 val = vals["numFmtId"];5412 if (undefined !== val) {5413 this.numFmtId = val - 0;5414 }5415 val = vals["formula"];5416 if (undefined !== val) {5417 this.formula = uq(val);5418 }5419 val = vals["sqlType"];5420 if (undefined !== val) {5421 this.sqlType = val - 0;5422 }5423 val = vals["hierarchy"];5424 if (undefined !== val) {5425 this.hierarchy = val - 0;5426 }5427 val = vals["level"];5428 if (undefined !== val) {5429 this.level = val - 0;5430 }5431 val = vals["databaseField"];5432 if (undefined !== val) {5433 this.databaseField = getBoolFromXml(val);5434 }5435 val = vals["mappingCount"];5436 if (undefined !== val) {5437 this.mappingCount = val - 0;5438 }5439 val = vals["memberPropertyField"];5440 if (undefined !== val) {5441 this.memberPropertyField = getBoolFromXml(val);5442 }5443 }5444};5445CT_CacheField.prototype.onStartNode = function(elem, attr, uq) {5446 var newContext = this;5447 if ("sharedItems" === elem) {5448 newContext = new CT_SharedItems();5449 if (newContext.readAttributes) {5450 newContext.readAttributes(attr, uq);5451 }5452 this.sharedItems = newContext;5453 } else if ("fieldGroup" === elem) {5454 newContext = new CT_FieldGroup();5455 if (newContext.readAttributes) {5456 newContext.readAttributes(attr, uq);5457 }5458 this.fieldGroup = newContext;5459 } else if ("mpMap" === elem) {5460 newContext = new CT_X();5461 if (newContext.readAttributes) {5462 newContext.readAttributes(attr, uq);5463 }5464 this.mpMap.push(newContext);5465 } else if ("extLst" === elem) {5466 newContext = new CT_ExtensionList();5467 if (newContext.readAttributes) {5468 newContext.readAttributes(attr, uq);5469 }5470 this.extLst = newContext;5471 } else {5472 newContext = null;5473 }5474 return newContext;5475};5476CT_CacheField.prototype.toXml = function(writer, name) {5477 writer.WriteXmlNodeStart(name);5478 if (null !== this.name) {5479 writer.WriteXmlAttributeStringEncode("name", this.name);5480 }5481 if (null !== this.caption) {5482 writer.WriteXmlAttributeStringEncode("caption", this.caption);5483 }5484 if (null !== this.propertyName) {5485 writer.WriteXmlAttributeStringEncode("propertyName", this.propertyName);5486 }5487 if (null !== this.serverField) {5488 writer.WriteXmlAttributeBool("serverField", this.serverField);5489 }5490 if (null !== this.uniqueList) {5491 writer.WriteXmlAttributeBool("uniqueList", this.uniqueList);5492 }5493 if (null !== this.numFmtId) {5494 writer.WriteXmlAttributeNumber("numFmtId", this.numFmtId);5495 }5496 if (null !== this.formula) {5497 writer.WriteXmlAttributeStringEncode("formula", this.formula);5498 }5499 if (null !== this.sqlType) {5500 writer.WriteXmlAttributeNumber("sqlType", this.sqlType);5501 }5502 if (null !== this.hierarchy) {5503 writer.WriteXmlAttributeNumber("hierarchy", this.hierarchy);5504 }5505 if (null !== this.level) {5506 writer.WriteXmlAttributeNumber("level", this.level);5507 }5508 if (null !== this.databaseField) {5509 writer.WriteXmlAttributeBool("databaseField", this.databaseField);5510 }5511 if (null !== this.mappingCount) {5512 writer.WriteXmlAttributeNumber("mappingCount", this.mappingCount);5513 }5514 if (null !== this.memberPropertyField) {5515 writer.WriteXmlAttributeBool("memberPropertyField", this.memberPropertyField);5516 }5517 writer.WriteXmlNodeEnd(name, true);5518 if (null !== this.sharedItems) {5519 this.sharedItems.toXml(writer, "sharedItems");5520 }5521 if (null !== this.fieldGroup) {5522 this.fieldGroup.toXml(writer, "fieldGroup");5523 }5524 for (var i = 0; i < this.mpMap.length; ++i) {5525 var elem = this.mpMap[i];5526 elem.toXml(writer, "mpMap");5527 }5528 if (null !== this.extLst) {5529 this.extLst.toXml(writer, "extLst");5530 }5531 writer.WriteXmlNodeEnd(name);5532};5533CT_CacheField.prototype.asc_getName = function () {5534 return this.name;5535};5536CT_CacheField.prototype.getSharedItem = function (index) {5537 return this.sharedItems && this.sharedItems.Items.get(index);5538};5539function CT_CacheHierarchy() {5540//Attributes5541 this.uniqueName = null;5542 this.caption = null;5543 this.measure = null;//false5544 this.set = null;//false5545 this.parentSet = null;5546 this.iconSet = null;//05547 this.attribute = null;//false5548 this.time = null;//false5549 this.keyAttribute = null;//false5550 this.defaultMemberUniqueName = null;5551 this.allUniqueName = null;5552 this.allCaption = null;5553 this.dimensionUniqueName = null;5554 this.displayFolder = null;5555 this.measureGroup = null;5556 this.measures = null;//false5557 this.count = null;5558 this.oneField = null;//false5559 this.memberValueDatatype = null;5560 this.unbalanced = null;5561 this.unbalancedGroup = null;5562 this.hidden = null;//false5563//Members5564 this.fieldsUsage = null;5565 this.groupLevels = null;5566 this.extLst = null;5567}5568CT_CacheHierarchy.prototype.readAttributes = function(attr, uq) {5569 if (attr()) {5570 var vals = attr();5571 var val;5572 val = vals["uniqueName"];5573 if (undefined !== val) {5574 this.uniqueName = uq(val);5575 }5576 val = vals["caption"];5577 if (undefined !== val) {5578 this.caption = uq(val);5579 }5580 val = vals["measure"];5581 if (undefined !== val) {5582 this.measure = getBoolFromXml(val);5583 }5584 val = vals["set"];5585 if (undefined !== val) {5586 this.set = getBoolFromXml(val);5587 }5588 val = vals["parentSet"];5589 if (undefined !== val) {5590 this.parentSet = val - 0;5591 }5592 val = vals["iconSet"];5593 if (undefined !== val) {5594 this.iconSet = val - 0;5595 }5596 val = vals["attribute"];5597 if (undefined !== val) {5598 this.attribute = getBoolFromXml(val);5599 }5600 val = vals["time"];5601 if (undefined !== val) {5602 this.time = getBoolFromXml(val);5603 }5604 val = vals["keyAttribute"];5605 if (undefined !== val) {5606 this.keyAttribute = getBoolFromXml(val);5607 }5608 val = vals["defaultMemberUniqueName"];5609 if (undefined !== val) {5610 this.defaultMemberUniqueName = uq(val);5611 }5612 val = vals["allUniqueName"];5613 if (undefined !== val) {5614 this.allUniqueName = uq(val);5615 }5616 val = vals["allCaption"];5617 if (undefined !== val) {5618 this.allCaption = uq(val);5619 }5620 val = vals["dimensionUniqueName"];5621 if (undefined !== val) {5622 this.dimensionUniqueName = uq(val);5623 }5624 val = vals["displayFolder"];5625 if (undefined !== val) {5626 this.displayFolder = uq(val);5627 }5628 val = vals["measureGroup"];5629 if (undefined !== val) {5630 this.measureGroup = uq(val);5631 }5632 val = vals["measures"];5633 if (undefined !== val) {5634 this.measures = getBoolFromXml(val);5635 }5636 val = vals["count"];5637 if (undefined !== val) {5638 this.count = val - 0;5639 }5640 val = vals["oneField"];5641 if (undefined !== val) {5642 this.oneField = getBoolFromXml(val);5643 }5644 val = vals["memberValueDatatype"];5645 if (undefined !== val) {5646 this.memberValueDatatype = val - 0;5647 }5648 val = vals["unbalanced"];5649 if (undefined !== val) {5650 this.unbalanced = getBoolFromXml(val);5651 }5652 val = vals["unbalancedGroup"];5653 if (undefined !== val) {5654 this.unbalancedGroup = getBoolFromXml(val);5655 }5656 val = vals["hidden"];5657 if (undefined !== val) {5658 this.hidden = getBoolFromXml(val);5659 }5660 }5661};5662CT_CacheHierarchy.prototype.onStartNode = function(elem, attr, uq) {5663 var newContext = this;5664 if ("fieldsUsage" === elem) {5665 newContext = new CT_FieldsUsage();5666 if (newContext.readAttributes) {5667 newContext.readAttributes(attr, uq);5668 }5669 this.fieldsUsage = newContext;5670 } else if ("groupLevels" === elem) {5671 newContext = new CT_GroupLevels();5672 if (newContext.readAttributes) {5673 newContext.readAttributes(attr, uq);5674 }5675 this.groupLevels = newContext;5676 } else if ("extLst" === elem) {5677 newContext = new CT_ExtensionList();5678 if (newContext.readAttributes) {5679 newContext.readAttributes(attr, uq);5680 }5681 this.extLst = newContext;5682 } else {5683 newContext = null;5684 }5685 return newContext;5686};5687CT_CacheHierarchy.prototype.toXml = function(writer, name) {5688 writer.WriteXmlNodeStart(name);5689 if (null !== this.uniqueName) {5690 writer.WriteXmlAttributeStringEncode("uniqueName", this.uniqueName);5691 }5692 if (null !== this.caption) {5693 writer.WriteXmlAttributeStringEncode("caption", this.caption);5694 }5695 if (null !== this.measure) {5696 writer.WriteXmlAttributeBool("measure", this.measure);5697 }5698 if (null !== this.set) {5699 writer.WriteXmlAttributeBool("set", this.set);5700 }5701 if (null !== this.parentSet) {5702 writer.WriteXmlAttributeNumber("parentSet", this.parentSet);5703 }5704 if (null !== this.iconSet) {5705 writer.WriteXmlAttributeNumber("iconSet", this.iconSet);5706 }5707 if (null !== this.attribute) {5708 writer.WriteXmlAttributeBool("attribute", this.attribute);5709 }5710 if (null !== this.time) {5711 writer.WriteXmlAttributeBool("time", this.time);5712 }5713 if (null !== this.keyAttribute) {5714 writer.WriteXmlAttributeBool("keyAttribute", this.keyAttribute);5715 }5716 if (null !== this.defaultMemberUniqueName) {5717 writer.WriteXmlAttributeStringEncode("defaultMemberUniqueName", this.defaultMemberUniqueName);5718 }5719 if (null !== this.allUniqueName) {5720 writer.WriteXmlAttributeStringEncode("allUniqueName", this.allUniqueName);5721 }5722 if (null !== this.allCaption) {5723 writer.WriteXmlAttributeStringEncode("allCaption", this.allCaption);5724 }5725 if (null !== this.dimensionUniqueName) {5726 writer.WriteXmlAttributeStringEncode("dimensionUniqueName", this.dimensionUniqueName);5727 }5728 if (null !== this.displayFolder) {5729 writer.WriteXmlAttributeStringEncode("displayFolder", this.displayFolder);5730 }5731 if (null !== this.measureGroup) {5732 writer.WriteXmlAttributeStringEncode("measureGroup", this.measureGroup);5733 }5734 if (null !== this.measures) {5735 writer.WriteXmlAttributeBool("measures", this.measures);5736 }5737 if (null !== this.count) {5738 writer.WriteXmlAttributeNumber("count", this.count);5739 }5740 if (null !== this.oneField) {5741 writer.WriteXmlAttributeBool("oneField", this.oneField);5742 }5743 if (null !== this.memberValueDatatype) {5744 writer.WriteXmlAttributeNumber("memberValueDatatype", this.memberValueDatatype);5745 }5746 if (null !== this.unbalanced) {5747 writer.WriteXmlAttributeBool("unbalanced", this.unbalanced);5748 }5749 if (null !== this.unbalancedGroup) {5750 writer.WriteXmlAttributeBool("unbalancedGroup", this.unbalancedGroup);5751 }5752 if (null !== this.hidden) {5753 writer.WriteXmlAttributeBool("hidden", this.hidden);5754 }5755 writer.WriteXmlNodeEnd(name, true);5756 if (null !== this.fieldsUsage) {5757 this.fieldsUsage.toXml(writer, "fieldsUsage");5758 }5759 if (null !== this.groupLevels) {5760 this.groupLevels.toXml(writer, "groupLevels");5761 }5762 if (null !== this.extLst) {5763 this.extLst.toXml(writer, "extLst");5764 }5765 writer.WriteXmlNodeEnd(name);5766};5767function CT_PCDKPI() {5768//Attributes5769 this.uniqueName = null;5770 this.caption = null;5771 this.displayFolder = null;5772 this.measureGroup = null;5773 this.parent = null;5774 this.value = null;5775 this.goal = null;5776 this.status = null;5777 this.trend = null;5778 this.weight = null;5779 this.time = null;5780}5781CT_PCDKPI.prototype.readAttributes = function(attr, uq) {5782 if (attr()) {5783 var vals = attr();5784 var val;5785 val = vals["uniqueName"];5786 if (undefined !== val) {5787 this.uniqueName = uq(val);5788 }5789 val = vals["caption"];5790 if (undefined !== val) {5791 this.caption = uq(val);5792 }5793 val = vals["displayFolder"];5794 if (undefined !== val) {5795 this.displayFolder = uq(val);5796 }5797 val = vals["measureGroup"];5798 if (undefined !== val) {5799 this.measureGroup = uq(val);5800 }5801 val = vals["parent"];5802 if (undefined !== val) {5803 this.parent = uq(val);5804 }5805 val = vals["value"];5806 if (undefined !== val) {5807 this.value = uq(val);5808 }5809 val = vals["goal"];5810 if (undefined !== val) {5811 this.goal = uq(val);5812 }5813 val = vals["status"];5814 if (undefined !== val) {5815 this.status = uq(val);5816 }5817 val = vals["trend"];5818 if (undefined !== val) {5819 this.trend = uq(val);5820 }5821 val = vals["weight"];5822 if (undefined !== val) {5823 this.weight = uq(val);5824 }5825 val = vals["time"];5826 if (undefined !== val) {5827 this.time = uq(val);5828 }5829 }5830};5831CT_PCDKPI.prototype.toXml = function(writer, name) {5832 writer.WriteXmlNodeStart(name);5833 if (null !== this.uniqueName) {5834 writer.WriteXmlAttributeStringEncode("uniqueName", this.uniqueName);5835 }5836 if (null !== this.caption) {5837 writer.WriteXmlAttributeStringEncode("caption", this.caption);5838 }5839 if (null !== this.displayFolder) {5840 writer.WriteXmlAttributeStringEncode("displayFolder", this.displayFolder);5841 }5842 if (null !== this.measureGroup) {5843 writer.WriteXmlAttributeStringEncode("measureGroup", this.measureGroup);5844 }5845 if (null !== this.parent) {5846 writer.WriteXmlAttributeStringEncode("parent", this.parent);5847 }5848 if (null !== this.value) {5849 writer.WriteXmlAttributeStringEncode("value", this.value);5850 }5851 if (null !== this.goal) {5852 writer.WriteXmlAttributeStringEncode("goal", this.goal);5853 }5854 if (null !== this.status) {5855 writer.WriteXmlAttributeStringEncode("status", this.status);5856 }5857 if (null !== this.trend) {5858 writer.WriteXmlAttributeStringEncode("trend", this.trend);5859 }5860 if (null !== this.weight) {5861 writer.WriteXmlAttributeStringEncode("weight", this.weight);5862 }5863 if (null !== this.time) {5864 writer.WriteXmlAttributeStringEncode("time", this.time);5865 }5866 writer.WriteXmlNodeEnd(name, true, true);5867};5868function CT_PCDSDTCEntries() {5869//Attributes5870 this.count = null;5871//Members5872 this.Items = [];5873}5874CT_PCDSDTCEntries.prototype.readAttributes = function(attr, uq) {5875 if (attr()) {5876 var vals = attr();5877 var val;5878 val = vals["count"];5879 if (undefined !== val) {5880 this.count = val - 0;5881 }5882 }5883};5884CT_PCDSDTCEntries.prototype.onStartNode = function(elem, attr, uq) {5885 var newContext = this;5886 if ("e" === elem) {5887 newContext = new CT_Error();5888 if (newContext.readAttributes) {5889 newContext.readAttributes(attr, uq);5890 }5891 this.Items.push(newContext);5892 } else if ("m" === elem) {5893 newContext = new CT_Missing();5894 if (newContext.readAttributes) {5895 newContext.readAttributes(attr, uq);5896 }5897 this.Items.push(newContext);5898 } else if ("n" === elem) {5899 newContext = new CT_Number();5900 if (newContext.readAttributes) {5901 newContext.readAttributes(attr, uq);5902 }5903 this.Items.push(newContext);5904 } else if ("s" === elem) {5905 newContext = new CT_String();5906 if (newContext.readAttributes) {5907 newContext.readAttributes(attr, uq);5908 }5909 this.Items.push(newContext);5910 } else {5911 newContext = null;5912 }5913 return newContext;5914};5915CT_PCDSDTCEntries.prototype.toXml = function(writer, name) {5916 writer.WriteXmlNodeStart(name);5917 if (null !== this.count) {5918 writer.WriteXmlAttributeNumber("count", this.count);5919 }5920 writer.WriteXmlNodeEnd(name, true);5921 for (var i = 0; i < this.Items.length; ++i) {5922 var elem = this.Items[i];5923 if (elem instanceof CT_Error) {5924 elem.toXml(writer, "e");5925 } else if (elem instanceof CT_Missing) {5926 elem.toXml(writer, "m");5927 } else if (elem instanceof CT_Number) {5928 elem.toXml(writer, "n");5929 } else if (elem instanceof CT_String) {5930 elem.toXml(writer, "s");5931 }5932 }5933 writer.WriteXmlNodeEnd(name);5934};5935function CT_Sets() {5936//Attributes5937 this.count = null;5938//Members5939 this.set = [];5940}5941CT_Sets.prototype.readAttributes = function(attr, uq) {5942 if (attr()) {5943 var vals = attr();5944 var val;5945 val = vals["count"];5946 if (undefined !== val) {5947 this.count = val - 0;5948 }5949 }5950};5951CT_Sets.prototype.onStartNode = function(elem, attr, uq) {5952 var newContext = this;5953 if ("set" === elem) {5954 newContext = new CT_Set();5955 if (newContext.readAttributes) {5956 newContext.readAttributes(attr, uq);5957 }5958 this.set.push(newContext);5959 } else {5960 newContext = null;5961 }5962 return newContext;5963};5964CT_Sets.prototype.toXml = function(writer, name) {5965 writer.WriteXmlNodeStart(name);5966 if (null !== this.count) {5967 writer.WriteXmlAttributeNumber("count", this.count);5968 }5969 writer.WriteXmlNodeEnd(name, true);5970 for (var i = 0; i < this.set.length; ++i) {5971 var elem = this.set[i];5972 elem.toXml(writer, "set");5973 }5974 writer.WriteXmlNodeEnd(name);5975};5976function CT_QueryCache() {5977//Attributes5978 this.count = null;5979//Members5980 this.query = [];5981}5982CT_QueryCache.prototype.readAttributes = function(attr, uq) {5983 if (attr()) {5984 var vals = attr();5985 var val;5986 val = vals["count"];5987 if (undefined !== val) {5988 this.count = val - 0;5989 }5990 }5991};5992CT_QueryCache.prototype.onStartNode = function(elem, attr, uq) {5993 var newContext = this;5994 if ("query" === elem) {5995 newContext = new CT_Query();5996 if (newContext.readAttributes) {5997 newContext.readAttributes(attr, uq);5998 }5999 this.query.push(newContext);6000 } else {6001 newContext = null;6002 }6003 return newContext;6004};6005CT_QueryCache.prototype.toXml = function(writer, name) {6006 writer.WriteXmlNodeStart(name);6007 if (null !== this.count) {6008 writer.WriteXmlAttributeNumber("count", this.count);6009 }6010 writer.WriteXmlNodeEnd(name, true);6011 for (var i = 0; i < this.query.length; ++i) {6012 var elem = this.query[i];6013 elem.toXml(writer, "query");6014 }6015 writer.WriteXmlNodeEnd(name);6016};6017function CT_ServerFormats() {6018//Attributes6019 this.count = null;6020//Members6021 this.serverFormat = [];6022}6023CT_ServerFormats.prototype.readAttributes = function(attr, uq) {6024 if (attr()) {6025 var vals = attr();6026 var val;6027 val = vals["count"];6028 if (undefined !== val) {6029 this.count = val - 0;6030 }6031 }6032};6033CT_ServerFormats.prototype.onStartNode = function(elem, attr, uq) {6034 var newContext = this;6035 if ("serverFormat" === elem) {6036 newContext = new CT_ServerFormat();6037 if (newContext.readAttributes) {6038 newContext.readAttributes(attr, uq);6039 }6040 this.serverFormat.push(newContext);6041 } else {6042 newContext = null;6043 }6044 return newContext;6045};6046CT_ServerFormats.prototype.toXml = function(writer, name) {6047 writer.WriteXmlNodeStart(name);6048 if (null !== this.count) {6049 writer.WriteXmlAttributeNumber("count", this.count);6050 }6051 writer.WriteXmlNodeEnd(name, true);6052 for (var i = 0; i < this.serverFormat.length; ++i) {6053 var elem = this.serverFormat[i];6054 elem.toXml(writer, "serverFormat");6055 }6056 writer.WriteXmlNodeEnd(name);6057};6058function CT_CalculatedItem() {6059//Attributes6060 this.field = null;6061 this.formula = null;6062//Members6063 this.pivotArea = null;6064 this.extLst = null;6065}6066CT_CalculatedItem.prototype.readAttributes = function(attr, uq) {6067 if (attr()) {6068 var vals = attr();6069 var val;6070 val = vals["field"];6071 if (undefined !== val) {6072 this.field = val - 0;6073 }6074 val = vals["formula"];6075 if (undefined !== val) {6076 this.formula = uq(val);6077 }6078 }6079};6080CT_CalculatedItem.prototype.onStartNode = function(elem, attr, uq) {6081 var newContext = this;6082 if ("pivotArea" === elem) {6083 newContext = new CT_PivotArea();6084 if (newContext.readAttributes) {6085 newContext.readAttributes(attr, uq);6086 }6087 this.pivotArea = newContext;6088 } else if ("extLst" === elem) {6089 newContext = new CT_ExtensionList();6090 if (newContext.readAttributes) {6091 newContext.readAttributes(attr, uq);6092 }6093 this.extLst = newContext;6094 } else {6095 newContext = null;6096 }6097 return newContext;6098};6099CT_CalculatedItem.prototype.toXml = function(writer, name) {6100 writer.WriteXmlNodeStart(name);6101 if (null !== this.field) {6102 writer.WriteXmlAttributeNumber("field", this.field);6103 }6104 if (null !== this.formula) {6105 writer.WriteXmlAttributeStringEncode("formula", this.formula);6106 }6107 writer.WriteXmlNodeEnd(name, true);6108 if (null !== this.pivotArea) {6109 this.pivotArea.toXml(writer, "pivotArea");6110 }6111 if (null !== this.extLst) {6112 this.extLst.toXml(writer, "extLst");6113 }6114 writer.WriteXmlNodeEnd(name);6115};6116function CT_CalculatedMember() {6117//Attributes6118 this.name = null;6119 this.mdx = null;6120 this.memberName = null;6121 this.hierarchy = null;6122 this.parent = null;6123 this.solveOrder = null;//06124 this.set = null;//false6125//Members6126 this.extLst = null;6127}6128CT_CalculatedMember.prototype.readAttributes = function(attr, uq) {6129 if (attr()) {6130 var vals = attr();6131 var val;6132 val = vals["name"];6133 if (undefined !== val) {6134 this.name = uq(val);6135 }6136 val = vals["mdx"];6137 if (undefined !== val) {6138 this.mdx = uq(val);6139 }6140 val = vals["memberName"];6141 if (undefined !== val) {6142 this.memberName = uq(val);6143 }6144 val = vals["hierarchy"];6145 if (undefined !== val) {6146 this.hierarchy = uq(val);6147 }6148 val = vals["parent"];6149 if (undefined !== val) {6150 this.parent = uq(val);6151 }6152 val = vals["solveOrder"];6153 if (undefined !== val) {6154 this.solveOrder = val - 0;6155 }6156 val = vals["set"];6157 if (undefined !== val) {6158 this.set = getBoolFromXml(val);6159 }6160 }6161};6162CT_CalculatedMember.prototype.onStartNode = function(elem, attr, uq) {6163 var newContext = this;6164 if ("extLst" === elem) {6165 newContext = new CT_ExtensionList();6166 if (newContext.readAttributes) {6167 newContext.readAttributes(attr, uq);6168 }6169 this.extLst = newContext;6170 } else {6171 newContext = null;6172 }6173 return newContext;6174};6175CT_CalculatedMember.prototype.toXml = function(writer, name) {6176 writer.WriteXmlNodeStart(name);6177 if (null !== this.name) {6178 writer.WriteXmlAttributeStringEncode("name", this.name);6179 }6180 if (null !== this.mdx) {6181 writer.WriteXmlAttributeStringEncode("mdx", this.mdx);6182 }6183 if (null !== this.memberName) {6184 writer.WriteXmlAttributeStringEncode("memberName", this.memberName);6185 }6186 if (null !== this.hierarchy) {6187 writer.WriteXmlAttributeStringEncode("hierarchy", this.hierarchy);6188 }6189 if (null !== this.parent) {6190 writer.WriteXmlAttributeStringEncode("parent", this.parent);6191 }6192 if (null !== this.solveOrder) {6193 writer.WriteXmlAttributeNumber("solveOrder", this.solveOrder);6194 }6195 if (null !== this.set) {6196 writer.WriteXmlAttributeBool("set", this.set);6197 }6198 writer.WriteXmlNodeEnd(name, true);6199 if (null !== this.extLst) {6200 this.extLst.toXml(writer, "extLst");6201 }6202 writer.WriteXmlNodeEnd(name);6203};6204function CT_PivotDimension() {6205//Attributes6206 this.measure = null;//false6207 this.name = null;6208 this.uniqueName = null;6209 this.caption = null;6210}6211CT_PivotDimension.prototype.readAttributes = function(attr, uq) {6212 if (attr()) {6213 var vals = attr();6214 var val;6215 val = vals["measure"];6216 if (undefined !== val) {6217 this.measure = getBoolFromXml(val);6218 }6219 val = vals["name"];6220 if (undefined !== val) {6221 this.name = uq(val);6222 }6223 val = vals["uniqueName"];6224 if (undefined !== val) {6225 this.uniqueName = uq(val);6226 }6227 val = vals["caption"];6228 if (undefined !== val) {6229 this.caption = uq(val);6230 }6231 }6232};6233CT_PivotDimension.prototype.toXml = function(writer, name) {6234 writer.WriteXmlNodeStart(name);6235 if (null !== this.measure) {6236 writer.WriteXmlAttributeBool("measure", this.measure);6237 }6238 if (null !== this.name) {6239 writer.WriteXmlAttributeStringEncode("name", this.name);6240 }6241 if (null !== this.uniqueName) {6242 writer.WriteXmlAttributeStringEncode("uniqueName", this.uniqueName);6243 }6244 if (null !== this.caption) {6245 writer.WriteXmlAttributeStringEncode("caption", this.caption);6246 }6247 writer.WriteXmlNodeEnd(name, true, true);6248};6249function CT_MeasureGroup() {6250//Attributes6251 this.name = null;6252 this.caption = null;6253}6254CT_MeasureGroup.prototype.readAttributes = function(attr, uq) {6255 if (attr()) {6256 var vals = attr();6257 var val;6258 val = vals["name"];6259 if (undefined !== val) {6260 this.name = uq(val);6261 }6262 val = vals["caption"];6263 if (undefined !== val) {6264 this.caption = uq(val);6265 }6266 }6267};6268CT_MeasureGroup.prototype.toXml = function(writer, name) {6269 writer.WriteXmlNodeStart(name);6270 if (null !== this.name) {6271 writer.WriteXmlAttributeStringEncode("name", this.name);6272 }6273 if (null !== this.caption) {6274 writer.WriteXmlAttributeStringEncode("caption", this.caption);6275 }6276 writer.WriteXmlNodeEnd(name, true, true);6277};6278function CT_MeasureDimensionMap() {6279//Attributes6280 this.measureGroup = null;6281 this.dimension = null;6282}6283CT_MeasureDimensionMap.prototype.readAttributes = function(attr, uq) {6284 if (attr()) {6285 var vals = attr();6286 var val;6287 val = vals["measureGroup"];6288 if (undefined !== val) {6289 this.measureGroup = val - 0;6290 }6291 val = vals["dimension"];6292 if (undefined !== val) {6293 this.dimension = val - 0;6294 }6295 }6296};6297CT_MeasureDimensionMap.prototype.toXml = function(writer, name) {6298 writer.WriteXmlNodeStart(name);6299 if (null !== this.measureGroup) {6300 writer.WriteXmlAttributeNumber("measureGroup", this.measureGroup);6301 }6302 if (null !== this.dimension) {6303 writer.WriteXmlAttributeNumber("dimension", this.dimension);6304 }6305 writer.WriteXmlNodeEnd(name, true, true);6306};6307function CT_Extension() {6308//Attributes6309 this.uri = null;6310//Members6311 this.elem = null;6312}6313CT_Extension.prototype.readAttributes = function(attr, uq) {6314 if (attr()) {6315 var vals = attr();6316 var val;6317 val = vals["uri"];6318 if (undefined !== val) {6319 this.uri = uq(val);6320 }6321 }6322};6323CT_Extension.prototype.onStartNode = function(elem, attr, uq) {6324 var newContext = this;6325 if ("x14:pivotTableDefinition" === elem) {6326 newContext = new CT_pivotTableDefinitionX14();6327 if (newContext.readAttributes) {6328 newContext.readAttributes(attr, uq);6329 }6330 this.elem = newContext;6331 } else {6332 newContext = null;6333 }6334 return newContext;6335};6336CT_Extension.prototype.toXml = function(writer, name) {6337 if ("{962EF5D1-5CA2-4c93-8EF4-DBF5C05439D2}" === this.uri && this.elem) {6338 writer.WriteXmlNodeStart(name);6339 if (null !== this.uri) {6340 writer.WriteXmlAttributeStringEncode("uri", this.uri);6341 writer.WriteXmlString(" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\"");6342 }6343 writer.WriteXmlNodeEnd(name, true);6344 this.elem.toXml(writer, "x14:pivotTableDefinition");6345 writer.WriteXmlNodeEnd(name);6346 }6347};6348function CT_X() {6349//Attributes6350 this.v = null;//06351}6352CT_X.prototype.readAttributes = function(attr, uq) {6353 if (attr()) {6354 var vals = attr();6355 var val;6356 val = vals["v"];6357 if (undefined !== val) {6358 this.v = val - 0;6359 }6360 }6361};6362CT_X.prototype.toXml = function(writer, name) {6363 writer.WriteXmlNodeStart(name);6364 if (null !== this.v) {6365 writer.WriteXmlAttributeNumber("v", this.v);6366 }6367 writer.WriteXmlNodeEnd(name, true, true);6368};6369CT_X.prototype.getV = function () {6370 return this.v || 0;6371};6372function CT_Tuples() {6373//Attributes6374 this.c = null;6375//Members6376 this.tpl = [];6377}6378CT_Tuples.prototype.readAttributes = function(attr, uq) {6379 if (attr()) {6380 var vals = attr();6381 var val;6382 val = vals["c"];6383 if (undefined !== val) {6384 this.c = val - 0;6385 }6386 }6387};6388CT_Tuples.prototype.onStartNode = function(elem, attr, uq) {6389 var newContext = this;6390 if ("tpl" === elem) {6391 newContext = new CT_Tuple();6392 if (newContext.readAttributes) {6393 newContext.readAttributes(attr, uq);6394 }6395 this.tpl.push(newContext);6396 } else {6397 newContext = null;6398 }6399 return newContext;6400};6401CT_Tuples.prototype.toXml = function(writer, name) {6402 writer.WriteXmlNodeStart(name);6403 if (null !== this.c) {6404 writer.WriteXmlAttributeNumber("c", this.c);6405 }6406 writer.WriteXmlNodeEnd(name, true);6407 for (var i = 0; i < this.tpl.length; ++i) {6408 var elem = this.tpl[i];6409 elem.toXml(writer, "tpl");6410 }6411 writer.WriteXmlNodeEnd(name);6412};6413function CT_PivotField() {6414//Attributes6415 this.name = null;6416 this.axis = null;6417 this.dataField = null;//false6418 this.subtotalCaption = null;6419 this.showDropDowns = null;//true6420 this.hiddenLevel = null;//false6421 this.uniqueMemberProperty = null;6422 this.compact = null;//true6423 this.allDrilled = null;//false6424 this.numFmtId = null;6425 this.outline = null;//true6426 this.subtotalTop = null;//true6427 this.dragToRow = null;//true6428 this.dragToCol = null;//true6429 this.multipleItemSelectionAllowed = null;//false6430 this.dragToPage = null;//true6431 this.dragToData = null;//true6432 this.dragOff = null;//true6433 this.showAll = null;//true6434 this.insertBlankRow = null;//false6435 this.serverField = null;//false6436 this.insertPageBreak = null;//false6437 this.autoShow = null;//false6438 this.topAutoShow = null;//true6439 this.hideNewItems = null;//false6440 this.measureFilter = null;//false6441 this.includeNewItemsInFilter = null;//false6442 this.itemPageCount = null;//106443 this.sortType = null;//manual6444 this.dataSourceSort = null;6445 this.nonAutoSortDefault = null;//false6446 this.rankBy = null;6447 this.defaultSubtotal = null;//true6448 this.sumSubtotal = null;//false6449 this.countASubtotal = null;//false6450 this.avgSubtotal = null;//false6451 this.maxSubtotal = null;//false6452 this.minSubtotal = null;//false6453 this.productSubtotal = null;//false6454 this.countSubtotal = null;//false6455 this.stdDevSubtotal = null;//false6456 this.stdDevPSubtotal = null;//false6457 this.varSubtotal = null;//false6458 this.varPSubtotal = null;//false6459 this.showPropCell = null;//false6460 this.showPropTip = null;//false6461 this.showPropAsCaption = null;//false6462 this.defaultAttributeDrillState = null;//false6463//Members6464 this.items = null;6465 this.autoSortScope = null;6466 this.extLst = null;6467}6468CT_PivotField.prototype.readAttributes = function(attr, uq) {6469 if (attr()) {6470 var vals = attr();6471 var val;6472 val = vals["name"];6473 if (undefined !== val) {6474 this.name = uq(val);6475 }6476 val = vals["axis"];6477 if (undefined !== val) {6478 val = FromXml_ST_Axis(val);6479 if (-1 !== val) {6480 this.axis = val;6481 }6482 }6483 val = vals["dataField"];6484 if (undefined !== val) {6485 this.dataField = getBoolFromXml(val);6486 }6487 val = vals["subtotalCaption"];6488 if (undefined !== val) {6489 this.subtotalCaption = uq(val);6490 }6491 val = vals["showDropDowns"];6492 if (undefined !== val) {6493 this.showDropDowns = getBoolFromXml(val);6494 }6495 val = vals["hiddenLevel"];6496 if (undefined !== val) {6497 this.hiddenLevel = getBoolFromXml(val);6498 }6499 val = vals["uniqueMemberProperty"];6500 if (undefined !== val) {6501 this.uniqueMemberProperty = uq(val);6502 }6503 val = vals["compact"];6504 if (undefined !== val) {6505 this.compact = getBoolFromXml(val);6506 }6507 val = vals["allDrilled"];6508 if (undefined !== val) {6509 this.allDrilled = getBoolFromXml(val);6510 }6511 val = vals["numFmtId"];6512 if (undefined !== val) {6513 this.numFmtId = val - 0;6514 }6515 val = vals["outline"];6516 if (undefined !== val) {6517 this.outline = getBoolFromXml(val);6518 }6519 val = vals["subtotalTop"];6520 if (undefined !== val) {6521 this.subtotalTop = getBoolFromXml(val);6522 }6523 val = vals["dragToRow"];6524 if (undefined !== val) {6525 this.dragToRow = getBoolFromXml(val);6526 }6527 val = vals["dragToCol"];6528 if (undefined !== val) {6529 this.dragToCol = getBoolFromXml(val);6530 }6531 val = vals["multipleItemSelectionAllowed"];6532 if (undefined !== val) {6533 this.multipleItemSelectionAllowed = getBoolFromXml(val);6534 }6535 val = vals["dragToPage"];6536 if (undefined !== val) {6537 this.dragToPage = getBoolFromXml(val);6538 }6539 val = vals["dragToData"];6540 if (undefined !== val) {6541 this.dragToData = getBoolFromXml(val);6542 }6543 val = vals["dragOff"];6544 if (undefined !== val) {6545 this.dragOff = getBoolFromXml(val);6546 }6547 val = vals["showAll"];6548 if (undefined !== val) {6549 this.showAll = getBoolFromXml(val);6550 }6551 val = vals["insertBlankRow"];6552 if (undefined !== val) {6553 this.insertBlankRow = getBoolFromXml(val);6554 }6555 val = vals["serverField"];6556 if (undefined !== val) {6557 this.serverField = getBoolFromXml(val);6558 }6559 val = vals["insertPageBreak"];6560 if (undefined !== val) {6561 this.insertPageBreak = getBoolFromXml(val);6562 }6563 val = vals["autoShow"];6564 if (undefined !== val) {6565 this.autoShow = getBoolFromXml(val);6566 }6567 val = vals["topAutoShow"];6568 if (undefined !== val) {6569 this.topAutoShow = getBoolFromXml(val);6570 }6571 val = vals["hideNewItems"];6572 if (undefined !== val) {6573 this.hideNewItems = getBoolFromXml(val);6574 }6575 val = vals["measureFilter"];6576 if (undefined !== val) {6577 this.measureFilter = getBoolFromXml(val);6578 }6579 val = vals["includeNewItemsInFilter"];6580 if (undefined !== val) {6581 this.includeNewItemsInFilter = getBoolFromXml(val);6582 }6583 val = vals["itemPageCount"];6584 if (undefined !== val) {6585 this.itemPageCount = val - 0;6586 }6587 val = vals["sortType"];6588 if (undefined !== val) {6589 val = FromXml_ST_FieldSortType(val);6590 if (-1 !== val) {6591 this.sortType = val;6592 }6593 }6594 val = vals["dataSourceSort"];6595 if (undefined !== val) {6596 this.dataSourceSort = getBoolFromXml(val);6597 }6598 val = vals["nonAutoSortDefault"];6599 if (undefined !== val) {6600 this.nonAutoSortDefault = getBoolFromXml(val);6601 }6602 val = vals["rankBy"];6603 if (undefined !== val) {6604 this.rankBy = val - 0;6605 }6606 val = vals["defaultSubtotal"];6607 if (undefined !== val) {6608 this.defaultSubtotal = getBoolFromXml(val);6609 }6610 val = vals["sumSubtotal"];6611 if (undefined !== val) {6612 this.sumSubtotal = getBoolFromXml(val);6613 }6614 val = vals["countASubtotal"];6615 if (undefined !== val) {6616 this.countASubtotal = getBoolFromXml(val);6617 }6618 val = vals["avgSubtotal"];6619 if (undefined !== val) {6620 this.avgSubtotal = getBoolFromXml(val);6621 }6622 val = vals["maxSubtotal"];6623 if (undefined !== val) {6624 this.maxSubtotal = getBoolFromXml(val);6625 }6626 val = vals["minSubtotal"];6627 if (undefined !== val) {6628 this.minSubtotal = getBoolFromXml(val);6629 }6630 val = vals["productSubtotal"];6631 if (undefined !== val) {6632 this.productSubtotal = getBoolFromXml(val);6633 }6634 val = vals["countSubtotal"];6635 if (undefined !== val) {6636 this.countSubtotal = getBoolFromXml(val);6637 }6638 val = vals["stdDevSubtotal"];6639 if (undefined !== val) {6640 this.stdDevSubtotal = getBoolFromXml(val);6641 }6642 val = vals["stdDevPSubtotal"];6643 if (undefined !== val) {6644 this.stdDevPSubtotal = getBoolFromXml(val);6645 }6646 val = vals["varSubtotal"];6647 if (undefined !== val) {6648 this.varSubtotal = getBoolFromXml(val);6649 }6650 val = vals["varPSubtotal"];6651 if (undefined !== val) {6652 this.varPSubtotal = getBoolFromXml(val);6653 }6654 val = vals["showPropCell"];6655 if (undefined !== val) {6656 this.showPropCell = getBoolFromXml(val);6657 }6658 val = vals["showPropTip"];6659 if (undefined !== val) {6660 this.showPropTip = getBoolFromXml(val);6661 }6662 val = vals["showPropAsCaption"];6663 if (undefined !== val) {6664 this.showPropAsCaption = getBoolFromXml(val);6665 }6666 val = vals["defaultAttributeDrillState"];6667 if (undefined !== val) {6668 this.defaultAttributeDrillState = getBoolFromXml(val);6669 }6670 }6671};6672CT_PivotField.prototype.onStartNode = function(elem, attr, uq) {6673 var newContext = this;6674 if ("items" === elem) {6675 newContext = new CT_Items();6676 if (newContext.readAttributes) {6677 newContext.readAttributes(attr, uq);6678 }6679 this.items = newContext;6680 } else if ("autoSortScope" === elem) {6681 newContext = new CT_AutoSortScope();6682 if (newContext.readAttributes) {6683 newContext.readAttributes(attr, uq);6684 }6685 this.autoSortScope = newContext;6686 } else if ("extLst" === elem) {6687 newContext = new CT_ExtensionList();6688 if (newContext.readAttributes) {6689 newContext.readAttributes(attr, uq);6690 }6691 this.extLst = newContext;6692 } else {6693 newContext = null;6694 }6695 return newContext;6696};6697CT_PivotField.prototype.toXml = function(writer, name) {6698 writer.WriteXmlNodeStart(name);6699 if (null !== this.name) {6700 writer.WriteXmlAttributeStringEncode("name", this.name);6701 }6702 if (null !== this.axis) {6703 writer.WriteXmlAttributeStringEncode("axis", ToXml_ST_Axis(this.axis));6704 }6705 if (null !== this.dataField) {6706 writer.WriteXmlAttributeBool("dataField", this.dataField);6707 }6708 if (null !== this.subtotalCaption) {6709 writer.WriteXmlAttributeStringEncode("subtotalCaption", this.subtotalCaption);6710 }6711 if (null !== this.showDropDowns) {6712 writer.WriteXmlAttributeBool("showDropDowns", this.showDropDowns);6713 }6714 if (null !== this.hiddenLevel) {6715 writer.WriteXmlAttributeBool("hiddenLevel", this.hiddenLevel);6716 }6717 if (null !== this.uniqueMemberProperty) {6718 writer.WriteXmlAttributeStringEncode("uniqueMemberProperty", this.uniqueMemberProperty);6719 }6720 if (null !== this.compact) {6721 writer.WriteXmlAttributeBool("compact", this.compact);6722 }6723 if (null !== this.allDrilled) {6724 writer.WriteXmlAttributeBool("allDrilled", this.allDrilled);6725 }6726 if (null !== this.numFmtId) {6727 writer.WriteXmlAttributeNumber("numFmtId", this.numFmtId);6728 }6729 if (null !== this.outline) {6730 writer.WriteXmlAttributeBool("outline", this.outline);6731 }6732 if (null !== this.subtotalTop) {6733 writer.WriteXmlAttributeBool("subtotalTop", this.subtotalTop);6734 }6735 if (null !== this.dragToRow) {6736 writer.WriteXmlAttributeBool("dragToRow", this.dragToRow);6737 }6738 if (null !== this.dragToCol) {6739 writer.WriteXmlAttributeBool("dragToCol", this.dragToCol);6740 }6741 if (null !== this.multipleItemSelectionAllowed) {6742 writer.WriteXmlAttributeBool("multipleItemSelectionAllowed", this.multipleItemSelectionAllowed);6743 }6744 if (null !== this.dragToPage) {6745 writer.WriteXmlAttributeBool("dragToPage", this.dragToPage);6746 }6747 if (null !== this.dragToData) {6748 writer.WriteXmlAttributeBool("dragToData", this.dragToData);6749 }6750 if (null !== this.dragOff) {6751 writer.WriteXmlAttributeBool("dragOff", this.dragOff);6752 }6753 if (null !== this.showAll) {6754 writer.WriteXmlAttributeBool("showAll", this.showAll);6755 }6756 if (null !== this.insertBlankRow) {6757 writer.WriteXmlAttributeBool("insertBlankRow", this.insertBlankRow);6758 }6759 if (null !== this.serverField) {6760 writer.WriteXmlAttributeBool("serverField", this.serverField);6761 }6762 if (null !== this.insertPageBreak) {6763 writer.WriteXmlAttributeBool("insertPageBreak", this.insertPageBreak);6764 }6765 if (null !== this.autoShow) {6766 writer.WriteXmlAttributeBool("autoShow", this.autoShow);6767 }6768 if (null !== this.topAutoShow) {6769 writer.WriteXmlAttributeBool("topAutoShow", this.topAutoShow);6770 }6771 if (null !== this.hideNewItems) {6772 writer.WriteXmlAttributeBool("hideNewItems", this.hideNewItems);6773 }6774 if (null !== this.measureFilter) {6775 writer.WriteXmlAttributeBool("measureFilter", this.measureFilter);6776 }6777 if (null !== this.includeNewItemsInFilter) {6778 writer.WriteXmlAttributeBool("includeNewItemsInFilter", this.includeNewItemsInFilter);6779 }6780 if (null !== this.itemPageCount) {6781 writer.WriteXmlAttributeNumber("itemPageCount", this.itemPageCount);6782 }6783 if (null !== this.sortType) {6784 writer.WriteXmlAttributeStringEncode("sortType", ToXml_ST_FieldSortType(this.sortType));6785 }6786 if (null !== this.dataSourceSort) {6787 writer.WriteXmlAttributeBool("dataSourceSort", this.dataSourceSort);6788 }6789 if (null !== this.nonAutoSortDefault) {6790 writer.WriteXmlAttributeBool("nonAutoSortDefault", this.nonAutoSortDefault);6791 }6792 if (null !== this.rankBy) {6793 writer.WriteXmlAttributeNumber("rankBy", this.rankBy);6794 }6795 if (null !== this.defaultSubtotal) {6796 writer.WriteXmlAttributeBool("defaultSubtotal", this.defaultSubtotal);6797 }6798 if (null !== this.sumSubtotal) {6799 writer.WriteXmlAttributeBool("sumSubtotal", this.sumSubtotal);6800 }6801 if (null !== this.countASubtotal) {6802 writer.WriteXmlAttributeBool("countASubtotal", this.countASubtotal);6803 }6804 if (null !== this.avgSubtotal) {6805 writer.WriteXmlAttributeBool("avgSubtotal", this.avgSubtotal);6806 }6807 if (null !== this.maxSubtotal) {6808 writer.WriteXmlAttributeBool("maxSubtotal", this.maxSubtotal);6809 }6810 if (null !== this.minSubtotal) {6811 writer.WriteXmlAttributeBool("minSubtotal", this.minSubtotal);6812 }6813 if (null !== this.productSubtotal) {6814 writer.WriteXmlAttributeBool("productSubtotal", this.productSubtotal);6815 }6816 if (null !== this.countSubtotal) {6817 writer.WriteXmlAttributeBool("countSubtotal", this.countSubtotal);6818 }6819 if (null !== this.stdDevSubtotal) {6820 writer.WriteXmlAttributeBool("stdDevSubtotal", this.stdDevSubtotal);6821 }6822 if (null !== this.stdDevPSubtotal) {6823 writer.WriteXmlAttributeBool("stdDevPSubtotal", this.stdDevPSubtotal);6824 }6825 if (null !== this.varSubtotal) {6826 writer.WriteXmlAttributeBool("varSubtotal", this.varSubtotal);6827 }6828 if (null !== this.varPSubtotal) {6829 writer.WriteXmlAttributeBool("varPSubtotal", this.varPSubtotal);6830 }6831 if (null !== this.showPropCell) {6832 writer.WriteXmlAttributeBool("showPropCell", this.showPropCell);6833 }6834 if (null !== this.showPropTip) {6835 writer.WriteXmlAttributeBool("showPropTip", this.showPropTip);6836 }6837 if (null !== this.showPropAsCaption) {6838 writer.WriteXmlAttributeBool("showPropAsCaption", this.showPropAsCaption);6839 }6840 if (null !== this.defaultAttributeDrillState) {6841 writer.WriteXmlAttributeBool("defaultAttributeDrillState", this.defaultAttributeDrillState);6842 }6843 writer.WriteXmlNodeEnd(name, true);6844 if (null !== this.items) {6845 this.items.toXml(writer, "items");6846 }6847 if (null !== this.autoSortScope) {6848 this.autoSortScope.toXml(writer, "autoSortScope");6849 }6850 if (null !== this.extLst) {6851 this.extLst.toXml(writer, "extLst");6852 }6853 writer.WriteXmlNodeEnd(name);6854};6855CT_PivotField.prototype.asc_getName = function () {6856 return this.name;6857};6858CT_PivotField.prototype.asc_getSubtotalTop = function () {6859 return null !== this.subtotalTop ? this.subtotalTop : true;6860};6861CT_PivotField.prototype.asc_getSubtotals = function () {6862 var res = null;6863 if (null === this.defaultSubtotal || this.defaultSubtotal) {6864 res = [];6865 if (this.sumSubtotal) {6866 res.push(c_oAscItemType.Sum);6867 }6868 if (this.countASubtotal) {6869 res.push(c_oAscItemType.CountA);6870 }6871 if (this.avgSubtotal) {6872 res.push(c_oAscItemType.Avg);6873 }6874 if (this.maxSubtotal) {6875 res.push(c_oAscItemType.Max);6876 }6877 if (this.minSubtotal) {6878 res.push(c_oAscItemType.Min);6879 }6880 if (this.productSubtotal) {6881 res.push(c_oAscItemType.Product);6882 }6883 if (this.countSubtotal) {6884 res.push(c_oAscItemType.Count);6885 }6886 if (this.stdDevSubtotal) {6887 res.push(c_oAscItemType.StdDev);6888 }6889 if (this.stdDevPSubtotal) {6890 res.push(c_oAscItemType.StdDevP);6891 }6892 if (this.varSubtotal) {6893 res.push(c_oAscItemType.Var);6894 }6895 if (this.varPSubtotal) {6896 res.push(c_oAscItemType.VarP);6897 }6898 }6899 return res;6900};6901CT_PivotField.prototype.getItem = function (index) {6902 return this.items && this.items.item[index];6903};6904function CT_Field() {6905//Attributes6906 this.x = null;6907}6908CT_Field.prototype.readAttributes = function(attr, uq) {6909 if (attr()) {6910 var vals = attr();6911 var val;6912 val = vals["x"];6913 if (undefined !== val) {6914 this.x = val - 0;6915 }6916 }6917};6918CT_Field.prototype.toXml = function(writer, name) {6919 writer.WriteXmlNodeStart(name);6920 if (null !== this.x) {6921 writer.WriteXmlAttributeNumber("x", this.x);6922 }6923 writer.WriteXmlNodeEnd(name, true, true);6924};6925CT_Field.prototype.asc_getIndex = function () {6926 return this.x || 0;6927};6928function CT_I() {6929//Attributes6930 this.t = null;//data6931 this.r = null;//06932 this.i = null;//06933//Members6934 this.x = [];6935}6936CT_I.prototype.readAttributes = function(attr, uq) {6937 if (attr()) {6938 var vals = attr();6939 var val;6940 val = vals["t"];6941 if (undefined !== val) {6942 val = FromXml_ST_ItemType(val);6943 if (-1 !== val) {6944 this.t = val;6945 }6946 }6947 val = vals["r"];6948 if (undefined !== val) {6949 this.r = val - 0;6950 }6951 val = vals["i"];6952 if (undefined !== val) {6953 this.i = val - 0;6954 }6955 }6956};6957CT_I.prototype.onStartNode = function(elem, attr, uq) {6958 var newContext = this;6959 if ("x" === elem) {6960 newContext = new CT_X();6961 if (newContext.readAttributes) {6962 newContext.readAttributes(attr, uq);6963 }6964 this.x.push(newContext);6965 } else {6966 newContext = null;6967 }6968 return newContext;6969};6970CT_I.prototype.toXml = function(writer, name) {6971 writer.WriteXmlNodeStart(name);6972 if (null !== this.t) {6973 writer.WriteXmlAttributeStringEncode("t", ToXml_ST_ItemType(this.t));6974 }6975 if (null !== this.r) {6976 writer.WriteXmlAttributeNumber("r", this.r);6977 }6978 if (null !== this.i) {6979 writer.WriteXmlAttributeNumber("i", this.i);6980 }6981 writer.WriteXmlNodeEnd(name, true);6982 for (var i = 0; i < this.x.length; ++i) {6983 var elem = this.x[i];6984 elem.toXml(writer, "x");6985 }6986 writer.WriteXmlNodeEnd(name);6987};6988CT_I.prototype.getR = function () {6989 return this.r || 0;6990};6991function CT_PageField() {6992//Attributes6993 this.fld = null;6994 this.item = null;6995 this.hier = null;6996 this.name = null;6997 this.cap = null;6998//Members6999 this.extLst = null;7000}7001CT_PageField.prototype.readAttributes = function(attr, uq) {7002 if (attr()) {7003 var vals = attr();7004 var val;7005 val = vals["fld"];7006 if (undefined !== val) {7007 this.fld = val - 0;7008 }7009 val = vals["item"];7010 if (undefined !== val) {7011 this.item = val - 0;7012 }7013 val = vals["hier"];7014 if (undefined !== val) {7015 this.hier = val - 0;7016 }7017 val = vals["name"];7018 if (undefined !== val) {7019 this.name = uq(val);7020 }7021 val = vals["cap"];7022 if (undefined !== val) {7023 this.cap = uq(val);7024 }7025 }7026};7027CT_PageField.prototype.onStartNode = function(elem, attr, uq) {7028 var newContext = this;7029 if ("extLst" === elem) {7030 newContext = new CT_ExtensionList();7031 if (newContext.readAttributes) {7032 newContext.readAttributes(attr, uq);7033 }7034 this.extLst = newContext;7035 } else {7036 newContext = null;7037 }7038 return newContext;7039};7040CT_PageField.prototype.toXml = function(writer, name) {7041 writer.WriteXmlNodeStart(name);7042 if (null !== this.fld) {7043 writer.WriteXmlAttributeNumber("fld", this.fld);7044 }7045 if (null !== this.item) {7046 writer.WriteXmlAttributeNumber("item", this.item);7047 }7048 if (null !== this.hier) {7049 writer.WriteXmlAttributeNumber("hier", this.hier);7050 }7051 if (null !== this.name) {7052 writer.WriteXmlAttributeStringEncode("name", this.name);7053 }7054 if (null !== this.cap) {7055 writer.WriteXmlAttributeStringEncode("cap", this.cap);7056 }7057 writer.WriteXmlNodeEnd(name, true);7058 if (null !== this.extLst) {7059 this.extLst.toXml(writer, "extLst");7060 }7061 writer.WriteXmlNodeEnd(name);7062};7063CT_PageField.prototype.asc_getName = function () {7064 return this.name;7065};7066CT_PageField.prototype.asc_getIndex = function () {7067 return this.fld;7068};7069function CT_DataField() {7070//Attributes7071 this.name = null;7072 this.fld = null;7073 this.subtotal = null;//sum7074 this.showDataAs = null;//normal7075 this.baseField = null;//-17076 this.baseItem = null;//10488327077 this.numFmtId = null;7078//Members7079 this.extLst = null;7080}7081CT_DataField.prototype.readAttributes = function(attr, uq) {7082 if (attr()) {7083 var vals = attr();7084 var val;7085 val = vals["name"];7086 if (undefined !== val) {7087 this.name = uq(val);7088 }7089 val = vals["fld"];7090 if (undefined !== val) {7091 this.fld = val - 0;7092 }7093 val = vals["subtotal"];7094 if (undefined !== val) {7095 val = FromXml_ST_DataConsolidateFunction(val);7096 if (-1 !== val) {7097 this.subtotal = val;7098 }7099 }7100 val = vals["showDataAs"];7101 if (undefined !== val) {7102 val = FromXml_ST_ShowDataAs(val);7103 if (-1 !== val) {7104 this.showDataAs = val;7105 }7106 }7107 val = vals["baseField"];7108 if (undefined !== val) {7109 this.baseField = val - 0;7110 }7111 val = vals["baseItem"];7112 if (undefined !== val) {7113 this.baseItem = val - 0;7114 }7115 val = vals["numFmtId"];7116 if (undefined !== val) {7117 this.numFmtId = val - 0;7118 }7119 }7120};7121CT_DataField.prototype.onStartNode = function(elem, attr, uq) {7122 var newContext = this;7123 if ("extLst" === elem) {7124 newContext = new CT_ExtensionList();7125 if (newContext.readAttributes) {7126 newContext.readAttributes(attr, uq);7127 }7128 this.extLst = newContext;7129 } else {7130 newContext = null;7131 }7132 return newContext;7133};7134CT_DataField.prototype.toXml = function(writer, name) {7135 writer.WriteXmlNodeStart(name);7136 if (null !== this.name) {7137 writer.WriteXmlAttributeStringEncode("name", this.name);7138 }7139 if (null !== this.fld) {7140 writer.WriteXmlAttributeNumber("fld", this.fld);7141 }7142 if (null !== this.subtotal) {7143 writer.WriteXmlAttributeStringEncode("subtotal", ToXml_ST_DataConsolidateFunction(this.subtotal));7144 }7145 if (null !== this.showDataAs) {7146 writer.WriteXmlAttributeStringEncode("showDataAs", ToXml_ST_ShowDataAs(this.showDataAs));7147 }7148 if (null !== this.baseField) {7149 writer.WriteXmlAttributeNumber("baseField", this.baseField);7150 }7151 if (null !== this.baseItem) {7152 writer.WriteXmlAttributeNumber("baseItem", this.baseItem);7153 }7154 if (null !== this.numFmtId) {7155 writer.WriteXmlAttributeNumber("numFmtId", this.numFmtId);7156 }7157 writer.WriteXmlNodeEnd(name, true);7158 if (null !== this.extLst) {7159 this.extLst.toXml(writer, "extLst");7160 }7161 writer.WriteXmlNodeEnd(name);7162};7163CT_DataField.prototype.asc_getName = function () {7164 return this.name;7165};7166CT_DataField.prototype.asc_getIndex = function () {7167 return this.fld;7168};7169CT_DataField.prototype.asc_getSubtotal = function () {7170 return null !== this.subtotal ? this.subtotal : c_oAscDataConsolidateFunction.Sum;7171};7172CT_DataField.prototype.asc_getShowDataAs = function () {7173 return null !== this.showDataAs ? this.showDataAs : c_oAscShowDataAs.Normal;7174};7175CT_DataField.prototype.asc_set = function (api, pivot, newVal) {7176 var t = this;7177 api._changePivotStyle(pivot, function (ws) {7178 if (null !== newVal.name && t.name !== newVal.name) {7179 t.asc_setName(newVal.name);7180 }7181 if (null !== newVal.subtotal && t.subtotal !== newVal.subtotal) {7182 t.asc_setSubtotal(newVal.subtotal);7183 }7184 ws.clearPivotTable(pivot);7185 ws.updatePivotTable(pivot);7186 });7187};7188CT_DataField.prototype.asc_setName = function(newVal) {7189 this.name = newVal;7190};7191CT_DataField.prototype.asc_setSubtotal = function(newVal) {7192 this.subtotal = newVal;7193};7194function CT_Format() {7195//Attributes7196 this.action = null;//formatting7197 this.dxfId = null;7198//Members7199 this.pivotArea = null;7200 this.extLst = null;7201}7202CT_Format.prototype.readAttributes = function(attr, uq) {7203 if (attr()) {7204 var vals = attr();7205 var val;7206 val = vals["action"];7207 if (undefined !== val) {7208 val = FromXml_ST_FormatAction(val);7209 if (-1 !== val) {7210 this.action = val;7211 }7212 }7213 val = vals["dxfId"];7214 if (undefined !== val) {7215 this.dxfId = val - 0;7216 }7217 }7218};7219CT_Format.prototype.onStartNode = function(elem, attr, uq) {7220 var newContext = this;7221 if ("pivotArea" === elem) {7222 newContext = new CT_PivotArea();7223 if (newContext.readAttributes) {7224 newContext.readAttributes(attr, uq);7225 }7226 this.pivotArea = newContext;7227 } else if ("extLst" === elem) {7228 newContext = new CT_ExtensionList();7229 if (newContext.readAttributes) {7230 newContext.readAttributes(attr, uq);7231 }7232 this.extLst = newContext;7233 } else {7234 newContext = null;7235 }7236 return newContext;7237};7238CT_Format.prototype.toXml = function(writer, name) {7239 writer.WriteXmlNodeStart(name);7240 if (null !== this.action) {7241 writer.WriteXmlAttributeStringEncode("action", ToXml_ST_FormatAction(this.action));7242 }7243 //todo7244 // if (null !== this.dxfId) {7245 // writer.WriteXmlAttributeNumber("dxfId", this.dxfId);7246 // }7247 writer.WriteXmlNodeEnd(name, true);7248 if (null !== this.pivotArea) {7249 this.pivotArea.toXml(writer, "pivotArea");7250 }7251 if (null !== this.extLst) {7252 this.extLst.toXml(writer, "extLst");7253 }7254 writer.WriteXmlNodeEnd(name);7255};7256function CT_ConditionalFormat() {7257//Attributes7258 this.scope = null;//selection7259 this.type = null;//none7260 this.priority = null;7261//Members7262 this.pivotAreas = null;7263 this.extLst = null;7264}7265CT_ConditionalFormat.prototype.readAttributes = function(attr, uq) {7266 if (attr()) {7267 var vals = attr();7268 var val;7269 val = vals["scope"];7270 if (undefined !== val) {7271 val = FromXml_ST_Scope(val);7272 if (-1 !== val) {7273 this.scope = val;7274 }7275 }7276 val = vals["type"];7277 if (undefined !== val) {7278 val = FromXml_ST_Type(val);7279 if (-1 !== val) {7280 this.type = val;7281 }7282 }7283 val = vals["priority"];7284 if (undefined !== val) {7285 this.priority = val - 0;7286 }7287 }7288};7289CT_ConditionalFormat.prototype.onStartNode = function(elem, attr, uq) {7290 var newContext = this;7291 if ("pivotAreas" === elem) {7292 newContext = new CT_PivotAreas();7293 if (newContext.readAttributes) {7294 newContext.readAttributes(attr, uq);7295 }7296 this.pivotAreas = newContext;7297 } else if ("extLst" === elem) {7298 newContext = new CT_ExtensionList();7299 if (newContext.readAttributes) {7300 newContext.readAttributes(attr, uq);7301 }7302 this.extLst = newContext;7303 } else {7304 newContext = null;7305 }7306 return newContext;7307};7308CT_ConditionalFormat.prototype.toXml = function(writer, name) {7309 writer.WriteXmlNodeStart(name);7310 if (null !== this.scope) {7311 writer.WriteXmlAttributeStringEncode("scope", ToXml_ST_Scope(this.scope));7312 }7313 if (null !== this.type) {7314 writer.WriteXmlAttributeStringEncode("type", ToXml_ST_Type(this.type));7315 }7316 if (null !== this.priority) {7317 writer.WriteXmlAttributeNumber("priority", this.priority);7318 }7319 writer.WriteXmlNodeEnd(name, true);7320 if (null !== this.pivotAreas) {7321 this.pivotAreas.toXml(writer, "pivotAreas");7322 }7323 if (null !== this.extLst) {7324 this.extLst.toXml(writer, "extLst");7325 }7326 writer.WriteXmlNodeEnd(name);7327};7328function CT_ChartFormat() {7329//Attributes7330 this.chart = null;7331 this.format = null;7332 this.series = null;//false7333//Members7334 this.pivotArea = null;7335}7336CT_ChartFormat.prototype.readAttributes = function(attr, uq) {7337 if (attr()) {7338 var vals = attr();7339 var val;7340 val = vals["chart"];7341 if (undefined !== val) {7342 this.chart = val - 0;7343 }7344 val = vals["format"];7345 if (undefined !== val) {7346 this.format = val - 0;7347 }7348 val = vals["series"];7349 if (undefined !== val) {7350 this.series = getBoolFromXml(val);7351 }7352 }7353};7354CT_ChartFormat.prototype.onStartNode = function(elem, attr, uq) {7355 var newContext = this;7356 if ("pivotArea" === elem) {7357 newContext = new CT_PivotArea();7358 if (newContext.readAttributes) {7359 newContext.readAttributes(attr, uq);7360 }7361 this.pivotArea = newContext;7362 } else {7363 newContext = null;7364 }7365 return newContext;7366};7367CT_ChartFormat.prototype.toXml = function(writer, name) {7368 writer.WriteXmlNodeStart(name);7369 if (null !== this.chart) {7370 writer.WriteXmlAttributeNumber("chart", this.chart);7371 }7372 if (null !== this.format) {7373 writer.WriteXmlAttributeNumber("format", this.format);7374 }7375 if (null !== this.series) {7376 writer.WriteXmlAttributeBool("series", this.series);7377 }7378 writer.WriteXmlNodeEnd(name, true);7379 if (null !== this.pivotArea) {7380 this.pivotArea.toXml(writer, "pivotArea");7381 }7382 writer.WriteXmlNodeEnd(name);7383};7384function CT_PivotHierarchy() {7385//Attributes7386 this.outline = null;//false7387 this.multipleItemSelectionAllowed = null;//false7388 this.subtotalTop = null;//false7389 this.showInFieldList = null;//true7390 this.dragToRow = null;//true7391 this.dragToCol = null;//true7392 this.dragToPage = null;//true7393 this.dragToData = null;//false7394 this.dragOff = null;//true7395 this.includeNewItemsInFilter = null;//false7396 this.caption = null;7397//Members7398 this.mps = null;7399 this.members = [];7400 this.extLst = null;7401}7402CT_PivotHierarchy.prototype.readAttributes = function(attr, uq) {7403 if (attr()) {7404 var vals = attr();7405 var val;7406 val = vals["outline"];7407 if (undefined !== val) {7408 this.outline = getBoolFromXml(val);7409 }7410 val = vals["multipleItemSelectionAllowed"];7411 if (undefined !== val) {7412 this.multipleItemSelectionAllowed = getBoolFromXml(val);7413 }7414 val = vals["subtotalTop"];7415 if (undefined !== val) {7416 this.subtotalTop = getBoolFromXml(val);7417 }7418 val = vals["showInFieldList"];7419 if (undefined !== val) {7420 this.showInFieldList = getBoolFromXml(val);7421 }7422 val = vals["dragToRow"];7423 if (undefined !== val) {7424 this.dragToRow = getBoolFromXml(val);7425 }7426 val = vals["dragToCol"];7427 if (undefined !== val) {7428 this.dragToCol = getBoolFromXml(val);7429 }7430 val = vals["dragToPage"];7431 if (undefined !== val) {7432 this.dragToPage = getBoolFromXml(val);7433 }7434 val = vals["dragToData"];7435 if (undefined !== val) {7436 this.dragToData = getBoolFromXml(val);7437 }7438 val = vals["dragOff"];7439 if (undefined !== val) {7440 this.dragOff = getBoolFromXml(val);7441 }7442 val = vals["includeNewItemsInFilter"];7443 if (undefined !== val) {7444 this.includeNewItemsInFilter = getBoolFromXml(val);7445 }7446 val = vals["caption"];7447 if (undefined !== val) {7448 this.caption = uq(val);7449 }7450 }7451};7452CT_PivotHierarchy.prototype.onStartNode = function(elem, attr, uq) {7453 var newContext = this;7454 if ("mps" === elem) {7455 newContext = new CT_MemberProperties();7456 if (newContext.readAttributes) {7457 newContext.readAttributes(attr, uq);7458 }7459 this.mps = newContext;7460 } else if ("members" === elem) {7461 newContext = new CT_Members();7462 if (newContext.readAttributes) {7463 newContext.readAttributes(attr, uq);7464 }7465 this.members.push(newContext);7466 } else if ("extLst" === elem) {7467 newContext = new CT_ExtensionList();7468 if (newContext.readAttributes) {7469 newContext.readAttributes(attr, uq);7470 }7471 this.extLst = newContext;7472 } else {7473 newContext = null;7474 }7475 return newContext;7476};7477CT_PivotHierarchy.prototype.toXml = function(writer, name) {7478 writer.WriteXmlNodeStart(name);7479 if (null !== this.outline) {7480 writer.WriteXmlAttributeBool("outline", this.outline);7481 }7482 if (null !== this.multipleItemSelectionAllowed) {7483 writer.WriteXmlAttributeBool("multipleItemSelectionAllowed", this.multipleItemSelectionAllowed);7484 }7485 if (null !== this.subtotalTop) {7486 writer.WriteXmlAttributeBool("subtotalTop", this.subtotalTop);7487 }7488 if (null !== this.showInFieldList) {7489 writer.WriteXmlAttributeBool("showInFieldList", this.showInFieldList);7490 }7491 if (null !== this.dragToRow) {7492 writer.WriteXmlAttributeBool("dragToRow", this.dragToRow);7493 }7494 if (null !== this.dragToCol) {7495 writer.WriteXmlAttributeBool("dragToCol", this.dragToCol);7496 }7497 if (null !== this.dragToPage) {7498 writer.WriteXmlAttributeBool("dragToPage", this.dragToPage);7499 }7500 if (null !== this.dragToData) {7501 writer.WriteXmlAttributeBool("dragToData", this.dragToData);7502 }7503 if (null !== this.dragOff) {7504 writer.WriteXmlAttributeBool("dragOff", this.dragOff);7505 }7506 if (null !== this.includeNewItemsInFilter) {7507 writer.WriteXmlAttributeBool("includeNewItemsInFilter", this.includeNewItemsInFilter);7508 }7509 if (null !== this.caption) {7510 writer.WriteXmlAttributeStringEncode("caption", this.caption);7511 }7512 writer.WriteXmlNodeEnd(name, true);7513 if (null !== this.mps) {7514 this.mps.toXml(writer, "mps");7515 }7516 for (var i = 0; i < this.members.length; ++i) {7517 var elem = this.members[i];7518 elem.toXml(writer, "members");7519 }7520 if (null !== this.extLst) {7521 this.extLst.toXml(writer, "extLst");7522 }7523 writer.WriteXmlNodeEnd(name);7524};7525function CT_PivotFilter() {7526//Attributes7527 this.fld = null;7528 this.mpFld = null;7529 this.type = null;7530 this.evalOrder = null;//07531 this.id = null;7532 this.iMeasureHier = null;7533 this.iMeasureFld = null;7534 this.name = null;7535 this.description = null;7536 this.stringValue1 = null;7537 this.stringValue2 = null;7538//Members7539 this.autoFilter = null;7540 this.extLst = null;7541}7542CT_PivotFilter.prototype.readAttributes = function(attr, uq) {7543 if (attr()) {7544 var vals = attr();7545 var val;7546 val = vals["fld"];7547 if (undefined !== val) {7548 this.fld = val - 0;7549 }7550 val = vals["mpFld"];7551 if (undefined !== val) {7552 this.mpFld = val - 0;7553 }7554 val = vals["type"];7555 if (undefined !== val) {7556 val = FromXml_ST_PivotFilterType(val);7557 if (-1 !== val) {7558 this.type = val;7559 }7560 }7561 val = vals["evalOrder"];7562 if (undefined !== val) {7563 this.evalOrder = val - 0;7564 }7565 val = vals["id"];7566 if (undefined !== val) {7567 this.id = val - 0;7568 }7569 val = vals["iMeasureHier"];7570 if (undefined !== val) {7571 this.iMeasureHier = val - 0;7572 }7573 val = vals["iMeasureFld"];7574 if (undefined !== val) {7575 this.iMeasureFld = val - 0;7576 }7577 val = vals["name"];7578 if (undefined !== val) {7579 this.name = uq(val);7580 }7581 val = vals["description"];7582 if (undefined !== val) {7583 this.description = uq(val);7584 }7585 val = vals["stringValue1"];7586 if (undefined !== val) {7587 this.stringValue1 = uq(val);7588 }7589 val = vals["stringValue2"];7590 if (undefined !== val) {7591 this.stringValue2 = uq(val);7592 }7593 }7594};7595CT_PivotFilter.prototype.onStartNode = function(elem, attr, uq) {7596 var newContext = this;7597 if ("autoFilter" === elem) {7598 newContext = new CT_AutoFilter();7599 if (newContext.readAttributes) {7600 newContext.readAttributes(attr, uq);7601 }7602 this.autoFilter = newContext;7603 } else if ("extLst" === elem) {7604 newContext = new CT_ExtensionList();7605 if (newContext.readAttributes) {7606 newContext.readAttributes(attr, uq);7607 }7608 this.extLst = newContext;7609 } else {7610 newContext = null;7611 }7612 return newContext;7613};7614CT_PivotFilter.prototype.toXml = function(writer, name) {7615 writer.WriteXmlNodeStart(name);7616 if (null !== this.fld) {7617 writer.WriteXmlAttributeNumber("fld", this.fld);7618 }7619 if (null !== this.mpFld) {7620 writer.WriteXmlAttributeNumber("mpFld", this.mpFld);7621 }7622 if (null !== this.type) {7623 writer.WriteXmlAttributeStringEncode("type", ToXml_ST_PivotFilterType(this.type));7624 }7625 if (null !== this.evalOrder) {7626 writer.WriteXmlAttributeNumber("evalOrder", this.evalOrder);7627 }7628 if (null !== this.id) {7629 writer.WriteXmlAttributeNumber("id", this.id);7630 }7631 if (null !== this.iMeasureHier) {7632 writer.WriteXmlAttributeNumber("iMeasureHier", this.iMeasureHier);7633 }7634 if (null !== this.iMeasureFld) {7635 writer.WriteXmlAttributeNumber("iMeasureFld", this.iMeasureFld);7636 }7637 if (null !== this.name) {7638 writer.WriteXmlAttributeStringEncode("name", this.name);7639 }7640 if (null !== this.description) {7641 writer.WriteXmlAttributeStringEncode("description", this.description);7642 }7643 if (null !== this.stringValue1) {7644 writer.WriteXmlAttributeStringEncode("stringValue1", this.stringValue1);7645 }7646 if (null !== this.stringValue2) {7647 writer.WriteXmlAttributeStringEncode("stringValue2", this.stringValue2);7648 }7649 writer.WriteXmlNodeEnd(name, true);7650 if (null !== this.autoFilter) {7651 this.autoFilter.toXml(writer, "autoFilter");7652 }7653 if (null !== this.extLst) {7654 this.extLst.toXml(writer, "extLst");7655 }7656 writer.WriteXmlNodeEnd(name);7657};7658function CT_HierarchyUsage() {7659//Attributes7660 this.hierarchyUsage = null;7661}7662CT_HierarchyUsage.prototype.readAttributes = function(attr, uq) {7663 if (attr()) {7664 var vals = attr();7665 var val;7666 val = vals["hierarchyUsage"];7667 if (undefined !== val) {7668 this.hierarchyUsage = val - 0;7669 }7670 }7671};7672CT_HierarchyUsage.prototype.toXml = function(writer, name) {7673 writer.WriteXmlNodeStart(name);7674 if (null !== this.hierarchyUsage) {7675 writer.WriteXmlAttributeNumber("hierarchyUsage", this.hierarchyUsage);7676 }7677 writer.WriteXmlNodeEnd(name, true, true);7678};7679function CT_Pages() {7680//Attributes7681 this.count = null;7682//Members7683 this.page = [];7684}7685CT_Pages.prototype.readAttributes = function(attr, uq) {7686 if (attr()) {7687 var vals = attr();7688 var val;7689 val = vals["count"];7690 if (undefined !== val) {7691 this.count = val - 0;7692 }7693 }7694};7695CT_Pages.prototype.onStartNode = function(elem, attr, uq) {7696 var newContext = this;7697 if ("page" === elem) {7698 newContext = new CT_PCDSCPage();7699 if (newContext.readAttributes) {7700 newContext.readAttributes(attr, uq);7701 }7702 this.page.push(newContext);7703 } else {7704 newContext = null;7705 }7706 return newContext;7707};7708CT_Pages.prototype.toXml = function(writer, name) {7709 writer.WriteXmlNodeStart(name);7710 if (null !== this.count) {7711 writer.WriteXmlAttributeNumber("count", this.count);7712 }7713 writer.WriteXmlNodeEnd(name, true);7714 for (var i = 0; i < this.page.length; ++i) {7715 var elem = this.page[i];7716 elem.toXml(writer, "page");7717 }7718 writer.WriteXmlNodeEnd(name);7719};7720function CT_RangeSets() {7721//Attributes7722 this.count = null;7723//Members7724 this.rangeSet = [];7725}7726CT_RangeSets.prototype.readAttributes = function(attr, uq) {7727 if (attr()) {7728 var vals = attr();7729 var val;7730 val = vals["count"];7731 if (undefined !== val) {7732 this.count = val - 0;7733 }7734 }7735};7736CT_RangeSets.prototype.onStartNode = function(elem, attr, uq) {7737 var newContext = this;7738 if ("rangeSet" === elem) {7739 newContext = new CT_RangeSet();7740 if (newContext.readAttributes) {7741 newContext.readAttributes(attr, uq);7742 }7743 this.rangeSet.push(newContext);7744 } else {7745 newContext = null;7746 }7747 return newContext;7748};7749CT_RangeSets.prototype.toXml = function(writer, name) {7750 writer.WriteXmlNodeStart(name);7751 if (null !== this.count) {7752 writer.WriteXmlAttributeNumber("count", this.count);7753 }7754 writer.WriteXmlNodeEnd(name, true);7755 for (var i = 0; i < this.rangeSet.length; ++i) {7756 var elem = this.rangeSet[i];7757 elem.toXml(writer, "rangeSet");7758 }7759 writer.WriteXmlNodeEnd(name);7760};7761function CT_SharedItems() {7762//Attributes7763 this.containsSemiMixedTypes = null;//true7764 this.containsNonDate = null;//true7765 this.containsDate = null;//false7766 this.containsString = null;//true7767 this.containsBlank = null;//false7768 this.containsMixedTypes = null;//false7769 this.containsNumber = null;//false7770 this.containsInteger = null;//false7771 this.minValue = null;7772 this.maxValue = null;7773 this.minDate = null;7774 this.maxDate = null;7775 this.count = null;7776 this.longText = null;//false7777//Members7778 this.Items = new PivotRecords();7779}7780CT_SharedItems.prototype.readAttributes = function(attr, uq) {7781 if (attr()) {7782 var vals = attr();7783 var val;7784 val = vals["containsSemiMixedTypes"];7785 if (undefined !== val) {7786 this.containsSemiMixedTypes = getBoolFromXml(val);7787 }7788 val = vals["containsNonDate"];7789 if (undefined !== val) {7790 this.containsNonDate = getBoolFromXml(val);7791 }7792 val = vals["containsDate"];7793 if (undefined !== val) {7794 this.containsDate = getBoolFromXml(val);7795 }7796 val = vals["containsString"];7797 if (undefined !== val) {7798 this.containsString = getBoolFromXml(val);7799 }7800 val = vals["containsBlank"];7801 if (undefined !== val) {7802 this.containsBlank = getBoolFromXml(val);7803 }7804 val = vals["containsMixedTypes"];7805 if (undefined !== val) {7806 this.containsMixedTypes = getBoolFromXml(val);7807 }7808 val = vals["containsNumber"];7809 if (undefined !== val) {7810 this.containsNumber = getBoolFromXml(val);7811 }7812 val = vals["containsInteger"];7813 if (undefined !== val) {7814 this.containsInteger = getBoolFromXml(val);7815 }7816 val = vals["minValue"];7817 if (undefined !== val) {7818 this.minValue = val - 0;7819 }7820 val = vals["maxValue"];7821 if (undefined !== val) {7822 this.maxValue = val - 0;7823 }7824 val = vals["minDate"];7825 if (undefined !== val) {7826 this.minDate = uq(val);7827 }7828 val = vals["maxDate"];7829 if (undefined !== val) {7830 this.maxDate = uq(val);7831 }7832 val = vals["count"];7833 if (undefined !== val) {7834 this.count = val - 0;7835 this.Items.setStartCount(this.count);7836 }7837 val = vals["longText"];7838 if (undefined !== val) {7839 this.longText = getBoolFromXml(val);7840 }7841 }7842};7843CT_SharedItems.prototype.onStartNode = function(elem, attr, uq) {7844 var newContext = this;7845 var newContextCandidate = this.Items.onStartNode(elem, attr, uq);7846 if (newContextCandidate) {7847 newContext = newContextCandidate;7848 } else {7849 newContext = null;7850 }7851 return newContext;7852};7853CT_SharedItems.prototype.onEndNode = function(prevContext, elem) {7854 this.Items.onEndNode(prevContext, elem);7855};7856CT_SharedItems.prototype.toXml = function(writer, name) {7857 writer.WriteXmlNodeStart(name);7858 if (null !== this.containsSemiMixedTypes) {7859 writer.WriteXmlAttributeBool("containsSemiMixedTypes", this.containsSemiMixedTypes);7860 }7861 if (null !== this.containsNonDate) {7862 writer.WriteXmlAttributeBool("containsNonDate", this.containsNonDate);7863 }7864 if (null !== this.containsDate) {7865 writer.WriteXmlAttributeBool("containsDate", this.containsDate);7866 }7867 if (null !== this.containsString) {7868 writer.WriteXmlAttributeBool("containsString", this.containsString);7869 }7870 if (null !== this.containsBlank) {7871 writer.WriteXmlAttributeBool("containsBlank", this.containsBlank);7872 }7873 if (null !== this.containsMixedTypes) {7874 writer.WriteXmlAttributeBool("containsMixedTypes", this.containsMixedTypes);7875 }7876 if (null !== this.containsNumber) {7877 writer.WriteXmlAttributeBool("containsNumber", this.containsNumber);7878 }7879 if (null !== this.containsInteger) {7880 writer.WriteXmlAttributeBool("containsInteger", this.containsInteger);7881 }7882 if (null !== this.minValue) {7883 writer.WriteXmlAttributeNumber("minValue", this.minValue);7884 }7885 if (null !== this.maxValue) {7886 writer.WriteXmlAttributeNumber("maxValue", this.maxValue);7887 }7888 if (null !== this.minDate) {7889 writer.WriteXmlAttributeStringEncode("minDate", this.minDate);7890 }7891 if (null !== this.maxDate) {7892 writer.WriteXmlAttributeStringEncode("maxDate", this.maxDate);7893 }7894 if (null !== this.count) {7895 writer.WriteXmlAttributeNumber("count", this.count);7896 }7897 if (null !== this.longText) {7898 writer.WriteXmlAttributeBool("longText", this.longText);7899 }7900 writer.WriteXmlNodeEnd(name, true);7901 this.Items.toXml(writer);7902 writer.WriteXmlNodeEnd(name);7903};7904function CT_FieldGroup() {7905//Attributes7906 this.par = null;7907 this.base = null;7908//Members7909 this.rangePr = null;7910 this.discretePr = null;7911 this.groupItems = null;7912}7913CT_FieldGroup.prototype.readAttributes = function(attr, uq) {7914 if (attr()) {7915 var vals = attr();7916 var val;7917 val = vals["par"];7918 if (undefined !== val) {7919 this.par = val - 0;7920 }7921 val = vals["base"];7922 if (undefined !== val) {7923 this.base = val - 0;7924 }7925 }7926};7927CT_FieldGroup.prototype.onStartNode = function(elem, attr, uq) {7928 var newContext = this;7929 if ("rangePr" === elem) {7930 newContext = new CT_RangePr();7931 if (newContext.readAttributes) {7932 newContext.readAttributes(attr, uq);7933 }7934 this.rangePr = newContext;7935 } else if ("discretePr" === elem) {7936 newContext = new CT_DiscretePr();7937 if (newContext.readAttributes) {7938 newContext.readAttributes(attr, uq);7939 }7940 this.discretePr = newContext;7941 } else if ("groupItems" === elem) {7942 newContext = new CT_GroupItems();7943 if (newContext.readAttributes) {7944 newContext.readAttributes(attr, uq);7945 }7946 this.groupItems = newContext;7947 } else {7948 newContext = null;7949 }7950 return newContext;7951};7952CT_FieldGroup.prototype.toXml = function(writer, name) {7953 writer.WriteXmlNodeStart(name);7954 if (null !== this.par) {7955 writer.WriteXmlAttributeNumber("par", this.par);7956 }7957 if (null !== this.base) {7958 writer.WriteXmlAttributeNumber("base", this.base);7959 }7960 writer.WriteXmlNodeEnd(name, true);7961 if (null !== this.rangePr) {7962 this.rangePr.toXml(writer, "rangePr");7963 }7964 if (null !== this.discretePr) {7965 this.discretePr.toXml(writer, "discretePr");7966 }7967 if (null !== this.groupItems) {7968 this.groupItems.toXml(writer, "groupItems");7969 }7970 writer.WriteXmlNodeEnd(name);7971};7972function CT_FieldsUsage() {7973//Attributes7974 this.count = null;7975//Members7976 this.fieldUsage = [];7977}7978CT_FieldsUsage.prototype.readAttributes = function(attr, uq) {7979 if (attr()) {7980 var vals = attr();7981 var val;7982 val = vals["count"];7983 if (undefined !== val) {7984 this.count = val - 0;7985 }7986 }7987};7988CT_FieldsUsage.prototype.onStartNode = function(elem, attr, uq) {7989 var newContext = this;7990 if ("fieldUsage" === elem) {7991 newContext = new CT_FieldUsage();7992 if (newContext.readAttributes) {7993 newContext.readAttributes(attr, uq);7994 }7995 this.fieldUsage.push(newContext);7996 } else {7997 newContext = null;7998 }7999 return newContext;8000};8001CT_FieldsUsage.prototype.toXml = function(writer, name) {8002 writer.WriteXmlNodeStart(name);8003 if (null !== this.count) {8004 writer.WriteXmlAttributeNumber("count", this.count);8005 }8006 writer.WriteXmlNodeEnd(name, true);8007 for (var i = 0; i < this.fieldUsage.length; ++i) {8008 var elem = this.fieldUsage[i];8009 elem.toXml(writer, "fieldUsage");8010 }8011 writer.WriteXmlNodeEnd(name);8012};8013function CT_GroupLevels() {8014//Attributes8015 this.count = null;8016//Members8017 this.groupLevel = [];8018}8019CT_GroupLevels.prototype.readAttributes = function(attr, uq) {8020 if (attr()) {8021 var vals = attr();8022 var val;8023 val = vals["count"];8024 if (undefined !== val) {8025 this.count = val - 0;8026 }8027 }8028};8029CT_GroupLevels.prototype.onStartNode = function(elem, attr, uq) {8030 var newContext = this;8031 if ("groupLevel" === elem) {8032 newContext = new CT_GroupLevel();8033 if (newContext.readAttributes) {8034 newContext.readAttributes(attr, uq);8035 }8036 this.groupLevel.push(newContext);8037 } else {8038 newContext = null;8039 }8040 return newContext;8041};8042CT_GroupLevels.prototype.toXml = function(writer, name) {8043 writer.WriteXmlNodeStart(name);8044 if (null !== this.count) {8045 writer.WriteXmlAttributeNumber("count", this.count);8046 }8047 writer.WriteXmlNodeEnd(name, true);8048 for (var i = 0; i < this.groupLevel.length; ++i) {8049 var elem = this.groupLevel[i];8050 elem.toXml(writer, "groupLevel");8051 }8052 writer.WriteXmlNodeEnd(name);8053};8054function CT_Set() {8055//Attributes8056 this.count = null;8057 this.maxRank = null;8058 this.setDefinition = null;8059 this.sortType = null;//none8060 this.queryFailed = null;//false8061//Members8062 this.tpls = [];8063 this.sortByTuple = null;8064}8065CT_Set.prototype.readAttributes = function(attr, uq) {8066 if (attr()) {8067 var vals = attr();8068 var val;8069 val = vals["count"];8070 if (undefined !== val) {8071 this.count = val - 0;8072 }8073 val = vals["maxRank"];8074 if (undefined !== val) {8075 this.maxRank = val - 0;8076 }8077 val = vals["setDefinition"];8078 if (undefined !== val) {8079 this.setDefinition = uq(val);8080 }8081 val = vals["sortType"];8082 if (undefined !== val) {8083 val = FromXml_ST_SortType(val);8084 if (-1 !== val) {8085 this.sortType = val;8086 }8087 }8088 val = vals["queryFailed"];8089 if (undefined !== val) {8090 this.queryFailed = getBoolFromXml(val);8091 }8092 }8093};8094CT_Set.prototype.onStartNode = function(elem, attr, uq) {8095 var newContext = this;8096 if ("tpls" === elem) {8097 newContext = new CT_Tuples();8098 if (newContext.readAttributes) {8099 newContext.readAttributes(attr, uq);8100 }8101 this.tpls.push(newContext);8102 } else if ("sortByTuple" === elem) {8103 newContext = new CT_Tuples();8104 if (newContext.readAttributes) {8105 newContext.readAttributes(attr, uq);8106 }8107 this.sortByTuple = newContext;8108 } else {8109 newContext = null;8110 }8111 return newContext;8112};8113CT_Set.prototype.toXml = function(writer, name) {8114 writer.WriteXmlNodeStart(name);8115 if (null !== this.count) {8116 writer.WriteXmlAttributeNumber("count", this.count);8117 }8118 if (null !== this.maxRank) {8119 writer.WriteXmlAttributeNumber("maxRank", this.maxRank);8120 }8121 if (null !== this.setDefinition) {8122 writer.WriteXmlAttributeStringEncode("setDefinition", this.setDefinition);8123 }8124 if (null !== this.sortType) {8125 writer.WriteXmlAttributeStringEncode("sortType", ToXml_ST_SortType(this.sortType));8126 }8127 if (null !== this.queryFailed) {8128 writer.WriteXmlAttributeBool("queryFailed", this.queryFailed);8129 }8130 writer.WriteXmlNodeEnd(name, true);8131 for (var i = 0; i < this.tpls.length; ++i) {8132 var elem = this.tpls[i];8133 elem.toXml(writer, "tpls");8134 }8135 if (null !== this.sortByTuple) {8136 this.sortByTuple.toXml(writer, "sortByTuple");8137 }8138 writer.WriteXmlNodeEnd(name);8139};8140function CT_Query() {8141//Attributes8142 this.mdx = null;8143//Members8144 this.tpls = null;8145}8146CT_Query.prototype.readAttributes = function(attr, uq) {8147 if (attr()) {8148 var vals = attr();8149 var val;8150 val = vals["mdx"];8151 if (undefined !== val) {8152 this.mdx = uq(val);8153 }8154 }8155};8156CT_Query.prototype.onStartNode = function(elem, attr, uq) {8157 var newContext = this;8158 if ("tpls" === elem) {8159 newContext = new CT_Tuples();8160 if (newContext.readAttributes) {8161 newContext.readAttributes(attr, uq);8162 }8163 this.tpls = newContext;8164 } else {8165 newContext = null;8166 }8167 return newContext;8168};8169CT_Query.prototype.toXml = function(writer, name) {8170 writer.WriteXmlNodeStart(name);8171 if (null !== this.mdx) {8172 writer.WriteXmlAttributeStringEncode("mdx", this.mdx);8173 }8174 writer.WriteXmlNodeEnd(name, true);8175 if (null !== this.tpls) {8176 this.tpls.toXml(writer, "tpls");8177 }8178 writer.WriteXmlNodeEnd(name);8179};8180function CT_ServerFormat() {8181//Attributes8182 this.culture = null;8183 this.format = null;8184}8185CT_ServerFormat.prototype.readAttributes = function(attr, uq) {8186 if (attr()) {8187 var vals = attr();8188 var val;8189 val = vals["culture"];8190 if (undefined !== val) {8191 this.culture = uq(val);8192 }8193 val = vals["format"];8194 if (undefined !== val) {8195 this.format = uq(val);8196 }8197 }8198};8199CT_ServerFormat.prototype.toXml = function(writer, name) {8200 writer.WriteXmlNodeStart(name);8201 if (null !== this.culture) {8202 writer.WriteXmlAttributeStringEncode("culture", this.culture);8203 }8204 if (null !== this.format) {8205 writer.WriteXmlAttributeStringEncode("format", this.format);8206 }8207 writer.WriteXmlNodeEnd(name, true, true);8208};8209function CT_PivotArea() {8210//Attributes8211 this.field = null;8212 this.type = null;//normal8213 this.dataOnly = null;//true8214 this.labelOnly = null;//false8215 this.grandRow = null;//false8216 this.grandCol = null;//false8217 this.cacheIndex = null;//false8218 this.outline = null;//true8219 this.offset = null;8220 this.collapsedLevelsAreSubtotals = null;//false8221 this.axis = null;8222 this.fieldPosition = null;8223//Members8224 this.references = null;8225 this.extLst = null;8226}8227CT_PivotArea.prototype.readAttributes = function(attr, uq) {8228 if (attr()) {8229 var vals = attr();8230 var val;8231 val = vals["field"];8232 if (undefined !== val) {8233 this.field = val - 0;8234 }8235 val = vals["type"];8236 if (undefined !== val) {8237 val = FromXml_ST_PivotAreaType(val);8238 if (-1 !== val) {8239 this.type = val;8240 }8241 }8242 val = vals["dataOnly"];8243 if (undefined !== val) {8244 this.dataOnly = getBoolFromXml(val);8245 }8246 val = vals["labelOnly"];8247 if (undefined !== val) {8248 this.labelOnly = getBoolFromXml(val);8249 }8250 val = vals["grandRow"];8251 if (undefined !== val) {8252 this.grandRow = getBoolFromXml(val);8253 }8254 val = vals["grandCol"];8255 if (undefined !== val) {8256 this.grandCol = getBoolFromXml(val);8257 }8258 val = vals["cacheIndex"];8259 if (undefined !== val) {8260 this.cacheIndex = getBoolFromXml(val);8261 }8262 val = vals["outline"];8263 if (undefined !== val) {8264 this.outline = getBoolFromXml(val);8265 }8266 val = vals["offset"];8267 if (undefined !== val) {8268 this.offset = uq(val);8269 }8270 val = vals["collapsedLevelsAreSubtotals"];8271 if (undefined !== val) {8272 this.collapsedLevelsAreSubtotals = getBoolFromXml(val);8273 }8274 val = vals["axis"];8275 if (undefined !== val) {8276 val = FromXml_ST_Axis(val);8277 if (-1 !== val) {8278 this.axis = val;8279 }8280 }8281 val = vals["fieldPosition"];8282 if (undefined !== val) {8283 this.fieldPosition = val - 0;8284 }8285 }8286};8287CT_PivotArea.prototype.onStartNode = function(elem, attr, uq) {8288 var newContext = this;8289 if ("references" === elem) {8290 newContext = new CT_PivotAreaReferences();8291 if (newContext.readAttributes) {8292 newContext.readAttributes(attr, uq);8293 }8294 this.references = newContext;8295 } else if ("extLst" === elem) {8296 newContext = new CT_ExtensionList();8297 if (newContext.readAttributes) {8298 newContext.readAttributes(attr, uq);8299 }8300 this.extLst = newContext;8301 } else {8302 newContext = null;8303 }8304 return newContext;8305};8306CT_PivotArea.prototype.toXml = function(writer, name) {8307 writer.WriteXmlNodeStart(name);8308 if (null !== this.field) {8309 writer.WriteXmlAttributeNumber("field", this.field);8310 }8311 if (null !== this.type) {8312 writer.WriteXmlAttributeStringEncode("type", ToXml_ST_PivotAreaType(this.type));8313 }8314 if (null !== this.dataOnly) {8315 writer.WriteXmlAttributeBool("dataOnly", this.dataOnly);8316 }8317 if (null !== this.labelOnly) {8318 writer.WriteXmlAttributeBool("labelOnly", this.labelOnly);8319 }8320 if (null !== this.grandRow) {8321 writer.WriteXmlAttributeBool("grandRow", this.grandRow);8322 }8323 if (null !== this.grandCol) {8324 writer.WriteXmlAttributeBool("grandCol", this.grandCol);8325 }8326 if (null !== this.cacheIndex) {8327 writer.WriteXmlAttributeBool("cacheIndex", this.cacheIndex);8328 }8329 if (null !== this.outline) {8330 writer.WriteXmlAttributeBool("outline", this.outline);8331 }8332 if (null !== this.offset) {8333 writer.WriteXmlAttributeStringEncode("offset", this.offset);8334 }8335 if (null !== this.collapsedLevelsAreSubtotals) {8336 writer.WriteXmlAttributeBool("collapsedLevelsAreSubtotals", this.collapsedLevelsAreSubtotals);8337 }8338 if (null !== this.axis) {8339 writer.WriteXmlAttributeStringEncode("axis", ToXml_ST_Axis(this.axis));8340 }8341 if (null !== this.fieldPosition) {8342 writer.WriteXmlAttributeNumber("fieldPosition", this.fieldPosition);8343 }8344 writer.WriteXmlNodeEnd(name, true);8345 if (null !== this.references) {8346 this.references.toXml(writer, "references");8347 }8348 if (null !== this.extLst) {8349 this.extLst.toXml(writer, "extLst");8350 }8351 writer.WriteXmlNodeEnd(name);8352};8353function CT_Tuple() {8354//Attributes8355 this.fld = null;8356 this.hier = null;8357 this.item = null;8358}8359CT_Tuple.prototype.readAttributes = function(attr, uq) {8360 if (attr()) {8361 var vals = attr();8362 var val;8363 val = vals["fld"];8364 if (undefined !== val) {8365 this.fld = val - 0;8366 }8367 val = vals["hier"];8368 if (undefined !== val) {8369 this.hier = val - 0;8370 }8371 val = vals["item"];8372 if (undefined !== val) {8373 this.item = val - 0;8374 }8375 }8376};8377CT_Tuple.prototype.toXml = function(writer, name) {8378 writer.WriteXmlNodeStart(name);8379 if (null !== this.fld) {8380 writer.WriteXmlAttributeNumber("fld", this.fld);8381 }8382 if (null !== this.hier) {8383 writer.WriteXmlAttributeNumber("hier", this.hier);8384 }8385 if (null !== this.item) {8386 writer.WriteXmlAttributeNumber("item", this.item);8387 }8388 writer.WriteXmlNodeEnd(name, true, true);8389};8390function CT_Items() {8391//Attributes8392 this.count = null;8393//Members8394 this.item = [];8395}8396CT_Items.prototype.readAttributes = function(attr, uq) {8397 if (attr()) {8398 var vals = attr();8399 var val;8400 val = vals["count"];8401 if (undefined !== val) {8402 this.count = val - 0;8403 }8404 }8405};8406CT_Items.prototype.onStartNode = function(elem, attr, uq) {8407 var newContext = this;8408 if ("item" === elem) {8409 newContext = new CT_Item();8410 if (newContext.readAttributes) {8411 newContext.readAttributes(attr, uq);8412 }8413 this.item.push(newContext);8414 } else {8415 newContext = null;8416 }8417 return newContext;8418};8419CT_Items.prototype.toXml = function(writer, name) {8420 writer.WriteXmlNodeStart(name);8421 if (null !== this.count) {8422 writer.WriteXmlAttributeNumber("count", this.count);8423 }8424 writer.WriteXmlNodeEnd(name, true);8425 for (var i = 0; i < this.item.length; ++i) {8426 var elem = this.item[i];8427 elem.toXml(writer, "item");8428 }8429 writer.WriteXmlNodeEnd(name);8430};8431function CT_AutoSortScope() {8432//Members8433 this.pivotArea = null;8434}8435CT_AutoSortScope.prototype.onStartNode = function(elem, attr, uq) {8436 var newContext = this;8437 if ("pivotArea" === elem) {8438 newContext = new CT_PivotArea();8439 if (newContext.readAttributes) {8440 newContext.readAttributes(attr, uq);8441 }8442 this.pivotArea = newContext;8443 } else {8444 newContext = null;8445 }8446 return newContext;8447};8448CT_AutoSortScope.prototype.toXml = function(writer, name) {8449 writer.WriteXmlNodeStart(name);8450 writer.WriteXmlNodeEnd(name, true);8451 if (null !== this.pivotArea) {8452 this.pivotArea.toXml(writer, "pivotArea");8453 }8454 writer.WriteXmlNodeEnd(name);8455};8456function CT_PivotAreas() {8457//Attributes8458 this.count = null;8459//Members8460 this.pivotArea = [];8461}8462CT_PivotAreas.prototype.readAttributes = function(attr, uq) {8463 if (attr()) {8464 var vals = attr();8465 var val;8466 val = vals["count"];8467 if (undefined !== val) {8468 this.count = val - 0;8469 }8470 }8471};8472CT_PivotAreas.prototype.onStartNode = function(elem, attr, uq) {8473 var newContext = this;8474 if ("pivotArea" === elem) {8475 newContext = new CT_PivotArea();8476 if (newContext.readAttributes) {8477 newContext.readAttributes(attr, uq);8478 }8479 this.pivotArea.push(newContext);8480 } else {8481 newContext = null;8482 }8483 return newContext;8484};8485CT_PivotAreas.prototype.toXml = function(writer, name) {8486 writer.WriteXmlNodeStart(name);8487 if (null !== this.count) {8488 writer.WriteXmlAttributeNumber("count", this.count);8489 }8490 writer.WriteXmlNodeEnd(name, true);8491 for (var i = 0; i < this.pivotArea.length; ++i) {8492 var elem = this.pivotArea[i];8493 elem.toXml(writer, "pivotArea");8494 }8495 writer.WriteXmlNodeEnd(name);8496};8497function CT_MemberProperties() {8498//Attributes8499 this.count = null;8500//Members8501 this.mp = [];8502}8503CT_MemberProperties.prototype.readAttributes = function(attr, uq) {8504 if (attr()) {8505 var vals = attr();8506 var val;8507 val = vals["count"];8508 if (undefined !== val) {8509 this.count = val - 0;8510 }8511 }8512};8513CT_MemberProperties.prototype.onStartNode = function(elem, attr, uq) {8514 var newContext = this;8515 if ("mp" === elem) {8516 newContext = new CT_MemberProperty();8517 if (newContext.readAttributes) {8518 newContext.readAttributes(attr, uq);8519 }8520 this.mp.push(newContext);8521 } else {8522 newContext = null;8523 }8524 return newContext;8525};8526CT_MemberProperties.prototype.toXml = function(writer, name) {8527 writer.WriteXmlNodeStart(name);8528 if (null !== this.count) {8529 writer.WriteXmlAttributeNumber("count", this.count);8530 }8531 writer.WriteXmlNodeEnd(name, true);8532 for (var i = 0; i < this.mp.length; ++i) {8533 var elem = this.mp[i];8534 elem.toXml(writer, "mp");8535 }8536 writer.WriteXmlNodeEnd(name);8537};8538function CT_Members() {8539//Attributes8540 this.count = null;8541 this.level = null;8542//Members8543 this.member = [];8544}8545CT_Members.prototype.readAttributes = function(attr, uq) {8546 if (attr()) {8547 var vals = attr();8548 var val;8549 val = vals["count"];8550 if (undefined !== val) {8551 this.count = val - 0;8552 }8553 val = vals["level"];8554 if (undefined !== val) {8555 this.level = val - 0;8556 }8557 }8558};8559CT_Members.prototype.onStartNode = function(elem, attr, uq) {8560 var newContext = this;8561 if ("member" === elem) {8562 newContext = new CT_Member();8563 if (newContext.readAttributes) {8564 newContext.readAttributes(attr, uq);8565 }8566 this.member.push(newContext);8567 } else {8568 newContext = null;8569 }8570 return newContext;8571};8572CT_Members.prototype.toXml = function(writer, name) {8573 writer.WriteXmlNodeStart(name);8574 if (null !== this.count) {8575 writer.WriteXmlAttributeNumber("count", this.count);8576 }8577 if (null !== this.level) {8578 writer.WriteXmlAttributeNumber("level", this.level);8579 }8580 writer.WriteXmlNodeEnd(name, true);8581 for (var i = 0; i < this.member.length; ++i) {8582 var elem = this.member[i];8583 elem.toXml(writer, "member");8584 }8585 writer.WriteXmlNodeEnd(name);8586};8587function CT_AutoFilter() {8588//Attributes8589 this.ref = null;8590//Members8591 this.filterColumn = [];8592 this.sortState = null;8593 this.extLst = null;8594}8595CT_AutoFilter.prototype.readAttributes = function(attr, uq) {8596 if (attr()) {8597 var vals = attr();8598 var val;8599 val = vals["ref"];8600 if (undefined !== val) {8601 this.ref = uq(val);8602 }8603 }8604};8605CT_AutoFilter.prototype.onStartNode = function(elem, attr, uq) {8606 var newContext = this;8607 if ("filterColumn" === elem) {8608 newContext = new CT_FilterColumn();8609 if (newContext.readAttributes) {8610 newContext.readAttributes(attr, uq);8611 }8612 this.filterColumn.push(newContext);8613 } else if ("sortState" === elem) {8614 newContext = new CT_SortState();8615 if (newContext.readAttributes) {8616 newContext.readAttributes(attr, uq);8617 }8618 this.sortState = newContext;8619 } else if ("extLst" === elem) {8620 newContext = new CT_ExtensionList();8621 if (newContext.readAttributes) {8622 newContext.readAttributes(attr, uq);8623 }8624 this.extLst = newContext;8625 } else {8626 newContext = null;8627 }8628 return newContext;8629};8630CT_AutoFilter.prototype.toXml = function(writer, name) {8631 writer.WriteXmlNodeStart(name);8632 if (null !== this.ref) {8633 writer.WriteXmlAttributeStringEncode("ref", this.ref);8634 }8635 writer.WriteXmlNodeEnd(name, true);8636 for (var i = 0; i < this.filterColumn.length; ++i) {8637 var elem = this.filterColumn[i];8638 elem.toXml(writer, "filterColumn");8639 }8640 if (null !== this.sortState) {8641 this.sortState.toXml(writer, "sortState");8642 }8643 if (null !== this.extLst) {8644 this.extLst.toXml(writer, "extLst");8645 }8646 writer.WriteXmlNodeEnd(name);8647};8648function CT_PCDSCPage() {8649//Attributes8650 this.count = null;8651//Members8652 this.pageItem = [];8653}8654CT_PCDSCPage.prototype.readAttributes = function(attr, uq) {8655 if (attr()) {8656 var vals = attr();8657 var val;8658 val = vals["count"];8659 if (undefined !== val) {8660 this.count = val - 0;8661 }8662 }8663};8664CT_PCDSCPage.prototype.onStartNode = function(elem, attr, uq) {8665 var newContext = this;8666 if ("pageItem" === elem) {8667 newContext = new CT_PageItem();8668 if (newContext.readAttributes) {8669 newContext.readAttributes(attr, uq);8670 }8671 this.pageItem.push(newContext);8672 } else {8673 newContext = null;8674 }8675 return newContext;8676};8677CT_PCDSCPage.prototype.toXml = function(writer, name) {8678 writer.WriteXmlNodeStart(name);8679 if (null !== this.count) {8680 writer.WriteXmlAttributeNumber("count", this.count);8681 }8682 writer.WriteXmlNodeEnd(name, true);8683 for (var i = 0; i < this.pageItem.length; ++i) {8684 var elem = this.pageItem[i];8685 elem.toXml(writer, "pageItem");8686 }8687 writer.WriteXmlNodeEnd(name);8688};8689function CT_RangeSet() {8690//Attributes8691 this.i1 = null;8692 this.i2 = null;8693 this.i3 = null;8694 this.i4 = null;8695 this.ref = null;8696 this.name = null;8697 this.sheet = null;8698 this.id = null;8699}8700CT_RangeSet.prototype.readAttributes = function(attr, uq) {8701 if (attr()) {8702 var vals = attr();8703 var val;8704 val = vals["i1"];8705 if (undefined !== val) {8706 this.i1 = val - 0;8707 }8708 val = vals["i2"];8709 if (undefined !== val) {8710 this.i2 = val - 0;8711 }8712 val = vals["i3"];8713 if (undefined !== val) {8714 this.i3 = val - 0;8715 }8716 val = vals["i4"];8717 if (undefined !== val) {8718 this.i4 = val - 0;8719 }8720 val = vals["ref"];8721 if (undefined !== val) {8722 this.ref = uq(val);8723 }8724 val = vals["name"];8725 if (undefined !== val) {8726 this.name = uq(val);8727 }8728 val = vals["sheet"];8729 if (undefined !== val) {8730 this.sheet = uq(val);8731 }8732 val = vals["r:id"];8733 if (undefined !== val) {8734 this.id = uq(val);8735 }8736 }8737};8738CT_RangeSet.prototype.toXml = function(writer, name) {8739 writer.WriteXmlNodeStart(name);8740 if (null !== this.i1) {8741 writer.WriteXmlAttributeNumber("i1", this.i1);8742 }8743 if (null !== this.i2) {8744 writer.WriteXmlAttributeNumber("i2", this.i2);8745 }8746 if (null !== this.i3) {8747 writer.WriteXmlAttributeNumber("i3", this.i3);8748 }8749 if (null !== this.i4) {8750 writer.WriteXmlAttributeNumber("i4", this.i4);8751 }8752 if (null !== this.ref) {8753 writer.WriteXmlAttributeStringEncode("ref", this.ref);8754 }8755 if (null !== this.name) {8756 writer.WriteXmlAttributeStringEncode("name", this.name);8757 }8758 if (null !== this.sheet) {8759 writer.WriteXmlAttributeStringEncode("sheet", this.sheet);8760 }8761 //todo8762 // if (null !== this.id) {8763 // writer.WriteXmlAttributeStringEncode("r:id", this.id);8764 // }8765 writer.WriteXmlNodeEnd(name, true, true);8766};8767function CT_RangePr() {8768//Attributes8769 this.autoStart = null;//true8770 this.autoEnd = null;//true8771 this.groupBy = null;//range8772 this.startNum = null;8773 this.endNum = null;8774 this.startDate = null;8775 this.endDate = null;8776 this.groupInterval = null;//18777}8778CT_RangePr.prototype.readAttributes = function(attr, uq) {8779 if (attr()) {8780 var vals = attr();8781 var val;8782 val = vals["autoStart"];8783 if (undefined !== val) {8784 this.autoStart = getBoolFromXml(val);8785 }8786 val = vals["autoEnd"];8787 if (undefined !== val) {8788 this.autoEnd = getBoolFromXml(val);8789 }8790 val = vals["groupBy"];8791 if (undefined !== val) {8792 val = FromXml_ST_GroupBy(val);8793 if (-1 !== val) {8794 this.groupBy = val;8795 }8796 }8797 val = vals["startNum"];8798 if (undefined !== val) {8799 this.startNum = val - 0;8800 }8801 val = vals["endNum"];8802 if (undefined !== val) {8803 this.endNum = val - 0;8804 }8805 val = vals["startDate"];8806 if (undefined !== val) {8807 this.startDate = uq(val);8808 }8809 val = vals["endDate"];8810 if (undefined !== val) {8811 this.endDate = uq(val);8812 }8813 val = vals["groupInterval"];8814 if (undefined !== val) {8815 this.groupInterval = val - 0;8816 }8817 }8818};8819CT_RangePr.prototype.toXml = function(writer, name) {8820 writer.WriteXmlNodeStart(name);8821 if (null !== this.autoStart) {8822 writer.WriteXmlAttributeBool("autoStart", this.autoStart);8823 }8824 if (null !== this.autoEnd) {8825 writer.WriteXmlAttributeBool("autoEnd", this.autoEnd);8826 }8827 if (null !== this.groupBy) {8828 writer.WriteXmlAttributeStringEncode("groupBy", ToXml_ST_GroupBy(this.groupBy));8829 }8830 if (null !== this.startNum) {8831 writer.WriteXmlAttributeNumber("startNum", this.startNum);8832 }8833 if (null !== this.endNum) {8834 writer.WriteXmlAttributeNumber("endNum", this.endNum);8835 }8836 if (null !== this.startDate) {8837 writer.WriteXmlAttributeStringEncode("startDate", this.startDate);8838 }8839 if (null !== this.endDate) {8840 writer.WriteXmlAttributeStringEncode("endDate", this.endDate);8841 }8842 if (null !== this.groupInterval) {8843 writer.WriteXmlAttributeNumber("groupInterval", this.groupInterval);8844 }8845 writer.WriteXmlNodeEnd(name, true, true);8846};8847function CT_DiscretePr() {8848//Attributes8849 this.count = null;8850//Members8851 this.x = [];8852}8853CT_DiscretePr.prototype.readAttributes = function(attr, uq) {8854 if (attr()) {8855 var vals = attr();8856 var val;8857 val = vals["count"];8858 if (undefined !== val) {8859 this.count = val - 0;8860 }8861 }8862};8863CT_DiscretePr.prototype.onStartNode = function(elem, attr, uq) {8864 var newContext = this;8865 if ("x" === elem) {8866 newContext = new CT_Index();8867 if (newContext.readAttributes) {8868 newContext.readAttributes(attr, uq);8869 }8870 this.x.push(newContext);8871 } else {8872 newContext = null;8873 }8874 return newContext;8875};8876CT_DiscretePr.prototype.toXml = function(writer, name) {8877 writer.WriteXmlNodeStart(name);8878 if (null !== this.count) {8879 writer.WriteXmlAttributeNumber("count", this.count);8880 }8881 writer.WriteXmlNodeEnd(name, true);8882 for (var i = 0; i < this.x.length; ++i) {8883 var elem = this.x[i];8884 elem.toXml(writer, "x");8885 }8886 writer.WriteXmlNodeEnd(name);8887};8888function CT_GroupItems() {8889//Attributes8890 this.count = null;8891//Members8892 this.Items = new PivotRecords();8893}8894CT_GroupItems.prototype.readAttributes = function(attr, uq) {8895 if (attr()) {8896 var vals = attr();8897 var val;8898 val = vals["count"];8899 if (undefined !== val) {8900 this.count = val - 0;8901 this.Items.setStartCount(this.count);8902 }8903 }8904};8905CT_GroupItems.prototype.onStartNode = function(elem, attr, uq) {8906 var newContext = this;8907 var newContextCandidate = this.Items.onStartNode(elem, attr, uq);8908 if (newContextCandidate) {8909 newContext = newContextCandidate;8910 } else {8911 newContext = null;8912 }8913 return newContext;8914};8915CT_GroupItems.prototype.onEndNode = function(prevContext, elem) {8916 this.Items.onEndNode(prevContext, elem);8917};8918CT_GroupItems.prototype.toXml = function(writer, name) {8919 writer.WriteXmlNodeStart(name);8920 if (null !== this.count) {8921 writer.WriteXmlAttributeNumber("count", this.count);8922 }8923 writer.WriteXmlNodeEnd(name, true);8924 this.Items.toXml(writer);8925 writer.WriteXmlNodeEnd(name);8926};8927function CT_FieldUsage() {8928//Attributes8929 this.x = null;8930}8931CT_FieldUsage.prototype.readAttributes = function(attr, uq) {8932 if (attr()) {8933 var vals = attr();8934 var val;8935 val = vals["x"];8936 if (undefined !== val) {8937 this.x = val - 0;8938 }8939 }8940};8941CT_FieldUsage.prototype.toXml = function(writer, name) {8942 writer.WriteXmlNodeStart(name);8943 if (null !== this.x) {8944 writer.WriteXmlAttributeNumber("x", this.x);8945 }8946 writer.WriteXmlNodeEnd(name, true, true);8947};8948function CT_GroupLevel() {8949//Attributes8950 this.uniqueName = null;8951 this.caption = null;8952 this.user = null;//false8953 this.customRollUp = null;//false8954//Members8955 this.groups = null;8956 this.extLst = null;8957}8958CT_GroupLevel.prototype.readAttributes = function(attr, uq) {8959 if (attr()) {8960 var vals = attr();8961 var val;8962 val = vals["uniqueName"];8963 if (undefined !== val) {8964 this.uniqueName = uq(val);8965 }8966 val = vals["caption"];8967 if (undefined !== val) {8968 this.caption = uq(val);8969 }8970 val = vals["user"];8971 if (undefined !== val) {8972 this.user = getBoolFromXml(val);8973 }8974 val = vals["customRollUp"];8975 if (undefined !== val) {8976 this.customRollUp = getBoolFromXml(val);8977 }8978 }8979};8980CT_GroupLevel.prototype.onStartNode = function(elem, attr, uq) {8981 var newContext = this;8982 if ("groups" === elem) {8983 newContext = new CT_Groups();8984 if (newContext.readAttributes) {8985 newContext.readAttributes(attr, uq);8986 }8987 this.groups = newContext;8988 } else if ("extLst" === elem) {8989 newContext = new CT_ExtensionList();8990 if (newContext.readAttributes) {8991 newContext.readAttributes(attr, uq);8992 }8993 this.extLst = newContext;8994 } else {8995 newContext = null;8996 }8997 return newContext;8998};8999CT_GroupLevel.prototype.toXml = function(writer, name) {9000 writer.WriteXmlNodeStart(name);9001 if (null !== this.uniqueName) {9002 writer.WriteXmlAttributeStringEncode("uniqueName", this.uniqueName);9003 }9004 if (null !== this.caption) {9005 writer.WriteXmlAttributeStringEncode("caption", this.caption);9006 }9007 if (null !== this.user) {9008 writer.WriteXmlAttributeBool("user", this.user);9009 }9010 if (null !== this.customRollUp) {9011 writer.WriteXmlAttributeBool("customRollUp", this.customRollUp);9012 }9013 writer.WriteXmlNodeEnd(name, true);9014 if (null !== this.groups) {9015 this.groups.toXml(writer, "groups");9016 }9017 if (null !== this.extLst) {9018 this.extLst.toXml(writer, "extLst");9019 }9020 writer.WriteXmlNodeEnd(name);9021};9022function CT_PivotAreaReferences() {9023//Attributes9024 this.count = null;9025//Members9026 this.reference = [];9027}9028CT_PivotAreaReferences.prototype.readAttributes = function(attr, uq) {9029 if (attr()) {9030 var vals = attr();9031 var val;9032 val = vals["count"];9033 if (undefined !== val) {9034 this.count = val - 0;9035 }9036 }9037};9038CT_PivotAreaReferences.prototype.onStartNode = function(elem, attr, uq) {9039 var newContext = this;9040 if ("reference" === elem) {9041 newContext = new CT_PivotAreaReference();9042 if (newContext.readAttributes) {9043 newContext.readAttributes(attr, uq);9044 }9045 this.reference.push(newContext);9046 } else {9047 newContext = null;9048 }9049 return newContext;9050};9051CT_PivotAreaReferences.prototype.toXml = function(writer, name) {9052 writer.WriteXmlNodeStart(name);9053 if (null !== this.count) {9054 writer.WriteXmlAttributeNumber("count", this.count);9055 }9056 writer.WriteXmlNodeEnd(name, true);9057 for (var i = 0; i < this.reference.length; ++i) {9058 var elem = this.reference[i];9059 elem.toXml(writer, "reference");9060 }9061 writer.WriteXmlNodeEnd(name);9062};9063function CT_Item() {9064//Attributes9065 this.n = null;9066 this.t = null;//data9067 this.h = null;//false9068 this.s = null;//false9069 this.sd = null;//true9070 this.f = null;//false9071 this.m = null;//false9072 this.c = null;//false9073 this.x = null;9074 this.d = null;//false9075 this.e = null;//true9076}9077CT_Item.prototype.readAttributes = function(attr, uq) {9078 if (attr()) {9079 var vals = attr();9080 var val;9081 val = vals["n"];9082 if (undefined !== val) {9083 this.n = uq(val);9084 }9085 val = vals["t"];9086 if (undefined !== val) {9087 val = FromXml_ST_ItemType(val);9088 if (-1 !== val) {9089 this.t = val;9090 }9091 }9092 val = vals["h"];9093 if (undefined !== val) {9094 this.h = getBoolFromXml(val);9095 }9096 val = vals["s"];9097 if (undefined !== val) {9098 this.s = getBoolFromXml(val);9099 }9100 val = vals["sd"];9101 if (undefined !== val) {9102 this.sd = getBoolFromXml(val);9103 }9104 val = vals["f"];9105 if (undefined !== val) {9106 this.f = getBoolFromXml(val);9107 }9108 val = vals["m"];9109 if (undefined !== val) {9110 this.m = getBoolFromXml(val);9111 }9112 val = vals["c"];9113 if (undefined !== val) {9114 this.c = getBoolFromXml(val);9115 }9116 val = vals["x"];9117 if (undefined !== val) {9118 this.x = val - 0;9119 }9120 val = vals["d"];9121 if (undefined !== val) {9122 this.d = getBoolFromXml(val);9123 }9124 val = vals["e"];9125 if (undefined !== val) {9126 this.e = getBoolFromXml(val);9127 }9128 }9129};9130CT_Item.prototype.toXml = function(writer, name) {9131 writer.WriteXmlNodeStart(name);9132 if (null !== this.n) {9133 writer.WriteXmlAttributeStringEncode("n", this.n);9134 }9135 if (null !== this.t) {9136 writer.WriteXmlAttributeStringEncode("t", ToXml_ST_ItemType(this.t));9137 }9138 if (null !== this.h) {9139 writer.WriteXmlAttributeBool("h", this.h);9140 }9141 if (null !== this.s) {9142 writer.WriteXmlAttributeBool("s", this.s);9143 }9144 if (null !== this.sd) {9145 writer.WriteXmlAttributeBool("sd", this.sd);9146 }9147 if (null !== this.f) {9148 writer.WriteXmlAttributeBool("f", this.f);9149 }9150 if (null !== this.m) {9151 writer.WriteXmlAttributeBool("m", this.m);9152 }9153 if (null !== this.c) {9154 writer.WriteXmlAttributeBool("c", this.c);9155 }9156 if (null !== this.x) {9157 writer.WriteXmlAttributeNumber("x", this.x);9158 }9159 if (null !== this.d) {9160 writer.WriteXmlAttributeBool("d", this.d);9161 }9162 if (null !== this.e) {9163 writer.WriteXmlAttributeBool("e", this.e);9164 }9165 writer.WriteXmlNodeEnd(name, true, true);9166};9167function CT_MemberProperty() {9168//Attributes9169 this.name = null;9170 this.showCell = null;//false9171 this.showTip = null;//false9172 this.showAsCaption = null;//false9173 this.nameLen = null;9174 this.pPos = null;9175 this.pLen = null;9176 this.level = null;9177 this.field = null;9178}9179CT_MemberProperty.prototype.readAttributes = function(attr, uq) {9180 if (attr()) {9181 var vals = attr();9182 var val;9183 val = vals["name"];9184 if (undefined !== val) {9185 this.name = uq(val);9186 }9187 val = vals["showCell"];9188 if (undefined !== val) {9189 this.showCell = getBoolFromXml(val);9190 }9191 val = vals["showTip"];9192 if (undefined !== val) {9193 this.showTip = getBoolFromXml(val);9194 }9195 val = vals["showAsCaption"];9196 if (undefined !== val) {9197 this.showAsCaption = getBoolFromXml(val);9198 }9199 val = vals["nameLen"];9200 if (undefined !== val) {9201 this.nameLen = val - 0;9202 }9203 val = vals["pPos"];9204 if (undefined !== val) {9205 this.pPos = val - 0;9206 }9207 val = vals["pLen"];9208 if (undefined !== val) {9209 this.pLen = val - 0;9210 }9211 val = vals["level"];9212 if (undefined !== val) {9213 this.level = val - 0;9214 }9215 val = vals["field"];9216 if (undefined !== val) {9217 this.field = val - 0;9218 }9219 }9220};9221CT_MemberProperty.prototype.toXml = function(writer, name) {9222 writer.WriteXmlNodeStart(name);9223 if (null !== this.name) {9224 writer.WriteXmlAttributeStringEncode("name", this.name);9225 }9226 if (null !== this.showCell) {9227 writer.WriteXmlAttributeBool("showCell", this.showCell);9228 }9229 if (null !== this.showTip) {9230 writer.WriteXmlAttributeBool("showTip", this.showTip);9231 }9232 if (null !== this.showAsCaption) {9233 writer.WriteXmlAttributeBool("showAsCaption", this.showAsCaption);9234 }9235 if (null !== this.nameLen) {9236 writer.WriteXmlAttributeNumber("nameLen", this.nameLen);9237 }9238 if (null !== this.pPos) {9239 writer.WriteXmlAttributeNumber("pPos", this.pPos);9240 }9241 if (null !== this.pLen) {9242 writer.WriteXmlAttributeNumber("pLen", this.pLen);9243 }9244 if (null !== this.level) {9245 writer.WriteXmlAttributeNumber("level", this.level);9246 }9247 if (null !== this.field) {9248 writer.WriteXmlAttributeNumber("field", this.field);9249 }9250 writer.WriteXmlNodeEnd(name, true, true);9251};9252function CT_Member() {9253//Attributes9254 this.name = null;9255}9256CT_Member.prototype.readAttributes = function(attr, uq) {9257 if (attr()) {9258 var vals = attr();9259 var val;9260 val = vals["name"];9261 if (undefined !== val) {9262 this.name = uq(val);9263 }9264 }9265};9266CT_Member.prototype.toXml = function(writer, name) {9267 writer.WriteXmlNodeStart(name);9268 if (null !== this.name) {9269 writer.WriteXmlAttributeStringEncode("name", this.name);9270 }9271 writer.WriteXmlNodeEnd(name, true, true);9272};9273function CT_FilterColumn() {9274//Attributes9275 this.colId = null;9276 this.hiddenButton = null;//false9277 this.showButton = null;//true9278//Members9279 this.colorFilter = null;9280 this.customFilters = null;9281 this.dynamicFilter = null;9282 this.extLst = null;9283 this.filters = null;9284 this.iconFilter = null;9285 this.top10 = null;9286}9287CT_FilterColumn.prototype.readAttributes = function(attr, uq) {9288 if (attr()) {9289 var vals = attr();9290 var val;9291 val = vals["colId"];9292 if (undefined !== val) {9293 this.colId = val - 0;9294 }9295 val = vals["hiddenButton"];9296 if (undefined !== val) {9297 this.hiddenButton = getBoolFromXml(val);9298 }9299 val = vals["showButton"];9300 if (undefined !== val) {9301 this.showButton = getBoolFromXml(val);9302 }9303 }9304};9305CT_FilterColumn.prototype.onStartNode = function(elem, attr, uq) {9306 var newContext = this;9307 if ("colorFilter" === elem) {9308 newContext = new CT_ColorFilter();9309 if (newContext.readAttributes) {9310 newContext.readAttributes(attr, uq);9311 }9312 this.colorFilter = newContext;9313 } else if ("customFilters" === elem) {9314 newContext = new CT_CustomFilters();9315 if (newContext.readAttributes) {9316 newContext.readAttributes(attr, uq);9317 }9318 this.customFilters = newContext;9319 } else if ("dynamicFilter" === elem) {9320 newContext = new CT_DynamicFilter();9321 if (newContext.readAttributes) {9322 newContext.readAttributes(attr, uq);9323 }9324 this.dynamicFilter = newContext;9325 } else if ("extLst" === elem) {9326 newContext = new CT_ExtensionList();9327 if (newContext.readAttributes) {9328 newContext.readAttributes(attr, uq);9329 }9330 this.extLst = newContext;9331 } else if ("filters" === elem) {9332 newContext = new CT_Filters();9333 if (newContext.readAttributes) {9334 newContext.readAttributes(attr, uq);9335 }9336 this.filters = newContext;9337 } else if ("iconFilter" === elem) {9338 newContext = new CT_IconFilter();9339 if (newContext.readAttributes) {9340 newContext.readAttributes(attr, uq);9341 }9342 this.iconFilter = newContext;9343 } else if ("top10" === elem) {9344 newContext = new CT_Top10();9345 if (newContext.readAttributes) {9346 newContext.readAttributes(attr, uq);9347 }9348 this.top10 = newContext;9349 } else {9350 newContext = null;9351 }9352 return newContext;9353};9354CT_FilterColumn.prototype.toXml = function(writer, name) {9355 writer.WriteXmlNodeStart(name);9356 if (null !== this.colId) {9357 writer.WriteXmlAttributeNumber("colId", this.colId);9358 }9359 if (null !== this.hiddenButton) {9360 writer.WriteXmlAttributeBool("hiddenButton", this.hiddenButton);9361 }9362 if (null !== this.showButton) {9363 writer.WriteXmlAttributeBool("showButton", this.showButton);9364 }9365 writer.WriteXmlNodeEnd(name, true);9366 if (null !== this.colorFilter) {9367 this.colorFilter.toXml(writer, "colorFilter");9368 }9369 if (null !== this.customFilters) {9370 this.customFilters.toXml(writer, "customFilters");9371 }9372 if (null !== this.dynamicFilter) {9373 this.dynamicFilter.toXml(writer, "dynamicFilter");9374 }9375 if (null !== this.extLst) {9376 this.extLst.toXml(writer, "extLst");9377 }9378 if (null !== this.filters) {9379 this.filters.toXml(writer, "filters");9380 }9381 if (null !== this.iconFilter) {9382 this.iconFilter.toXml(writer, "iconFilter");9383 }9384 if (null !== this.top10) {9385 this.top10.toXml(writer, "top10");9386 }9387 writer.WriteXmlNodeEnd(name);9388};9389function CT_SortState() {9390//Attributes9391 this.columnSort = null;//false9392 this.caseSensitive = null;//false9393 this.sortMethod = null;//none9394 this.ref = null;9395//Members9396 this.sortCondition = [];9397 this.extLst = null;9398}9399CT_SortState.prototype.readAttributes = function(attr, uq) {9400 if (attr()) {9401 var vals = attr();9402 var val;9403 val = vals["columnSort"];9404 if (undefined !== val) {9405 this.columnSort = getBoolFromXml(val);9406 }9407 val = vals["caseSensitive"];9408 if (undefined !== val) {9409 this.caseSensitive = getBoolFromXml(val);9410 }9411 val = vals["sortMethod"];9412 if (undefined !== val) {9413 val = FromXml_ST_SortMethod(val);9414 if (-1 !== val) {9415 this.sortMethod = val;9416 }9417 }9418 val = vals["ref"];9419 if (undefined !== val) {9420 this.ref = uq(val);9421 }9422 }9423};9424CT_SortState.prototype.onStartNode = function(elem, attr, uq) {9425 var newContext = this;9426 if ("sortCondition" === elem) {9427 newContext = new CT_SortCondition();9428 if (newContext.readAttributes) {9429 newContext.readAttributes(attr, uq);9430 }9431 this.sortCondition.push(newContext);9432 } else if ("extLst" === elem) {9433 newContext = new CT_ExtensionList();9434 if (newContext.readAttributes) {9435 newContext.readAttributes(attr, uq);9436 }9437 this.extLst = newContext;9438 } else {9439 newContext = null;9440 }9441 return newContext;9442};9443CT_SortState.prototype.toXml = function(writer, name) {9444 writer.WriteXmlNodeStart(name);9445 if (null !== this.columnSort) {9446 writer.WriteXmlAttributeBool("columnSort", this.columnSort);9447 }9448 if (null !== this.caseSensitive) {9449 writer.WriteXmlAttributeBool("caseSensitive", this.caseSensitive);9450 }9451 if (null !== this.sortMethod) {9452 writer.WriteXmlAttributeStringEncode("sortMethod", ToXml_ST_SortMethod(this.sortMethod));9453 }9454 if (null !== this.ref) {9455 writer.WriteXmlAttributeStringEncode("ref", this.ref);9456 }9457 writer.WriteXmlNodeEnd(name, true);9458 for (var i = 0; i < this.sortCondition.length; ++i) {9459 var elem = this.sortCondition[i];9460 elem.toXml(writer, "sortCondition");9461 }9462 if (null !== this.extLst) {9463 this.extLst.toXml(writer, "extLst");9464 }9465 writer.WriteXmlNodeEnd(name);9466};9467function CT_PageItem() {9468//Attributes9469 this.name = null;9470}9471CT_PageItem.prototype.readAttributes = function(attr, uq) {9472 if (attr()) {9473 var vals = attr();9474 var val;9475 val = vals["name"];9476 if (undefined !== val) {9477 this.name = uq(val);9478 }9479 }9480};9481CT_PageItem.prototype.toXml = function(writer, name) {9482 writer.WriteXmlNodeStart(name);9483 if (null !== this.name) {9484 writer.WriteXmlAttributeStringEncode("name", this.name);9485 }9486 writer.WriteXmlNodeEnd(name, true, true);9487};9488function CT_Groups() {9489//Attributes9490 this.count = null;9491//Members9492 this.group = [];9493}9494CT_Groups.prototype.readAttributes = function(attr, uq) {9495 if (attr()) {9496 var vals = attr();9497 var val;9498 val = vals["count"];9499 if (undefined !== val) {9500 this.count = val - 0;9501 }9502 }9503};9504CT_Groups.prototype.onStartNode = function(elem, attr, uq) {9505 var newContext = this;9506 if ("group" === elem) {9507 newContext = new CT_LevelGroup();9508 if (newContext.readAttributes) {9509 newContext.readAttributes(attr, uq);9510 }9511 this.group.push(newContext);9512 } else {9513 newContext = null;9514 }9515 return newContext;9516};9517CT_Groups.prototype.toXml = function(writer, name) {9518 writer.WriteXmlNodeStart(name);9519 if (null !== this.count) {9520 writer.WriteXmlAttributeNumber("count", this.count);9521 }9522 writer.WriteXmlNodeEnd(name, true);9523 for (var i = 0; i < this.group.length; ++i) {9524 var elem = this.group[i];9525 elem.toXml(writer, "group");9526 }9527 writer.WriteXmlNodeEnd(name);9528};9529function CT_PivotAreaReference() {9530//Attributes9531 this.field = null;9532 this.count = null;9533 this.selected = null;//true9534 this.byPosition = null;//false9535 this.relative = null;//false9536 this.defaultSubtotal = null;//false9537 this.sumSubtotal = null;//false9538 this.countASubtotal = null;//false9539 this.avgSubtotal = null;//false9540 this.maxSubtotal = null;//false9541 this.minSubtotal = null;//false9542 this.productSubtotal = null;//false9543 this.countSubtotal = null;//false9544 this.stdDevSubtotal = null;//false9545 this.stdDevPSubtotal = null;//false9546 this.varSubtotal = null;//false9547 this.varPSubtotal = null;//false9548//Members9549 this.x = [];9550 this.extLst = null;9551}9552CT_PivotAreaReference.prototype.readAttributes = function(attr, uq) {9553 if (attr()) {9554 var vals = attr();9555 var val;9556 val = vals["field"];9557 if (undefined !== val) {9558 this.field = val - 0;9559 }9560 val = vals["count"];9561 if (undefined !== val) {9562 this.count = val - 0;9563 }9564 val = vals["selected"];9565 if (undefined !== val) {9566 this.selected = getBoolFromXml(val);9567 }9568 val = vals["byPosition"];9569 if (undefined !== val) {9570 this.byPosition = getBoolFromXml(val);9571 }9572 val = vals["relative"];9573 if (undefined !== val) {9574 this.relative = getBoolFromXml(val);9575 }9576 val = vals["defaultSubtotal"];9577 if (undefined !== val) {9578 this.defaultSubtotal = getBoolFromXml(val);9579 }9580 val = vals["sumSubtotal"];9581 if (undefined !== val) {9582 this.sumSubtotal = getBoolFromXml(val);9583 }9584 val = vals["countASubtotal"];9585 if (undefined !== val) {9586 this.countASubtotal = getBoolFromXml(val);9587 }9588 val = vals["avgSubtotal"];9589 if (undefined !== val) {9590 this.avgSubtotal = getBoolFromXml(val);9591 }9592 val = vals["maxSubtotal"];9593 if (undefined !== val) {9594 this.maxSubtotal = getBoolFromXml(val);9595 }9596 val = vals["minSubtotal"];9597 if (undefined !== val) {9598 this.minSubtotal = getBoolFromXml(val);9599 }9600 val = vals["productSubtotal"];9601 if (undefined !== val) {9602 this.productSubtotal = getBoolFromXml(val);9603 }9604 val = vals["countSubtotal"];9605 if (undefined !== val) {9606 this.countSubtotal = getBoolFromXml(val);9607 }9608 val = vals["stdDevSubtotal"];9609 if (undefined !== val) {9610 this.stdDevSubtotal = getBoolFromXml(val);9611 }9612 val = vals["stdDevPSubtotal"];9613 if (undefined !== val) {9614 this.stdDevPSubtotal = getBoolFromXml(val);9615 }9616 val = vals["varSubtotal"];9617 if (undefined !== val) {9618 this.varSubtotal = getBoolFromXml(val);9619 }9620 val = vals["varPSubtotal"];9621 if (undefined !== val) {9622 this.varPSubtotal = getBoolFromXml(val);9623 }9624 }9625};9626CT_PivotAreaReference.prototype.onStartNode = function(elem, attr, uq) {9627 var newContext = this;9628 if ("x" === elem) {9629 newContext = new CT_Index();9630 if (newContext.readAttributes) {9631 newContext.readAttributes(attr, uq);9632 }9633 this.x.push(newContext);9634 } else if ("extLst" === elem) {9635 newContext = new CT_ExtensionList();9636 if (newContext.readAttributes) {9637 newContext.readAttributes(attr, uq);9638 }9639 this.extLst = newContext;9640 } else {9641 newContext = null;9642 }9643 return newContext;9644};9645CT_PivotAreaReference.prototype.toXml = function(writer, name) {9646 writer.WriteXmlNodeStart(name);9647 if (null !== this.field) {9648 writer.WriteXmlAttributeNumber("field", this.field);9649 }9650 if (null !== this.count) {9651 writer.WriteXmlAttributeNumber("count", this.count);9652 }9653 if (null !== this.selected) {9654 writer.WriteXmlAttributeBool("selected", this.selected);9655 }9656 if (null !== this.byPosition) {9657 writer.WriteXmlAttributeBool("byPosition", this.byPosition);9658 }9659 if (null !== this.relative) {9660 writer.WriteXmlAttributeBool("relative", this.relative);9661 }9662 if (null !== this.defaultSubtotal) {9663 writer.WriteXmlAttributeBool("defaultSubtotal", this.defaultSubtotal);9664 }9665 if (null !== this.sumSubtotal) {9666 writer.WriteXmlAttributeBool("sumSubtotal", this.sumSubtotal);9667 }9668 if (null !== this.countASubtotal) {9669 writer.WriteXmlAttributeBool("countASubtotal", this.countASubtotal);9670 }9671 if (null !== this.avgSubtotal) {9672 writer.WriteXmlAttributeBool("avgSubtotal", this.avgSubtotal);9673 }9674 if (null !== this.maxSubtotal) {9675 writer.WriteXmlAttributeBool("maxSubtotal", this.maxSubtotal);9676 }9677 if (null !== this.minSubtotal) {9678 writer.WriteXmlAttributeBool("minSubtotal", this.minSubtotal);9679 }9680 if (null !== this.productSubtotal) {9681 writer.WriteXmlAttributeBool("productSubtotal", this.productSubtotal);9682 }9683 if (null !== this.countSubtotal) {9684 writer.WriteXmlAttributeBool("countSubtotal", this.countSubtotal);9685 }9686 if (null !== this.stdDevSubtotal) {9687 writer.WriteXmlAttributeBool("stdDevSubtotal", this.stdDevSubtotal);9688 }9689 if (null !== this.stdDevPSubtotal) {9690 writer.WriteXmlAttributeBool("stdDevPSubtotal", this.stdDevPSubtotal);9691 }9692 if (null !== this.varSubtotal) {9693 writer.WriteXmlAttributeBool("varSubtotal", this.varSubtotal);9694 }9695 if (null !== this.varPSubtotal) {9696 writer.WriteXmlAttributeBool("varPSubtotal", this.varPSubtotal);9697 }9698 writer.WriteXmlNodeEnd(name, true);9699 for (var i = 0; i < this.x.length; ++i) {9700 var elem = this.x[i];9701 elem.toXml(writer, "x");9702 }9703 if (null !== this.extLst) {9704 this.extLst.toXml(writer, "extLst");9705 }9706 writer.WriteXmlNodeEnd(name);9707};9708function CT_ColorFilter() {9709//Attributes9710 this.dxfId = null;9711 this.cellColor = null;//true9712}9713CT_ColorFilter.prototype.readAttributes = function(attr, uq) {9714 if (attr()) {9715 var vals = attr();9716 var val;9717 val = vals["dxfId"];9718 if (undefined !== val) {9719 this.dxfId = val - 0;9720 }9721 val = vals["cellColor"];9722 if (undefined !== val) {9723 this.cellColor = getBoolFromXml(val);9724 }9725 }9726};9727CT_ColorFilter.prototype.toXml = function(writer, name) {9728 writer.WriteXmlNodeStart(name);9729 //todo9730 // if (null !== this.dxfId) {9731 // writer.WriteXmlAttributeNumber("dxfId", this.dxfId);9732 // }9733 if (null !== this.cellColor) {9734 writer.WriteXmlAttributeBool("cellColor", this.cellColor);9735 }9736 writer.WriteXmlNodeEnd(name, true, true);9737};9738function CT_CustomFilters() {9739//Attributes9740 this.and = null;//false9741//Members9742 this.customFilter = [];9743}9744CT_CustomFilters.prototype.readAttributes = function(attr, uq) {9745 if (attr()) {9746 var vals = attr();9747 var val;9748 val = vals["and"];9749 if (undefined !== val) {9750 this.and = getBoolFromXml(val);9751 }9752 }9753};9754CT_CustomFilters.prototype.onStartNode = function(elem, attr, uq) {9755 var newContext = this;9756 if ("customFilter" === elem) {9757 newContext = new CT_CustomFilter();9758 if (newContext.readAttributes) {9759 newContext.readAttributes(attr, uq);9760 }9761 this.customFilter.push(newContext);9762 } else {9763 newContext = null;9764 }9765 return newContext;9766};9767CT_CustomFilters.prototype.toXml = function(writer, name) {9768 writer.WriteXmlNodeStart(name);9769 if (null !== this.and) {9770 writer.WriteXmlAttributeBool("and", this.and);9771 }9772 writer.WriteXmlNodeEnd(name, true);9773 for (var i = 0; i < this.customFilter.length; ++i) {9774 var elem = this.customFilter[i];9775 elem.toXml(writer, "customFilter");9776 }9777 writer.WriteXmlNodeEnd(name);9778};9779function CT_DynamicFilter() {9780//Attributes9781 this.type = null;9782 this.val = null;9783 this.valIso = null;9784 this.maxValIso = null;9785}9786CT_DynamicFilter.prototype.readAttributes = function(attr, uq) {9787 if (attr()) {9788 var vals = attr();9789 var val;9790 val = vals["type"];9791 if (undefined !== val) {9792 val = FromXml_ST_DynamicFilterType(val);9793 if (-1 !== val) {9794 this.type = val;9795 }9796 }9797 val = vals["val"];9798 if (undefined !== val) {9799 this.val = val - 0;9800 }9801 val = vals["valIso"];9802 if (undefined !== val) {9803 this.valIso = uq(val);9804 }9805 val = vals["maxValIso"];9806 if (undefined !== val) {9807 this.maxValIso = uq(val);9808 }9809 }9810};9811CT_DynamicFilter.prototype.toXml = function(writer, name) {9812 writer.WriteXmlNodeStart(name);9813 if (null !== this.type) {9814 writer.WriteXmlAttributeStringEncode("type", ToXml_ST_DynamicFilterType(this.type));9815 }9816 if (null !== this.val) {9817 writer.WriteXmlAttributeNumber("val", this.val);9818 }9819 if (null !== this.valIso) {9820 writer.WriteXmlAttributeStringEncode("valIso", this.valIso);9821 }9822 if (null !== this.maxValIso) {9823 writer.WriteXmlAttributeStringEncode("maxValIso", this.maxValIso);9824 }9825 writer.WriteXmlNodeEnd(name, true, true);9826};9827function CT_Filters() {9828//Attributes9829 this.blank = null;//false9830 this.calendarType = null;//none9831//Members9832 this.filter = [];9833 this.dateGroupItem = [];9834}9835CT_Filters.prototype.readAttributes = function(attr, uq) {9836 if (attr()) {9837 var vals = attr();9838 var val;9839 val = vals["blank"];9840 if (undefined !== val) {9841 this.blank = getBoolFromXml(val);9842 }9843 val = vals["calendarType"];9844 if (undefined !== val) {9845 val = FromXml_ST_CalendarType(val);9846 if (-1 !== val) {9847 this.calendarType = val;9848 }9849 }9850 }9851};9852CT_Filters.prototype.onStartNode = function(elem, attr, uq) {9853 var newContext = this;9854 if ("filter" === elem) {9855 newContext = new CT_Filter();9856 if (newContext.readAttributes) {9857 newContext.readAttributes(attr, uq);9858 }9859 this.filter.push(newContext);9860 } else if ("dateGroupItem" === elem) {9861 newContext = new CT_DateGroupItem();9862 if (newContext.readAttributes) {9863 newContext.readAttributes(attr, uq);9864 }9865 this.dateGroupItem.push(newContext);9866 } else {9867 newContext = null;9868 }9869 return newContext;9870};9871CT_Filters.prototype.toXml = function(writer, name) {9872 writer.WriteXmlNodeStart(name);9873 if (null !== this.blank) {9874 writer.WriteXmlAttributeBool("blank", this.blank);9875 }9876 if (null !== this.calendarType) {9877 writer.WriteXmlAttributeStringEncode("calendarType", ToXml_ST_CalendarType(this.calendarType));9878 }9879 writer.WriteXmlNodeEnd(name, true);9880 for (var i = 0; i < this.filter.length; ++i) {9881 var elem = this.filter[i];9882 elem.toXml(writer, "filter");9883 }9884 for (var i = 0; i < this.dateGroupItem.length; ++i) {9885 var elem = this.dateGroupItem[i];9886 elem.toXml(writer, "dateGroupItem");9887 }9888 writer.WriteXmlNodeEnd(name);9889};9890function CT_IconFilter() {9891//Attributes9892 this.iconSet = null;9893 this.iconId = null;9894}9895CT_IconFilter.prototype.readAttributes = function(attr, uq) {9896 if (attr()) {9897 var vals = attr();9898 var val;9899 val = vals["iconSet"];9900 if (undefined !== val) {9901 val = FromXml_ST_IconSetType(val);9902 if (-1 !== val) {9903 this.iconSet = val;9904 }9905 }9906 val = vals["iconId"];9907 if (undefined !== val) {9908 this.iconId = val - 0;9909 }9910 }9911};9912CT_IconFilter.prototype.toXml = function(writer, name) {9913 writer.WriteXmlNodeStart(name);9914 if (null !== this.iconSet) {9915 writer.WriteXmlAttributeStringEncode("iconSet", ToXml_ST_IconSetType(this.iconSet));9916 }9917 if (null !== this.iconId) {9918 writer.WriteXmlAttributeNumber("iconId", this.iconId);9919 }9920 writer.WriteXmlNodeEnd(name, true, true);9921};9922function CT_Top10() {9923//Attributes9924 this.top = null;//true9925 this.percent = null;//false9926 this.val = null;9927 this.filterVal = null;9928}9929CT_Top10.prototype.readAttributes = function(attr, uq) {9930 if (attr()) {9931 var vals = attr();9932 var val;9933 val = vals["top"];9934 if (undefined !== val) {9935 this.top = getBoolFromXml(val);9936 }9937 val = vals["percent"];9938 if (undefined !== val) {9939 this.percent = getBoolFromXml(val);9940 }9941 val = vals["val"];9942 if (undefined !== val) {9943 this.val = val - 0;9944 }9945 val = vals["filterVal"];9946 if (undefined !== val) {9947 this.filterVal = val - 0;9948 }9949 }9950};9951CT_Top10.prototype.toXml = function(writer, name) {9952 writer.WriteXmlNodeStart(name);9953 if (null !== this.top) {9954 writer.WriteXmlAttributeBool("top", this.top);9955 }9956 if (null !== this.percent) {9957 writer.WriteXmlAttributeBool("percent", this.percent);9958 }9959 if (null !== this.val) {9960 writer.WriteXmlAttributeNumber("val", this.val);9961 }9962 if (null !== this.filterVal) {9963 writer.WriteXmlAttributeNumber("filterVal", this.filterVal);9964 }9965 writer.WriteXmlNodeEnd(name, true, true);9966};9967function CT_SortCondition() {9968//Attributes9969 this.descending = null;//false9970 this.sortBy = null;//value9971 this.ref = null;9972 this.customList = null;9973 this.dxfId = null;9974 this.iconSet = null;//item3arrows9975 this.iconId = null;9976}9977CT_SortCondition.prototype.readAttributes = function(attr, uq) {9978 if (attr()) {9979 var vals = attr();9980 var val;9981 val = vals["descending"];9982 if (undefined !== val) {9983 this.descending = getBoolFromXml(val);9984 }9985 val = vals["sortBy"];9986 if (undefined !== val) {9987 val = FromXml_ST_SortBy(val);9988 if (-1 !== val) {9989 this.sortBy = val;9990 }9991 }9992 val = vals["ref"];9993 if (undefined !== val) {9994 this.ref = uq(val);9995 }9996 val = vals["customList"];9997 if (undefined !== val) {9998 this.customList = uq(val);9999 }10000 val = vals["dxfId"];10001 if (undefined !== val) {10002 this.dxfId = val - 0;10003 }10004 val = vals["iconSet"];10005 if (undefined !== val) {10006 val = FromXml_ST_IconSetType(val);10007 if (-1 !== val) {10008 this.iconSet = val;10009 }10010 }10011 val = vals["iconId"];10012 if (undefined !== val) {10013 this.iconId = val - 0;10014 }10015 }10016};10017CT_SortCondition.prototype.toXml = function(writer, name) {10018 writer.WriteXmlNodeStart(name);10019 if (null !== this.descending) {10020 writer.WriteXmlAttributeBool("descending", this.descending);10021 }10022 if (null !== this.sortBy) {10023 writer.WriteXmlAttributeStringEncode("sortBy", ToXml_ST_SortBy(this.sortBy));10024 }10025 if (null !== this.ref) {10026 writer.WriteXmlAttributeStringEncode("ref", this.ref);10027 }10028 if (null !== this.customList) {10029 writer.WriteXmlAttributeStringEncode("customList", this.customList);10030 }10031 //todo10032 // if (null !== this.dxfId) {10033 // writer.WriteXmlAttributeNumber("dxfId", this.dxfId);10034 // }10035 if (null !== this.iconSet) {10036 writer.WriteXmlAttributeStringEncode("iconSet", ToXml_ST_IconSetType(this.iconSet));10037 }10038 if (null !== this.iconId) {10039 writer.WriteXmlAttributeNumber("iconId", this.iconId);10040 }10041 writer.WriteXmlNodeEnd(name, true, true);10042};10043function CT_LevelGroup() {10044//Attributes10045 this.name = null;10046 this.uniqueName = null;10047 this.caption = null;10048 this.uniqueParent = null;10049 this.id = null;10050//Members10051 this.groupMembers = null;10052}10053CT_LevelGroup.prototype.readAttributes = function(attr, uq) {10054 if (attr()) {10055 var vals = attr();10056 var val;10057 val = vals["name"];10058 if (undefined !== val) {10059 this.name = uq(val);10060 }10061 val = vals["uniqueName"];10062 if (undefined !== val) {10063 this.uniqueName = uq(val);10064 }10065 val = vals["caption"];10066 if (undefined !== val) {10067 this.caption = uq(val);10068 }10069 val = vals["uniqueParent"];10070 if (undefined !== val) {10071 this.uniqueParent = uq(val);10072 }10073 val = vals["id"];10074 if (undefined !== val) {10075 this.id = val - 0;10076 }10077 }10078};10079CT_LevelGroup.prototype.onStartNode = function(elem, attr, uq) {10080 var newContext = this;10081 if ("groupMembers" === elem) {10082 newContext = new CT_GroupMembers();10083 if (newContext.readAttributes) {10084 newContext.readAttributes(attr, uq);10085 }10086 this.groupMembers = newContext;10087 } else {10088 newContext = null;10089 }10090 return newContext;10091};10092CT_LevelGroup.prototype.toXml = function(writer, name) {10093 writer.WriteXmlNodeStart(name);10094 if (null !== this.name) {10095 writer.WriteXmlAttributeStringEncode("name", this.name);10096 }10097 if (null !== this.uniqueName) {10098 writer.WriteXmlAttributeStringEncode("uniqueName", this.uniqueName);10099 }10100 if (null !== this.caption) {10101 writer.WriteXmlAttributeStringEncode("caption", this.caption);10102 }10103 if (null !== this.uniqueParent) {10104 writer.WriteXmlAttributeStringEncode("uniqueParent", this.uniqueParent);10105 }10106 if (null !== this.id) {10107 writer.WriteXmlAttributeNumber("id", this.id);10108 }10109 writer.WriteXmlNodeEnd(name, true);10110 if (null !== this.groupMembers) {10111 this.groupMembers.toXml(writer, "groupMembers");10112 }10113 writer.WriteXmlNodeEnd(name);10114};10115function CT_CustomFilter() {10116//Attributes10117 this.operator = null;//equal10118 this.val = null;10119}10120CT_CustomFilter.prototype.readAttributes = function(attr, uq) {10121 if (attr()) {10122 var vals = attr();10123 var val;10124 val = vals["operator"];10125 if (undefined !== val) {10126 val = FromXml_ST_FilterOperator(val);10127 if (-1 !== val) {10128 this.operator = val;10129 }10130 }10131 val = vals["val"];10132 if (undefined !== val) {10133 this.val = uq(val);10134 }10135 }10136};10137CT_CustomFilter.prototype.toXml = function(writer, name) {10138 writer.WriteXmlNodeStart(name);10139 if (null !== this.operator) {10140 writer.WriteXmlAttributeStringEncode("operator", ToXml_ST_FilterOperator(this.operator));10141 }10142 if (null !== this.val) {10143 writer.WriteXmlAttributeStringEncode("val", this.val);10144 }10145 writer.WriteXmlNodeEnd(name, true, true);10146};10147function CT_Filter() {10148//Attributes10149 this.val = null;10150}10151CT_Filter.prototype.readAttributes = function(attr, uq) {10152 if (attr()) {10153 var vals = attr();10154 var val;10155 val = vals["val"];10156 if (undefined !== val) {10157 this.val = uq(val);10158 }10159 }10160};10161CT_Filter.prototype.toXml = function(writer, name) {10162 writer.WriteXmlNodeStart(name);10163 if (null !== this.val) {10164 writer.WriteXmlAttributeStringEncode("val", this.val);10165 }10166 writer.WriteXmlNodeEnd(name, true, true);10167};10168function CT_DateGroupItem() {10169//Attributes10170 this.year = null;10171 this.month = null;10172 this.day = null;10173 this.hour = null;10174 this.minute = null;10175 this.second = null;10176 this.dateTimeGrouping = null;10177}10178CT_DateGroupItem.prototype.readAttributes = function(attr, uq) {10179 if (attr()) {10180 var vals = attr();10181 var val;10182 val = vals["year"];10183 if (undefined !== val) {10184 this.year = val - 0;10185 }10186 val = vals["month"];10187 if (undefined !== val) {10188 this.month = val - 0;10189 }10190 val = vals["day"];10191 if (undefined !== val) {10192 this.day = val - 0;10193 }10194 val = vals["hour"];10195 if (undefined !== val) {10196 this.hour = val - 0;10197 }10198 val = vals["minute"];10199 if (undefined !== val) {10200 this.minute = val - 0;10201 }10202 val = vals["second"];10203 if (undefined !== val) {10204 this.second = val - 0;10205 }10206 val = vals["dateTimeGrouping"];10207 if (undefined !== val) {10208 val = FromXml_ST_DateTimeGrouping(val);10209 if (-1 !== val) {10210 this.dateTimeGrouping = val;10211 }10212 }10213 }10214};10215CT_DateGroupItem.prototype.toXml = function(writer, name) {10216 writer.WriteXmlNodeStart(name);10217 if (null !== this.year) {10218 writer.WriteXmlAttributeNumber("year", this.year);10219 }10220 if (null !== this.month) {10221 writer.WriteXmlAttributeNumber("month", this.month);10222 }10223 if (null !== this.day) {10224 writer.WriteXmlAttributeNumber("day", this.day);10225 }10226 if (null !== this.hour) {10227 writer.WriteXmlAttributeNumber("hour", this.hour);10228 }10229 if (null !== this.minute) {10230 writer.WriteXmlAttributeNumber("minute", this.minute);10231 }10232 if (null !== this.second) {10233 writer.WriteXmlAttributeNumber("second", this.second);10234 }10235 if (null !== this.dateTimeGrouping) {10236 writer.WriteXmlAttributeStringEncode("dateTimeGrouping", ToXml_ST_DateTimeGrouping(this.dateTimeGrouping));10237 }10238 writer.WriteXmlNodeEnd(name, true, true);10239};10240function CT_GroupMembers() {10241//Attributes10242 this.count = null;10243//Members10244 this.groupMember = [];10245}10246CT_GroupMembers.prototype.readAttributes = function(attr, uq) {10247 if (attr()) {10248 var vals = attr();10249 var val;10250 val = vals["count"];10251 if (undefined !== val) {10252 this.count = val - 0;10253 }10254 }10255};10256CT_GroupMembers.prototype.onStartNode = function(elem, attr, uq) {10257 var newContext = this;10258 if ("groupMember" === elem) {10259 newContext = new CT_GroupMember();10260 if (newContext.readAttributes) {10261 newContext.readAttributes(attr, uq);10262 }10263 this.groupMember.push(newContext);10264 } else {10265 newContext = null;10266 }10267 return newContext;10268};10269CT_GroupMembers.prototype.toXml = function(writer, name) {10270 writer.WriteXmlNodeStart(name);10271 if (null !== this.count) {10272 writer.WriteXmlAttributeNumber("count", this.count);10273 }10274 writer.WriteXmlNodeEnd(name, true);10275 for (var i = 0; i < this.groupMember.length; ++i) {10276 var elem = this.groupMember[i];10277 elem.toXml(writer, "groupMember");10278 }10279 writer.WriteXmlNodeEnd(name);10280};10281function CT_GroupMember() {10282//Attributes10283 this.uniqueName = null;10284 this.group = null;//false10285}10286CT_GroupMember.prototype.readAttributes = function(attr, uq) {10287 if (attr()) {10288 var vals = attr();10289 var val;10290 val = vals["uniqueName"];10291 if (undefined !== val) {10292 this.uniqueName = uq(val);10293 }10294 val = vals["group"];10295 if (undefined !== val) {10296 this.group = getBoolFromXml(val);10297 }10298 }10299};10300CT_GroupMember.prototype.toXml = function(writer, name) {10301 writer.WriteXmlNodeStart(name);10302 if (null !== this.uniqueName) {10303 writer.WriteXmlAttributeStringEncode("uniqueName", this.uniqueName);10304 }10305 if (null !== this.group) {10306 writer.WriteXmlAttributeBool("group", this.group);10307 }10308 writer.WriteXmlNodeEnd(name, true, true);10309};10310var c_oAscPivotRecType = {10311 Boolean: 1,10312 DateTime: 2,10313 Error: 3,10314 Missing: 4,10315 Number: 5,10316 String: 6,10317 Index: 710318};10319function PivotRecordValue() {10320 this.clean();10321};10322PivotRecordValue.prototype.clean = function() {10323 this.type = undefined;10324 this.val = undefined;10325 this.addition = undefined;10326}10327PivotRecordValue.prototype.getCellValue = function() {10328 var res = new AscCommonExcel.CCellValue();10329 switch (this.type) {10330 case c_oAscPivotRecType.Boolean:10331 res.type = AscCommon.CellValueType.Number;10332 res.number = this.val ? 1 : 0;10333 break;10334 case c_oAscPivotRecType.DateTime:10335 res.type = AscCommon.CellValueType.Number;10336 res.number = this.val;10337 break;10338 case c_oAscPivotRecType.Error:10339 res.type = AscCommon.CellValueType.String;10340 res.text = AscCommonExcel.cError.prototype.getStringFromErrorType(this.val);10341 break;10342 case c_oAscPivotRecType.Number:10343 res.type = AscCommon.CellValueType.Number;10344 res.number = this.val;10345 break;10346 case c_oAscPivotRecType.String:10347 res.type = AscCommon.CellValueType.String;10348 res.text = this.val;10349 break;10350 default:10351 var i = 0;10352 break;10353 }10354 return res;10355};10356function PivotRecords() {10357 this.chunks = [];10358 this.addition = {};10359 this.size = 0;10360 this.startCount = 0;10361//inner10362 this._curBoolean = new CT_Boolean();10363 this._curDateTime = new CT_DateTime();10364 this._curError = new CT_Error();10365 this._curMissing = new CT_Missing();10366 this._curNumber = new CT_Number();10367 this._curString = new CT_String();10368 this._curIndex = new CT_Index();10369 this.output = new PivotRecordValue();10370}10371PivotRecords.prototype.onStartNode = function(elem, attr, uq) {10372 var newContext = null;10373 if ("b" === elem) {10374 this._curBoolean.clean();10375 newContext = this._curBoolean;10376 if (newContext.readAttributes) {10377 newContext.readAttributes(attr, uq);10378 }10379 } else if ("d" === elem) {10380 this._curDateTime.clean();10381 newContext = this._curDateTime;10382 if (newContext.readAttributes) {10383 newContext.readAttributes(attr, uq);10384 }10385 } else if ("e" === elem) {10386 this._curError.clean();10387 newContext = this._curError;10388 if (newContext.readAttributes) {10389 newContext.readAttributes(attr, uq);10390 }10391 } else if ("m" === elem) {10392 this._curMissing.clean();10393 newContext = this._curMissing;10394 if (newContext.readAttributes) {10395 newContext.readAttributes(attr, uq);10396 }10397 } else if ("n" === elem) {10398 this._curNumber.clean();10399 newContext = this._curNumber;10400 if (newContext.readAttributes) {10401 newContext.readAttributes(attr, uq);10402 }10403 } else if ("s" === elem) {10404 this._curString.clean();10405 newContext = this._curString;10406 if (newContext.readAttributes) {10407 newContext.readAttributes(attr, uq);10408 }10409 } else if ("x" === elem) {10410 this._curIndex.clean();10411 newContext = this._curIndex;10412 if (newContext.readAttributes) {10413 newContext.readAttributes(attr, uq);10414 }10415 }10416 return newContext;10417};10418PivotRecords.prototype.onEndNode = function(prevContext, elem) {10419 var res = true;10420 if ("b" === elem) {10421 if (this._curBoolean.isSimpleValue()) {10422 this.addBool(this._curBoolean.v);10423 } else {10424 this.addBool(this._curBoolean.v, this._curBoolean);10425 this._curBoolean = new CT_Boolean();10426 }10427 } else if ("d" === elem) {10428 if (this._curDateTime.isSimpleValue()) {10429 this.addDate(this._curDateTime.v);10430 } else {10431 this.addDate(this._curDateTime.v, this._curDateTime);10432 this._curDateTime = new CT_DateTime();10433 }10434 } else if ("e" === elem) {10435 if (this._curError.isSimpleValue()) {10436 this.addError(this._curError.v);10437 } else {10438 this.addError(this._curError.v, this._curError);10439 this._curError = new CT_Error();10440 }10441 } else if ("m" === elem) {10442 if (this._curMissing.isSimpleValue()) {10443 this.addMissing();10444 } else {10445 this.addMissing(this._curMissing);10446 this._curMissing = new CT_Missing();10447 }10448 } else if ("n" === elem) {10449 if (this._curNumber.isSimpleValue()) {10450 this.addNumber(this._curNumber.v);10451 } else {10452 this.addNumber(this._curNumber.v, this._curNumber);10453 this._curNumber = new CT_Number();10454 }10455 } else if ("s" === elem) {10456 if (this._curString.isSimpleValue()) {10457 this.addString(this._curString.v);10458 } else {10459 this.addString(this._curString.v, this._curString);10460 this._curString = new CT_String();10461 }10462 } else if ("x" === elem) {10463 this.addIndex(this._curIndex.v);10464 } else {10465 res = false;10466 }10467 return res;10468};10469PivotRecords.prototype.toXml = function(writer, opt_index) {10470 if (undefined !== opt_index) {10471 this._toXml(writer, this.get(opt_index));10472 } else {10473 for (var i = 0; i < this.size; ++i) {10474 this._toXml(writer, this.get(i));10475 }10476 }10477};10478PivotRecords.prototype.setStartCount = function(val) {10479 this.startCount = val;10480};10481PivotRecords.prototype.addBool = function(val, addition) {10482 this._add(c_oAscPivotRecType.Boolean, val, addition);10483};10484PivotRecords.prototype.addDate = function(val, addition) {10485 this._add(c_oAscPivotRecType.DateTime, val, addition);10486};10487PivotRecords.prototype.addError = function(val, addition) {10488 this._add(c_oAscPivotRecType.Error, val, addition);10489};10490PivotRecords.prototype.addMissing = function(addition) {10491 this._add(c_oAscPivotRecType.Missing, undefined, addition);10492};10493PivotRecords.prototype.addNumber = function(val, addition) {10494 this._add(c_oAscPivotRecType.Number, val, addition);10495};10496PivotRecords.prototype.addString = function(val, addition) {10497 this._add(c_oAscPivotRecType.String, val, addition);10498};10499PivotRecords.prototype.addIndex = function(val) {10500 this._add(c_oAscPivotRecType.Index, val);10501};10502PivotRecords.prototype.get = function(index) {10503 this.output.clean();10504 for (var i = 0; i < this.chunks.length; ++i) {10505 var chunk = this.chunks[i];10506 if (chunk.from <= index && index < chunk.to) {10507 this.output.type = chunk.type;10508 if (chunk.data) {10509 this.output.val = chunk.data[index - chunk.from];10510 if (chunk.type === c_oAscPivotRecType.Boolean) {10511 this.output.val = !!this.output.val;10512 }10513 }10514 this.output.addition = this.addition[index];10515 break;10516 }10517 }10518 return this.output;10519};10520PivotRecords.prototype._add = function(type, val, addition) {10521 var index = this.size;10522 var prevChunk = this.chunks.length > 0 ? this.chunks[this.chunks.length - 1] : null;10523 var chunk;10524 if (prevChunk && (prevChunk.type === type)) {10525 chunk = prevChunk;10526 } else {10527 //todo shrink prevChunk10528 var from = prevChunk ? prevChunk.to : 0;10529 chunk = {type: type, data: null, capacity: 0, from: from, to: from + 1};10530 this.chunks.push(chunk);10531 }10532 var chunkIndex = index - chunk.from;10533 if (c_oAscPivotRecType.Missing !== chunk.type && chunkIndex >= chunk.capacity) {10534 var oldData = chunk.data;10535 var chunkStartCount = (0 === this.size && this.startCount) ? this.startCount - chunk.from : 0;10536 chunk.capacity = Math.min(Math.max((1.1 * chunk.capacity) >> 0, chunkIndex + 1, chunkStartCount), AscCommon.gc_nMaxRow0 + 1);10537 switch (type) {10538 case c_oAscPivotRecType.Boolean:10539 chunk.data = new Uint8Array(chunk.capacity);10540 break;10541 case c_oAscPivotRecType.DateTime:10542 chunk.data = new Uint32Array(chunk.capacity);10543 break;10544 case c_oAscPivotRecType.Error:10545 chunk.data = new Uint8Array(chunk.capacity);10546 break;10547 case c_oAscPivotRecType.Missing:10548 break;10549 case c_oAscPivotRecType.Number:10550 chunk.data = new Float64Array(chunk.capacity);10551 break;10552 case c_oAscPivotRecType.String:10553 if (!chunk.data) {10554 chunk.data = new Array(chunk.capacity);10555 }10556 oldData = null;10557 break;10558 case c_oAscPivotRecType.Index:10559 chunk.data = new Uint32Array(chunk.capacity);10560 break;10561 }10562 if (oldData) {10563 chunk.data.set(oldData);10564 }10565 }10566 if (chunk.data) {10567 chunk.data[chunkIndex] = val;10568 }10569 if (addition) {10570 this.addition[index] = addition;10571 }10572 this.size++;10573 chunk.to = this.size;10574};10575PivotRecords.prototype._toXml = function(writer, elem) {10576 switch (elem.type) {10577 case c_oAscPivotRecType.Boolean:10578 CT_Boolean.prototype.toXml2(writer, "b", elem.val, elem.addition);10579 break;10580 case c_oAscPivotRecType.DateTime:10581 CT_DateTime.prototype.toXml2(writer, "d", elem.val, elem.addition);10582 break;10583 case c_oAscPivotRecType.Error:10584 CT_Error.prototype.toXml2(writer, "e", elem.val, elem.addition);10585 break;10586 case c_oAscPivotRecType.Missing:10587 CT_Missing.prototype.toXml2(writer, "m", elem.addition);10588 break;10589 case c_oAscPivotRecType.Number:10590 CT_Number.prototype.toXml2(writer, "n", elem.val, elem.addition);10591 break;10592 case c_oAscPivotRecType.String:10593 CT_String.prototype.toXml2(writer, "s", elem.val, elem.addition);10594 break;10595 case c_oAscPivotRecType.Index:10596 CT_Index.prototype.toXml2(writer, "x", elem.val);10597 break;10598 }10599};10600var prot;10601window['Asc']['c_oAscSourceType'] = window['AscCommonExcel'].c_oAscSourceType = c_oAscSourceType;10602prot = c_oAscSourceType;10603prot['Worksheet'] = prot.Worksheet;10604prot['External'] = prot.External;10605prot['Consolidation'] = prot.Consolidation;10606prot['Scenario'] = prot.Scenario;10607window['Asc']['c_oAscAxis'] = window['AscCommonExcel'].c_oAscAxis = c_oAscAxis;10608prot = c_oAscAxis;10609prot['AxisRow'] = prot.AxisRow;10610prot['AxisCol'] = prot.AxisCol;10611prot['AxisPage'] = prot.AxisPage;10612prot['AxisValues'] = prot.AxisValues;10613window['Asc']['c_oAscFieldSortType'] = window['AscCommonExcel'].c_oAscFieldSortType = c_oAscFieldSortType;10614prot = c_oAscFieldSortType;10615prot['Manual'] = prot.Manual;10616prot['Ascending'] = prot.Ascending;10617prot['Descending'] = prot.Descending;10618window['Asc']['c_oAscItemType'] = window['AscCommonExcel'].c_oAscItemType = c_oAscItemType;10619prot = c_oAscItemType;10620prot['Data'] = prot.Data;10621prot['Default'] = prot.Default;10622prot['Sum'] = prot.Sum;10623prot['CountA'] = prot.CountA;10624prot['Avg'] = prot.Avg;10625prot['Max'] = prot.Max;10626prot['Min'] = prot.Min;10627prot['Product'] = prot.Product;10628prot['Count'] = prot.Count;10629prot['StdDev'] = prot.StdDev;10630prot['StdDevP'] = prot.StdDevP;10631prot['Var'] = prot.Var;10632prot['VarP'] = prot.VarP;10633prot['Grand'] = prot.Grand;10634prot['Blank'] = prot.Blank;10635window['Asc']['c_oAscDataConsolidateFunction'] = window['AscCommonExcel'].c_oAscDataConsolidateFunction = c_oAscDataConsolidateFunction;10636prot = c_oAscDataConsolidateFunction;10637prot['Average'] = prot.Average;10638prot['Count'] = prot.Count;10639prot['CountNums'] = prot.CountNums;10640prot['Max'] = prot.Max;10641prot['Min'] = prot.Min;10642prot['Product'] = prot.Product;10643prot['StdDev'] = prot.StdDev;10644prot['StdDevp'] = prot.StdDevp;10645prot['Sum'] = prot.Sum;10646prot['Var'] = prot.Var;10647prot['Varp'] = prot.Varp;10648window['Asc']['c_oAscShowDataAs'] = window['AscCommonExcel'].c_oAscShowDataAs = c_oAscShowDataAs;10649prot = c_oAscShowDataAs;10650prot['Normal'] = prot.Normal;10651prot['Difference'] = prot.Difference;10652prot['Percent'] = prot.Percent;10653prot['PercentDiff'] = prot.PercentDiff;10654prot['RunTotal'] = prot.RunTotal;10655prot['PercentOfRow'] = prot.PercentOfRow;10656prot['PercentOfCol'] = prot.PercentOfCol;10657prot['PercentOfTotal'] = prot.PercentOfTotal;10658prot['Index'] = prot.Index;10659window['Asc']['c_oAscFormatAction'] = window['AscCommonExcel'].c_oAscFormatAction = c_oAscFormatAction;10660prot = c_oAscFormatAction;10661prot['Blank'] = prot.Blank;10662prot['Formatting'] = prot.Formatting;10663prot['Drill'] = prot.Drill;10664prot['Formula'] = prot.Formula;10665window['Asc']['c_oAscScope'] = window['AscCommonExcel'].c_oAscScope = c_oAscScope;10666prot = c_oAscScope;10667prot['Selection'] = prot.Selection;10668prot['Data'] = prot.Data;10669prot['Field'] = prot.Field;10670window['Asc']['c_oAscType'] = window['AscCommonExcel'].c_oAscType = c_oAscType;10671prot = c_oAscType;10672prot['None'] = prot.None;10673prot['All'] = prot.All;10674prot['Row'] = prot.Row;10675prot['Column'] = prot.Column;10676window['Asc']['c_oAscPivotFilterType'] = window['AscCommonExcel'].c_oAscPivotFilterType = c_oAscPivotFilterType;10677prot = c_oAscPivotFilterType;10678prot['Unknown'] = prot.Unknown;10679prot['Count'] = prot.Count;10680prot['Percent'] = prot.Percent;10681prot['Sum'] = prot.Sum;10682prot['CaptionEqual'] = prot.CaptionEqual;10683prot['CaptionNotEqual'] = prot.CaptionNotEqual;10684prot['CaptionBeginsWith'] = prot.CaptionBeginsWith;10685prot['CaptionNotBeginsWith'] = prot.CaptionNotBeginsWith;10686prot['CaptionEndsWith'] = prot.CaptionEndsWith;10687prot['CaptionNotEndsWith'] = prot.CaptionNotEndsWith;10688prot['CaptionContains'] = prot.CaptionContains;10689prot['CaptionNotContains'] = prot.CaptionNotContains;10690prot['CaptionGreaterThan'] = prot.CaptionGreaterThan;10691prot['CaptionGreaterThanOrEqual'] = prot.CaptionGreaterThanOrEqual;10692prot['CaptionLessThan'] = prot.CaptionLessThan;10693prot['CaptionLessThanOrEqual'] = prot.CaptionLessThanOrEqual;10694prot['CaptionBetween'] = prot.CaptionBetween;10695prot['CaptionNotBetween'] = prot.CaptionNotBetween;10696prot['ValueEqual'] = prot.ValueEqual;10697prot['ValueNotEqual'] = prot.ValueNotEqual;10698prot['ValueGreaterThan'] = prot.ValueGreaterThan;10699prot['ValueGreaterThanOrEqual'] = prot.ValueGreaterThanOrEqual;10700prot['ValueLessThan'] = prot.ValueLessThan;10701prot['ValueLessThanOrEqual'] = prot.ValueLessThanOrEqual;10702prot['ValueBetween'] = prot.ValueBetween;10703prot['ValueNotBetween'] = prot.ValueNotBetween;10704prot['DateEqual'] = prot.DateEqual;10705prot['DateNotEqual'] = prot.DateNotEqual;10706prot['DateOlderThan'] = prot.DateOlderThan;10707prot['DateOlderThanOrEqual'] = prot.DateOlderThanOrEqual;10708prot['DateNewerThan'] = prot.DateNewerThan;10709prot['DateNewerThanOrEqual'] = prot.DateNewerThanOrEqual;10710prot['DateBetween'] = prot.DateBetween;10711prot['DateNotBetween'] = prot.DateNotBetween;10712prot['Tomorrow'] = prot.Tomorrow;10713prot['Today'] = prot.Today;10714prot['Yesterday'] = prot.Yesterday;10715prot['NextWeek'] = prot.NextWeek;10716prot['ThisWeek'] = prot.ThisWeek;10717prot['LastWeek'] = prot.LastWeek;10718prot['NextMonth'] = prot.NextMonth;10719prot['ThisMonth'] = prot.ThisMonth;10720prot['LastMonth'] = prot.LastMonth;10721prot['NextQuarter'] = prot.NextQuarter;10722prot['ThisQuarter'] = prot.ThisQuarter;10723prot['LastQuarter'] = prot.LastQuarter;10724prot['NextYear'] = prot.NextYear;10725prot['ThisYear'] = prot.ThisYear;10726prot['LastYear'] = prot.LastYear;10727prot['YearToDate'] = prot.YearToDate;10728prot['Q1'] = prot.Q1;10729prot['Q2'] = prot.Q2;10730prot['Q3'] = prot.Q3;10731prot['Q4'] = prot.Q4;10732prot['M1'] = prot.M1;10733prot['M2'] = prot.M2;10734prot['M3'] = prot.M3;10735prot['M4'] = prot.M4;10736prot['M5'] = prot.M5;10737prot['M6'] = prot.M6;10738prot['M7'] = prot.M7;10739prot['M8'] = prot.M8;10740prot['M9'] = prot.M9;10741prot['M10'] = prot.M10;10742prot['M11'] = prot.M11;10743prot['M12'] = prot.M12;10744window['Asc']['c_oAscSortType'] = window['AscCommonExcel'].c_oAscSortType = c_oAscSortType;10745prot = c_oAscSortType;10746prot['None'] = prot.None;10747prot['Ascending'] = prot.Ascending;10748prot['Descending'] = prot.Descending;10749prot['AscendingAlpha'] = prot.AscendingAlpha;10750prot['DescendingAlpha'] = prot.DescendingAlpha;10751prot['AscendingNatural'] = prot.AscendingNatural;10752prot['DescendingNatural'] = prot.DescendingNatural;10753window['Asc']['c_oAscPivotAreaType'] = window['AscCommonExcel'].c_oAscPivotAreaType = c_oAscPivotAreaType;10754prot = c_oAscPivotAreaType;10755prot['None'] = prot.None;10756prot['Normal'] = prot.Normal;10757prot['Data'] = prot.Data;10758prot['All'] = prot.All;10759prot['Origin'] = prot.Origin;10760prot['Button'] = prot.Button;10761prot['TopEnd'] = prot.TopEnd;10762window['Asc']['c_oAscGroupBy'] = window['AscCommonExcel'].c_oAscGroupBy = c_oAscGroupBy;10763prot = c_oAscGroupBy;10764prot['Range'] = prot.Range;10765prot['Seconds'] = prot.Seconds;10766prot['Minutes'] = prot.Minutes;10767prot['Hours'] = prot.Hours;10768prot['Days'] = prot.Days;10769prot['Months'] = prot.Months;10770prot['Quarters'] = prot.Quarters;10771prot['Years'] = prot.Years;10772window['Asc']['c_oAscSortMethod'] = window['AscCommonExcel'].c_oAscSortMethod = c_oAscSortMethod;10773prot = c_oAscSortMethod;10774prot['Stroke'] = prot.Stroke;10775prot['PinYin'] = prot.PinYin;10776prot['None'] = prot.None;10777window['Asc']['c_oAscDynamicFilterType'] = window['AscCommonExcel'].c_oAscDynamicFilterType = c_oAscDynamicFilterType;10778prot = c_oAscDynamicFilterType;10779prot['Null'] = prot.Null;10780prot['AboveAverage'] = prot.AboveAverage;10781prot['BelowAverage'] = prot.BelowAverage;10782prot['Tomorrow'] = prot.Tomorrow;10783prot['Today'] = prot.Today;10784prot['Yesterday'] = prot.Yesterday;10785prot['NextWeek'] = prot.NextWeek;10786prot['ThisWeek'] = prot.ThisWeek;10787prot['LastWeek'] = prot.LastWeek;10788prot['NextMonth'] = prot.NextMonth;10789prot['ThisMonth'] = prot.ThisMonth;10790prot['LastMonth'] = prot.LastMonth;10791prot['NextQuarter'] = prot.NextQuarter;10792prot['ThisQuarter'] = prot.ThisQuarter;10793prot['LastQuarter'] = prot.LastQuarter;10794prot['NextYear'] = prot.NextYear;10795prot['ThisYear'] = prot.ThisYear;10796prot['LastYear'] = prot.LastYear;10797prot['YearToDate'] = prot.YearToDate;10798prot['Q1'] = prot.Q1;10799prot['Q2'] = prot.Q2;10800prot['Q3'] = prot.Q3;10801prot['Q4'] = prot.Q4;10802prot['M1'] = prot.M1;10803prot['M2'] = prot.M2;10804prot['M3'] = prot.M3;10805prot['M4'] = prot.M4;10806prot['M5'] = prot.M5;10807prot['M6'] = prot.M6;10808prot['M7'] = prot.M7;10809prot['M8'] = prot.M8;10810prot['M9'] = prot.M9;10811prot['M10'] = prot.M10;10812prot['M11'] = prot.M11;10813prot['M12'] = prot.M12;10814window['Asc']['c_oAscCalendarType'] = window['AscCommonExcel'].c_oAscCalendarType = c_oAscCalendarType;10815prot = c_oAscCalendarType;10816prot['Gregorian'] = prot.Gregorian;10817prot['GregorianUs'] = prot.GregorianUs;10818prot['GregorianMeFrench'] = prot.GregorianMeFrench;10819prot['GregorianArabic'] = prot.GregorianArabic;10820prot['Hijri'] = prot.Hijri;10821prot['Hebrew'] = prot.Hebrew;10822prot['Taiwan'] = prot.Taiwan;10823prot['Japan'] = prot.Japan;10824prot['Thai'] = prot.Thai;10825prot['Korea'] = prot.Korea;10826prot['Saka'] = prot.Saka;10827prot['GregorianXlitEnglish'] = prot.GregorianXlitEnglish;10828prot['GregorianXlitFrench'] = prot.GregorianXlitFrench;10829prot['None'] = prot.None;10830window['Asc']['c_oAscIconSetType'] = window['AscCommonExcel'].c_oAscIconSetType = c_oAscIconSetType;10831prot = c_oAscIconSetType;10832prot['ThreeArrows'] = prot.ThreeArrows;10833prot['ThreeArrowsGray'] = prot.ThreeArrowsGray;10834prot['ThreeFlags'] = prot.ThreeFlags;10835prot['ThreeTrafficLights1'] = prot.ThreeTrafficLights1;10836prot['ThreeTrafficLights2'] = prot.ThreeTrafficLights2;10837prot['ThreeSigns'] = prot.ThreeSigns;10838prot['ThreeSymbols'] = prot.ThreeSymbols;10839prot['ThreeSymbols2'] = prot.ThreeSymbols2;10840prot['FourArrows'] = prot.FourArrows;10841prot['FourArrowsGray'] = prot.FourArrowsGray;10842prot['FourRedToBlack'] = prot.FourRedToBlack;10843prot['FourRating'] = prot.FourRating;10844prot['FourTrafficLights'] = prot.FourTrafficLights;10845prot['FiveArrows'] = prot.FiveArrows;10846prot['FiveArrowsGray'] = prot.FiveArrowsGray;10847prot['FiveRating'] = prot.FiveRating;10848prot['FiveQuarters'] = prot.FiveQuarters;10849window['Asc']['c_oAscSortBy'] = window['AscCommonExcel'].c_oAscSortBy = c_oAscSortBy;10850prot = c_oAscSortBy;10851prot['Value'] = prot.Value;10852prot['CellColor'] = prot.CellColor;10853prot['FontColor'] = prot.FontColor;10854prot['Icon'] = prot.Icon;10855window['Asc']['c_oAscFilterOperator'] = window['AscCommonExcel'].c_oAscFilterOperator = c_oAscFilterOperator;10856prot = c_oAscFilterOperator;10857prot['Equal'] = prot.Equal;10858prot['LessThan'] = prot.LessThan;10859prot['LessThanOrEqual'] = prot.LessThanOrEqual;10860prot['NotEqual'] = prot.NotEqual;10861prot['GreaterThanOrEqual'] = prot.GreaterThanOrEqual;10862prot['GreaterThan'] = prot.GreaterThan;10863window['Asc']['c_oAscDateTimeGrouping'] = window['AscCommonExcel'].c_oAscDateTimeGrouping = c_oAscDateTimeGrouping;10864prot = c_oAscDateTimeGrouping;10865prot['Year'] = prot.Year;10866prot['Month'] = prot.Month;10867prot['Day'] = prot.Day;10868prot['Hour'] = prot.Hour;10869prot['Minute'] = prot.Minute;10870prot['Second'] = prot.Second;10871window['AscCommonExcel'].ToName_ST_ItemType = ToName_ST_ItemType;10872window['Asc']['CT_PivotCacheDefinition'] = window['Asc'].CT_PivotCacheDefinition = CT_PivotCacheDefinition;10873window['Asc']['CT_PivotCacheRecords'] = window['Asc'].CT_PivotCacheRecords = CT_PivotCacheRecords;10874window["Asc"]["CT_pivotTableDefinition"] = window['Asc'].CT_pivotTableDefinition = CT_pivotTableDefinition;10875prot = CT_pivotTableDefinition.prototype;10876prot["asc_getName"] = prot.asc_getName;10877prot["asc_getPageWrap"] = prot.asc_getPageWrap;10878prot["asc_getPageOverThenDown"] = prot.asc_getPageOverThenDown;10879prot["asc_getRowGrandTotals"] = prot.asc_getRowGrandTotals;10880prot["asc_getColGrandTotals"] = prot.asc_getColGrandTotals;10881prot["asc_getShowHeaders"] = prot.asc_getShowHeaders;10882prot["asc_getStyleInfo"] = prot.asc_getStyleInfo;10883prot["asc_getCacheFields"] = prot.asc_getCacheFields;10884prot["asc_getPivotFields"] = prot.asc_getPivotFields;10885prot["asc_getPageFields"] = prot.asc_getPageFields;10886prot["asc_getColumnFields"] = prot.asc_getColumnFields;10887prot["asc_getRowFields"] = prot.asc_getRowFields;10888prot["asc_getDataFields"] = prot.asc_getDataFields;10889prot["asc_set"] = prot.asc_set;10890prot["asc_setRowGrandTotals"] = prot.asc_setRowGrandTotals;10891prot["asc_setColGrandTotals"] = prot.asc_setColGrandTotals;10892prot["asc_addPageField"] = prot.asc_addPageField;10893prot["asc_removeField"] = prot.asc_removeField;10894prot = CT_PivotTableStyle.prototype;10895prot["asc_getName"] = prot.asc_getName;10896prot["asc_getShowRowHeaders"] = prot.asc_getShowRowHeaders;10897prot["asc_getShowColHeaders"] = prot.asc_getShowColHeaders;10898prot["asc_getShowRowStripes"] = prot.asc_getShowRowStripes;10899prot["asc_getShowColStripes"] = prot.asc_getShowColStripes;10900prot["asc_setName"] = prot.asc_setName;10901prot["asc_setShowRowHeaders"] = prot.asc_setShowRowHeaders;10902prot["asc_setShowColHeaders"] = prot.asc_setShowColHeaders;10903prot["asc_setShowRowStripes"] = prot.asc_setShowRowStripes;10904prot["asc_setShowColStripes"] = prot.asc_setShowColStripes;10905prot = CT_CacheField.prototype;10906prot["asc_getName"] = prot.asc_getName;10907prot = CT_PivotField.prototype;10908prot["asc_getName"] = prot.asc_getName;10909prot["asc_getSubtotalTop"] = prot.asc_getSubtotalTop;10910prot["asc_getSubtotals"] = prot.asc_getSubtotals;10911prot = CT_Field.prototype;10912prot["asc_getIndex"] = prot.asc_getIndex;10913prot = CT_PageField.prototype;10914prot["asc_getName"] = prot.asc_getName;10915prot["asc_getIndex"] = prot.asc_getIndex;10916window["Asc"]["CT_DataField"] = CT_DataField;10917prot = CT_DataField.prototype;10918prot["asc_getName"] = prot.asc_getName;10919prot["asc_getIndex"] = prot.asc_getIndex;10920prot["asc_getSubtotal"] = prot.asc_getSubtotal;10921prot["asc_getShowDataAs"] = prot.asc_getShowDataAs;10922prot["asc_set"] = prot.asc_set;10923prot["asc_setName"] = prot.asc_setName;...
index.js
Source:index.js
1const expect = require('expect');2const setIn = require('./../index');3const mutableSetIn = require('./../index').mutableSetIn;4describe('setIn', function() {5 const context = {6 user: {7 profile: {8 gender: 'female'9 },10 ids: [1]11 },12 type: 'best'13 };14 it('should set value and return new copy of object by Array path', function() {15 const newContext = setIn(context, ['user', 'profile', 'gender'], 'male');16 expect(newContext).toNotBe(context);17 expect(newContext).toEqual({18 user: {19 profile: {20 gender: 'male'21 },22 ids: [1]23 },24 type: 'best'25 });26 });27 it('should set value and return new copy of object by string path', function() {28 const newContext = setIn(context, 'type', 'bestest');29 expect(newContext).toNotBe(context);30 expect(newContext).toEqual({31 user: {32 profile: {33 gender: 'female'34 },35 ids: [1]36 },37 type: 'bestest'38 });39 });40 it('should set value and return new copy of object by number path', function() {41 const newContext = setIn(context, 1, 'value');42 expect(newContext).toNotBe(context);43 expect(newContext).toEqual({44 user: {45 profile: {46 gender: 'female'47 },48 ids: [1]49 },50 type: 'best',51 1: 'value'52 });53 });54 it('should set value and return new copy of object if path is zero', function() {55 const newContext = setIn(context, 0, 'value');56 expect(newContext).toNotBe(context);57 expect(newContext).toEqual({58 user: {59 profile: {60 gender: 'female'61 },62 ids: [1]63 },64 type: 'best',65 0: 'value'66 });67 });68 it('should add value into new key and return new copy of object by string path', function() {69 const newContext = setIn(context, 'hero', 'batman');70 expect(newContext).toNotBe(context);71 expect(newContext).toEqual({72 user: {73 profile: {74 gender: 'female'75 },76 ids: [1]77 },78 type: 'best',79 hero: 'batman'80 });81 });82 it('should add value into new nested keys and return new copy of object by Array path', function() {83 const newContext = setIn(context, ['user', 'profile', 'address', 'country'], 'slovakia');84 expect(newContext).toNotBe(context);85 expect(newContext).toEqual({86 user: {87 profile: {88 gender: 'female',89 address: {90 country: 'slovakia'91 }92 },93 ids: [1]94 },95 type: 'best'96 });97 });98 it('should push value to array', function() {99 const newContext = setIn(context, ['user', 'ids'], 2, true);100 expect(newContext).toNotBe(context);101 expect(newContext).toEqual({102 user: {103 profile: {104 gender: 'female'105 },106 ids: [1, 2]107 },108 type: 'best'109 });110 });111 it('should create array if trying to push to undefined', function() {112 const newContext = setIn(context, ['user', 'tags'], 'first', true);113 expect(newContext).toNotBe(context);114 expect(newContext).toEqual({115 user: {116 profile: {117 gender: 'female'118 },119 ids: [1],120 tags: ['first']121 },122 type: 'best'123 });124 });125 it('should throw an error if trying to push to non array', function() {126 const context = {127 user: {128 profile: {129 gender: 'female'130 },131 ids: {132 1: true133 }134 },135 type: 'best'136 };137 expect(function() {138 setIn(context, ['user', 'ids'], 2, true);139 }).toThrow('Cannot push to [object Object]');140 });141 it('should create context object with numeric key if it does not exist', function() {142 const newContext = setIn(context, ['user', 3], 'three');143 expect(newContext).toNotBe(context);144 expect(newContext).toEqual({145 user: {146 profile: {147 gender: 'female'148 },149 ids: [1],150 3: 'three'151 },152 type: 'best'153 });154 });155 it('should add item to array if path part is number and context is array', function() {156 const newContext = setIn(context, ['user', 'ids', 3], 'three');157 expect(newContext).toNotBe(context);158 expect(newContext).toEqual({159 user: {160 profile: {161 gender: 'female'162 },163 ids: [1,,,'three']164 },165 type: 'best'166 });167 });168 it('should set item in array if path part is number and context is array', function() {169 const context = {170 numbers: [171 'zero',172 'one',173 'two',174 'three'175 ]176 };177 const newContext = setIn(context, ['numbers', 1], 'ein');178 expect(newContext).toNotBe(context);179 expect(newContext).toEqual({180 numbers: [181 'zero',182 'ein',183 'two',184 'three'185 ]186 });187 });188 it('should not mutate path argument', function(){189 const path = ['user', 'profile', 'gender'];190 setIn(context, path, 'male');191 expect(path).toEqual(['user', 'profile', 'gender']);192 });193 it('should throw error if path is undefined', function(){194 expect(function(){195 setIn(context);196 }).toThrow('Path is undefined');197 });198 it('should throw error if path part is undefined', function(){199 expect(function(){200 setIn(context, ['user', undefined]);201 }).toThrow('Path part is undefined');202 });203 it('should throw error trying ot add property to non object/array', function(){204 expect(function(){205 setIn(context, ['type', 'subtype'], 'subway');206 }).toThrow('Trying to add property to [object String]');207 });208});209describe('mutableSetIn', function() {210 let context;211 beforeEach(function(){212 context = {213 user: {214 profile: {215 gender: 'female'216 },217 ids: [1]218 },219 type: 'best'220 };221 });222 it('should set value and return modified object by Array path', function() {223 const newContext = mutableSetIn(context, ['user', 'profile', 'gender'], 'male');224 const output = {225 user: {226 profile: {227 gender: 'male'228 },229 ids: [1]230 },231 type: 'best'232 };233 expect(newContext).toBe(context);234 expect(newContext).toEqual(output);235 expect(context).toEqual(output);236 });237 it('should set value and return modified object by string path', function() {238 const newContext = mutableSetIn(context, 'type', 'bestest');239 const output = {240 user: {241 profile: {242 gender: 'female'243 },244 ids: [1]245 },246 type: 'bestest'247 };248 expect(newContext).toBe(context);249 expect(newContext).toEqual(output);250 expect(context).toEqual(output);251 });252 it('should set value and return modified object by number path', function() {253 const newContext = mutableSetIn(context, 1, 'value');254 const output = {255 user: {256 profile: {257 gender: 'female'258 },259 ids: [1]260 },261 type: 'best',262 1: 'value'263 };264 expect(newContext).toBe(context);265 expect(newContext).toEqual(output);266 expect(context).toEqual(output);267 });268 it('should set value and return modified object if path is zero', function() {269 const newContext = mutableSetIn(context, 0, 'value');270 const output = {271 user: {272 profile: {273 gender: 'female'274 },275 ids: [1]276 },277 type: 'best',278 0: 'value'279 };280 expect(newContext).toBe(context);281 expect(newContext).toEqual(output);282 expect(context).toEqual(output);283 });284 it('should add value into new key and return modified object by string path', function() {285 const newContext = mutableSetIn(context, 'hero', 'batman');286 const output = {287 user: {288 profile: {289 gender: 'female'290 },291 ids: [1]292 },293 type: 'best',294 hero: 'batman'295 };296 expect(newContext).toBe(context);297 expect(newContext).toEqual(output);298 expect(context).toEqual(output);299 });300 it('should add value into new nested keys and return modified object by Array path', function() {301 const newContext = mutableSetIn(context, ['user', 'profile', 'address', 'country'], 'slovakia');302 const output = {303 user: {304 profile: {305 gender: 'female',306 address: {307 country: 'slovakia'308 }309 },310 ids: [1]311 },312 type: 'best'313 };314 expect(newContext).toBe(context);315 expect(newContext).toEqual(output);316 expect(context).toEqual(output);317 });318 it('should push value to array', function() {319 const newContext = mutableSetIn(context, ['user', 'ids'], 2, true);320 const output = {321 user: {322 profile: {323 gender: 'female'324 },325 ids: [1, 2]326 },327 type: 'best'328 };329 expect(newContext).toBe(context);330 expect(newContext).toEqual(output);331 expect(context).toEqual(output);332 });333 it('should create array if trying to push to undefined', function() {334 const newContext = mutableSetIn(context, ['user', 'tags'], 'first', true);335 const output = {336 user: {337 profile: {338 gender: 'female'339 },340 ids: [1],341 tags: ['first']342 },343 type: 'best'344 };345 expect(newContext).toBe(context);346 expect(newContext).toEqual(output);347 expect(context).toEqual(output);348 });349 it('should throw an error if trying to push to non array', function() {350 const context = {351 user: {352 profile: {353 gender: 'female'354 },355 ids: {356 1: true357 }358 },359 type: 'best'360 };361 expect(function() {362 mutableSetIn(context, ['user', 'ids'], 2, true);363 }).toThrow('Cannot push to [object Object]');364 });365 it('should create contest object with numeric key if it does not exist', function() {366 const newContext = mutableSetIn(context, ['user', 3], 'three');367 const output = {368 user: {369 profile: {370 gender: 'female'371 },372 ids: [1],373 3: 'three'374 },375 type: 'best'376 };377 expect(newContext).toBe(context);378 expect(newContext).toEqual(output);379 expect(context).toEqual(output);380 });381 it('should add item to array if path part is number and context is array', function() {382 const newContext = mutableSetIn(context, ['user', 'ids', 3], 'three');383 const output = {384 user: {385 profile: {386 gender: 'female'387 },388 ids: [1,,,'three']389 },390 type: 'best'391 };392 expect(newContext).toBe(context);393 expect(newContext).toEqual(output);394 expect(context).toEqual(output);395 });396 it('should set item in array if path part is number and context is array', function() {397 const context = {398 numbers: [399 'zero',400 'one',401 'two',402 'three'403 ]404 };405 const newContext = mutableSetIn(context, ['numbers', 1], 'ein');406 const output = {407 numbers: [408 'zero',409 'ein',410 'two',411 'three'412 ]413 };414 expect(newContext).toBe(context);415 expect(newContext).toEqual(output);416 expect(context).toEqual(output);417 });418 it('should not mutate path argument', function(){419 const path = ['user', 'profile', 'gender'];420 mutableSetIn(context, path, 'male');421 expect(path).toEqual(['user', 'profile', 'gender']);422 });423 it('should throw error if path is undefined', function(){424 expect(function(){425 mutableSetIn(context);426 }).toThrow('Path is undefined');427 });428 it('should throw error if path part is undefined', function(){429 expect(function(){430 mutableSetIn(context, ['user', undefined]);431 }).toThrow('Path part is undefined');432 });433 it('should throw error trying ot add property to non object/array', function(){434 expect(function(){435 mutableSetIn(context, ['type', 'subtype'], 'subway');436 }).toThrow('Trying to add property to [object String]');437 });...
render.js
Source:render.js
1var checkFilter = require('json-filter')2var getLocals = require('./get_locals')3module.exports = function render(parts, context){4 var result = ''5 for (var i=0;i<parts.length;i++){6 var part = parts[i]7 if (typeof part == 'string'){ // default8 result += part9 } else if (part.r){ // repeater10 var collection = context.get(part.r)11 var collectionContext = copy(context)12 collectionContext.source = collection13 collectionContext.query = part.r 14 collectionContext.parentContext = context15 if (Array.isArray(collection)){16 for (var x=0;x<collection.length;x++){17 var newContext = copy(context)18 newContext.collection = collection19 newContext.source = collection[x]20 newContext.parent = context.source21 newContext.query = '[' + x + ']'22 newContext.parentContext = collectionContext23 if (part.as){24 newContext.override = copy(newContext.override)25 newContext.override[part.as] = newContext.source26 }27 if (part.f){ // handle filters (if, unless, when)28 if (!queryFilter(part.f, newContext)){29 continue;30 }31 }32 if (part.v){33 result += render([{c: part.c, v: part.v}], newContext)34 } else {35 result += render(part.c, newContext)36 }37 }38 }39 } else {40 if (part.as){41 context = copy(context)42 context.override = copy(context.override)43 context.override[part.as] = context.source44 }45 if (part.f){ // handle filters (if, unless, when)46 if (!queryFilter(part.f, context)){47 continue;48 }49 }50 // inner content51 var content = ''52 if (part.c){53 content = render(part.c, context)54 } else if (part.vc){55 content = context.content56 } else if (part.q){57 var value = context.get(part.q)58 content = format(value, part.e)59 }60 if (part.v){ // view61 var newContext = copy(context)62 newContext.content = content63 if (part.q){64 newContext.parentContext = context65 newContext.source = context.get(part.q)66 newContext.query = part.q67 newContext.parent = context.source68 }69 var view = context.views[part.v]70 if (view === '$self') {71 // deal with circular stringify72 view = context.parentView73 }74 if (view){75 if (typeof view == 'function'){76 result += view(newContext)77 } else if (view.require){78 result += require(view.require)(newContext)79 } else {80 newContext.parentView = view81 newContext.views = view.views82 newContext.locals = getLocals(view)83 result += render(view.c, newContext)84 }85 }86 } else {87 result += content || ''88 }89 } 90 }91 return result92}93function format(value, type){94 if (typeof value == 'string' || typeof value == 'number' || typeof value == 'boolean'){95 return escapeHTML(value.toString(), type)96 } else if (Array.isArray(value)){97 return escapeHTML(value.join(', '), type)98 } else {99 return ''100 }101}102function escapeHTML(s, type) {103 if (type !== false){104 var result = String(s).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')105 if (type === 'attr'){106 result = result.replace(/"/g, '"')107 }108 return result109 } else {110 return s111 }112}113function queryFilter(filter, context){114 var result = true115 if (filter){116 var object = {}117 var keys = Object.keys(filter)118 for (var i=0,l=keys.length;i<l;i++){119 var key = keys[i]120 object[key] = context.get(key)121 }122 result = checkFilter(object, filter)123 }124 return result125}126function copy(obj){127 var result = {}128 if (obj){129 for (var key in obj){130 if (key in obj){131 result[key] = obj[key]132 }133 }134 }135 return result...
wrapProvider.js
Source:wrapProvider.js
1// ----------------------------------------------------------------------------2// Copyright (c) Microsoft Corporation. All rights reserved.3// ----------------------------------------------------------------------------4var apply = require('./hooks'),5 queries = require('../query'),6 assert = require('../utilities/assert').argument;7module.exports = function (provider, table, context) {8 var tableAccess = provider(table);9 context = context || {};10 var api = {11 read: function (query) {12 query = createQuery(query);13 var newContext = createContext('read', query);14 return tableAccess.read(apply.filters(table, query, newContext))15 .then(apply.hooks(newContext));16 },17 find: function (id) {18 return api.read(queries.create(table.name).where({ id: id }))19 .then(function (results) {20 return results[0];21 });22 },23 update: function (item, query) {24 assert(item, 'An item to update was not provided');25 query = createQuery(query);26 if(table.softDelete) query.where({ deleted: false });27 var newContext = createContext('update', query, item);28 return tableAccess.update(apply.transforms(table, item, newContext), apply.filters(table, query, newContext))29 .then(apply.hooks(newContext));30 },31 insert: function (item) {32 assert(item, 'An item to insert was not provided');33 var newContext = createContext('create', null, item);34 return tableAccess.insert(apply.transforms(table, item, newContext))35 .then(apply.hooks(newContext));36 },37 delete: function (query, version) {38 assert(query, 'The delete query was not provided');39 query = createQuery(query);40 var newContext = createContext('delete', query);41 return tableAccess.delete(apply.filters(table, query, newContext), version)42 .then(apply.hooks(newContext));43 },44 undelete: function (query, version) {45 assert(query, 'The undelete query was not provided');46 query = createQuery(query);47 var newContext = createContext('undelete', query);48 return tableAccess.undelete(apply.filters(table, query, newContext), version)49 .then(apply.hooks(newContext));50 },51 truncate: tableAccess.truncate,52 initialize: tableAccess.initialize,53 schema: tableAccess.schema54 };55 return api;56 function createContext(operation, query, item) {57 // context will contain properties set by middleware - we may have been called from a server side script58 // which could make these properties incorrect. shallow clone the context operation and assign the 59 // correct properties for this specific operation60 var result = Object.keys(context).reduce(function (target, key) {61 target[key] = context[key];62 return target;63 }, {});64 result.operation = operation;65 result.query = query || result.query;66 result.item = item || result.item;67 result.table = table;68 return result;69 }70 function createQuery(query) {71 if(query && query.constructor === queries.Query)72 return query;73 var newQuery = queries.create(table.name);74 if(query)75 newQuery.where(query);76 return newQuery;77 }...
hbs.js
Source:hbs.js
1const hbs = require('hbs')2hbs.registerPartials(__dirname + '/views/partials', function (err) {});3hbs.registerHelper('equals', function (arg1, arg2, options){4 return (arg1 == arg2) ? options.fn(this) : '';5});6hbs.registerHelper('isValid', function (errors, name){7 if (Array.isArray(errors) && errors.length){8 const error = errors.find(e=> e.param === name)9 if(error){10 return 'is-invalid'11 }12 }13 return ''14})15hbs.registerHelper('isValidMessage', function (errors, name){16 if (Array.isArray(errors) && errors.length){17 const error = errors.find(e=> e.param === name)18 if(error){19 return error.msg;20 }21 }22 return ''23})24hbs.registerHelper('paginate', function(pagination, options) {25 var type = options.hash.type || 'middle';26 var ret = '';27 var pageCount = Number(pagination.pageCount);28 var page = Number(pagination.page);29 var limit;30 if (options.hash.limit) limit = +options.hash.limit;31 //page pageCount32 var newContext = {};33 switch (type) {34 case 'middle':35 if (typeof limit === 'number') {36 var i = 0;37 var leftCount = Math.ceil(limit / 2) - 1;38 var rightCount = limit - leftCount - 1;39 if (page + rightCount > pageCount)40 leftCount = limit - (pageCount - page) - 1;41 if (page - leftCount < 1)42 leftCount = page - 1;43 var start = page - leftCount;44 while (i < limit && i < pageCount) {45 newContext = { n: start };46 if (start === page) newContext.active = true;47 ret = ret + options.fn(newContext);48 start++;49 i++;50 }51 }52 else {53 for (var i = 1; i <= pageCount; i++) {54 newContext = { n: i };55 if (i === page) newContext.active = true;56 ret = ret + options.fn(newContext);57 }58 }59 break;60 case 'previous':61 if (page === 1) {62 newContext = { disabled: true, n: 1 }63 }64 else {65 newContext = { n: page - 1 }66 }67 ret = ret + options.fn(newContext);68 break;69 case 'next':70 newContext = {};71 if (page === pageCount) {72 newContext = { disabled: true, n: pageCount }73 }74 else {75 newContext = { n: page + 1 }76 }77 ret = ret + options.fn(newContext);78 break;79 case 'first':80 if (page === 1) {81 newContext = { disabled: true, n: 1 }82 }83 else {84 newContext = { n: 1 }85 }86 ret = ret + options.fn(newContext);87 break;88 case 'last':89 if (page === pageCount) {90 newContext = { disabled: true, n: pageCount }91 }92 else {93 newContext = { n: pageCount }94 }95 ret = ret + options.fn(newContext);96 break;97 }98 return ret;99});...
chains.js
Source:chains.js
1import { devideData } from '../algorithm/devideData';2import { complementData } from '../algorithm/complementData';3import { leshad } from '../algorithm/leshad';4import { gorn } from '../algorithm/gorn'5import basicPoyasa from '../utils/basicPoyasa.json'6import { SensorErrorHandler } from './Handlers/SensorErrorHandler';7//////////////////////// ABSTRACT IHANDLER8class IChainHandler {9 successor = null10 constructor(successor) { this.successor = successor }11 handle(context) { throw Error("Can't call abstract handler method handle()") }12}13//////////////////////// DEVIDE HANDLER14class DevideHandler extends IChainHandler {15 newContext16 constructor(successor = null) { super(successor) }17 async handle(context) {18 if (!context)19 throw Error("DevideHandler: context is null!")20 if (Object.keys(context).length === 2)21 this.newContext = await SensorErrorHandler.handle(context)22 else if (Array.isArray(context))23 this.newContext = devideData(context)24 return !!this.successor ? await this.successor.handle(this.newContext) : this.newContext25 }26}27//////////////////////// COMPLEMENT HANDLER28class ComplementHandler extends IChainHandler {29 constructor(successor = null) { super(successor) }30 async handle(context) {31 if (!context)32 throw Error("ComplementHandler: context is null!")33 const newContext = complementData(context)34 newContext["complementedBareTemps"] = {}35 Object.keys(newContext.bareTemps).forEach(poyas => {36 if (poyas !== "errors") {37 newContext.complementedBareTemps[poyas] = {}38 Object.keys(newContext.bareTemps[poyas]).forEach(luch => {39 newContext.complementedBareTemps[poyas][luch] = {}40 Object.keys(newContext.bareTemps[poyas][luch]).forEach(radius => {41 newContext.complementedBareTemps[poyas][luch][radius] = newContext.bareTemps[poyas][luch][radius]42 })43 })44 }45 })46 newContext.complementedBareTemps = complementData(newContext.complementedBareTemps)47 return !!this.successor ? await this.successor.handle(newContext) : newContext48 }49}50//////////////////////// LESHAD IHANDLER51class LeshadHandler extends IChainHandler {52 constructor(successor = null) { super(successor) }53 async handle(context) {54 if (!context)55 throw Error("LeshadHandler: context is null!")56 const newContext = leshad(context)57 return !!this.successor ? await this.successor.handle(newContext) : newContext58 }59}60//////////////////////// GORN IHANDLER61class GornHandler extends IChainHandler {62 constructor(successor = null) { super(successor) }63 async handle(context) {64 if (!context)65 throw Error("GornHandler: context is null!")66 const newContext = gorn(basicPoyasa, context)67 newContext.net1150 = context.net115068 newContext.errors = context.errors69 return !!this.successor ? await this.successor.handle(newContext) : newContext70 }71}72///// implementation73const gHandler = new GornHandler()74const lHandler = new LeshadHandler(gHandler)75const cHandler = new ComplementHandler(lHandler)76export const gornChain = new DevideHandler(cHandler)77const complementHandler = new ComplementHandler()...
handlebars-paginate.js
Source:handlebars-paginate.js
1/**2 * Based on handlebars-paginate https://github.com/olalonde/handlebars-paginate3 * License unknown4 * TODO: check license perms5 */6define([], function() {7 var paginate = function(pagination, options) {8 var type = options.hash.type || 'middle';9 var ret = '';10 var pageCount = pagination.totalPages;11 var currentPage = pagination.currentPage +1;12 var pageSize = pagination.pageSize;13 var totalRecords = pagination.totalRecords;14 var limit;15 if (options.hash.limit)16 limit = +options.hash.limit;17 //page pageCount18 var newContext =19 {20 };21 switch (type)22 {23 case 'middle':24 if ( typeof limit === 'number')25 {26 var i = 0;27 var leftCount = Math.ceil(limit / 2) - 1;28 var rightCount = limit - leftCount - 1;29 if (currentPage + rightCount > pageCount)30 leftCount = limit - (pageCount - currentPage) - 1;31 if (currentPage - leftCount < 1)32 leftCount = currentPage - 1;33 var start = currentPage - leftCount;34 while (i < limit && i < pageCount)35 {36 newContext =37 {38 n : start39 };40 if (start === currentPage)41 newContext.active = true;42 ret = ret + options.fn(newContext);43 start++;44 i++;45 }46 }47 else48 {49 for (var i = 1; i <= pageCount; i++)50 {51 newContext =52 {53 n : i54 };55 if (i === currentPage)56 newContext.active = true;57 ret = ret + options.fn(newContext);58 }59 }60 break;61 case 'previous':62 if (currentPage === 1)63 {64 newContext =65 {66 disabled : true,67 n : 168 }69 }70 else71 {72 newContext =73 {74 n : currentPage - 175 }76 }77 ret = ret + options.fn(newContext);78 break;79 case 'next':80 newContext =81 {82 };83 if (currentPage === pageCount)84 {85 newContext =86 {87 disabled : true,88 n : pageCount89 }90 }91 else92 {93 newContext =94 {95 n : currentPage + 196 }97 }98 ret = ret + options.fn(newContext);99 break;100 case 'info':101 // Keep current pagination state values102 newContext = pagination;103 // First record of current page104 newContext.startRecord = ((currentPage-1) * pageSize) +1;105 // Last record of current page106 newContext.endRecord = currentPage * pageSize;107 newContext.endRecord > totalRecords ? newContext.endRecord = totalRecords : null;108 109 ret = ret + options.fn(newContext);110 break;111 }112 return ret;113 };114 return paginate;...
paginate.js
Source:paginate.js
1module.exports = function(pagination, options) {2 let type = options.hash.type || 'middle';3 let ret = '';4 const pageCount = Number(pagination.pageCount);5 const page = Number(pagination.page);6 let str = pagination.str;7 let limit;8 if (options.hash.limit) limit = +options.hash.limit;9 //page pageCount10 let newContext = {};11 switch (type) {12 case 'middle':13 if (typeof limit === 'number') {14 let i = 0;15 let leftCount = Math.ceil(limit / 2) - 1;16 let rightCount = limit - leftCount - 1;17 if (page + rightCount > pageCount)18 leftCount = limit - (pageCount - page) - 1;19 if (page - leftCount < 1)20 leftCount = page - 1;21 let start = page - leftCount;22 while (i < limit && i < pageCount) {23 newContext = { n: start, str };24 if (start === page) newContext.active = true;25 ret = ret + options.fn(newContext);26 start++;27 i++;28 }29 }30 else {31 for (let i = 1; i <= pageCount; i++) {32 newContext = { n: i, str };33 if (i === page) newContext.active = true;34 ret = ret + options.fn(newContext);35 }36 }37 break;38 case 'previous':39 if (page === 1) {40 newContext = { disabled: true, n: 1, str };41 }42 else {43 newContext = { n: page - 1, str };44 }45 ret = ret + options.fn(newContext);46 break;47 case 'next':48 newContext = {};49 if (page === pageCount) {50 newContext = { disabled: true, n: pageCount, str };51 }52 else {53 newContext = { n: page + 1, str };54 }55 ret = ret + options.fn(newContext);56 break;57 case 'first':58 if (page === 1) {59 newContext = { disabled: true, n: 1, str };60 }61 else {62 newContext = { n: 1, str };63 }64 ret = ret + options.fn(newContext);65 break;66 case 'last':67 if (page === pageCount) {68 newContext = { disabled: true, n: pageCount, str };69 }70 else {71 newContext = { n: pageCount, str };72 }73 ret = ret + options.fn(newContext);74 break;75 }76 return ret;...
Using AI Code Generation
1var wpt = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org');3 if (err) return console.error(err);4 console.log('Test submitted to WebPagetest! Check back later for results.');5 console.log('Test ID: %s', data.data.testId);6});7wpt.getTestResults('testId', function(err, data) {8 if (err) return console.error(err);9 console.log(data);10});11var wpt = require('webpagetest');12var wpt = new WebPageTest('www.webpagetest.org');13 if (err) return console.error(err);14 console.log('Test submitted to WebPagetest! Check back later for results.');15 console.log('Test ID: %s', data.data.testId);16});17wpt.getTestResults('testId', function(err, data) {18 if (err) return console.error(err);19 console.log(data);20});
Using AI Code Generation
1var wpt = require('webpagetest');2var options = {3};4var wpt = new WebPageTest('www.webpagetest.org', options.key);5wpt.newContext(function(err, data) {6 if (err) {7 console.log(err);8 } else {9 console.log(data);10 }11});12var wpt = require('webpagetest');13var options = {14};15var wpt = new WebPageTest('www.webpagetest.org', options.key);16wpt.newContext(function(err, data) {17 if (err) {18 console.log(err);19 } else {20 console.log(data);21 }22});23var wpt = require('webpagetest');24var options = {25};26var wpt = new WebPageTest('www.webpagetest.org', options.key);27wpt.newContext(function(err, data) {28 if (err) {29 console.log(err);30 } else {31 console.log(data);32 }33});34var wpt = require('webpagetest');35var options = {
Using AI Code Generation
1var wpt = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org');3wpt.newContext(function(err, data) {4 if (err) {5 console.log('Error: ' + err);6 } else {7 console.log('New context: ' + data);8 }9});
Using AI Code Generation
1var wpt = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org');3wpt.newContext(function(err, context) {4 if (err) {5 console.log('Error creating new context: ' + err);6 } else {7 if (err) {8 console.log('Error starting test: ' + err);9 } else {10 console.log('Test started: ' + data.data.testId);11 }12 });13 }14});15var wpt = require('webpagetest');16var wpt = new WebPageTest('www.webpagetest.org');17wpt.newContext(function(err, context) {18 if (err) {19 console.log('Error creating new context: ' + err);20 } else {21 if (err) {22 console.log('Error starting test: ' + err);23 } else {24 console.log('Test started: ' + data.data.testId);25 }26 });27 }28});29var wpt = require('webpagetest');30var wpt = new WebPageTest('www.webpagetest.org');31wpt.newContext(function(err, context) {32 if (err) {33 console.log('Error creating new context: ' + err);34 } else {35 if (err) {36 console.log('Error starting test: ' + err);37 } else {38 console.log('Test started: ' + data.data.testId);39 }40 });41 }42});43var wpt = require('webpagetest');44var wpt = new WebPageTest('www.webpagetest.org');45wpt.newContext(function(err, context) {46 if (err) {47 console.log('Error creating new context: ' + err);48 } else {
Using AI Code Generation
1var wpt = require('webpagetest');2var client = wpt('www.webpagetest.org', 'A.12345678901234567890123456789012');3client.newContext(function(err, data) {4 if (err) {5 console.log(err);6 } else {7 console.log(data);8 }9});10var wpt = require('webpagetest');11var client = wpt('www.webpagetest.org', 'A.12345678901234567890123456789012');12client.deleteContext(1234, function(err, data) {13 if (err) {14 console.log(err);15 } else {16 console.log(data);17 }18});19var wpt = require('webpagetest');20var client = wpt('www.webpagetest.org', 'A.12345678901234567890123456789012');21client.getContext(1234, function(err, data) {22 if (err) {23 console.log(err);24 } else {25 console.log(data);26 }27});28var wpt = require('webpagetest');29var client = wpt('www.webpagetest.org', 'A.12345678901234567890123456789012');30client.getLocations(function(err, data) {31 if (err) {32 console.log(err);33 } else {34 console.log(data);35 }36});37var wpt = require('webpagetest');38var client = wpt('www.webpagetest.org', 'A.12345678901234567890123456789012');39client.getTesters(function(err, data) {40 if (err) {41 console.log(err);42 } else {43 console.log(data);44 }45});46var wpt = require('webpagetest');47var client = wpt('www.webpagetest.org', 'A.12345678901234567890123456789012');48client.getTesters(function(err, data) {49 if (err) {50 console.log(err);
Using AI Code Generation
1var wptdriver = require('wptdriver');2wptdriver.newContext(function(err, context) {3 if (err) {4 console.log('Error: ' + err);5 return;6 }7 if (err) {8 console.log('Error: ' + err);9 return;10 }11 context.find('input[name="q"]', function(err, element) {12 if (err) {13 console.log('Error: ' + err);14 return;15 }16 element.sendKeys('Hello World', function(err) {17 if (err) {18 console.log('Error: ' + err);19 return;20 }21 context.find('input[name="btnG"]', function(err, button) {22 if (err) {23 console.log('Error: ' + err);24 return;25 }26 button.click(function(err) {27 if (err) {28 console.log('Error: ' + err);29 return;30 }31 context.close(function(err) {32 if (err) {33 console.log('Error: ' + err);34 return;35 }36 });37 });38 });39 });40 });41 });42});43var wptdriver = require('wptdriver');44wptdriver.newContext(function(err, context) {45 if (err) {46 console.log('Error: ' + err);47 return;48 }49 if (err) {50 console.log('Error: ' + err);51 return;52 }53 context.find('input[name="p"]', function(err, element) {54 if (err) {55 console.log('Error: ' + err);56 return;57 }58 element.sendKeys('Hello World', function(err) {59 if (err) {60 console.log('Error: ' + err);61 return;62 }63 context.find('input[type="submit"]', function(err, button) {64 if (err) {65 console.log('Error: ' + err);66 return;67 }68 button.click(function(err) {69 if (err) {70 console.log('Error: ' + err);71 return;72 }73 context.close(function(err) {74 if (err)
Using AI Code Generation
1var wpt = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org', 'A.3d8b7e9e9c4c7d4f4c8b7e9e9c4c7d4f4');3wpt.newContext('myContext', function(err, data) {4 if (err) {5 console.log(err);6 } else {7 console.log(data);8 }9});10var wpt = require('webpagetest');11var wpt = new WebPageTest('www.webpagetest.org', 'A.3d8b7e9e9c4c7d4f4c8b7e9e9c4c7d4f4');12wpt.newContext('myContext', function(err, data) {13 if (err) {14 console.log(err);15 } else {16 console.log(data);17 }18});19var wpt = require('webpagetest');20var wpt = new WebPageTest('www.webpagetest.org', 'A.3d8b7e9e9c4c7d4f4c8b7e9e9c4c7d4f4');21wpt.newContext('myContext', function(err, data) {22 if (err) {23 console.log(err);24 } else {25 console.log(data);26 }27});28var wpt = require('webpagetest');29var wpt = new WebPageTest('www.webpagetest.org', 'A.3d8b7e9e9c4c7d4f4c8b7e9e9c4c7d4f4');30wpt.newContext('myContext', function(err, data) {31 if (err) {32 console.log(err);33 } else {34 console.log(data);35 }36});37var wpt = require('webpagetest');38var wpt = new WebPageTest('www.webpagetest.org', 'A.3d8b7e
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!