diff --git a/Examples/GenerateData/GenDataForCustomReport.ps1 b/Examples/GenerateData/GenDataForCustomReport.ps1 new file mode 100644 index 0000000..9f4d94f --- /dev/null +++ b/Examples/GenerateData/GenDataForCustomReport.ps1 @@ -0,0 +1,41 @@ +if(!(gcm ig1 -ErrorAction SilentlyContinue)) { + + "Use ``Install-Module NameIT`` to get the needed module from the gallery to support running this script" + + return +} + +$sign=@{sign=echo + -} +$location=@{location=echo Atlanta Newark Washington Chicago Philadelphia Houston Phoneix} + +$(1..6 | % { + + $from=$to="" + while($from -eq $to) { + $from=ig "[location]" -CustomData $location + $to=ig "[location]" -CustomData $location + } + + [double]$a=ig "########" + [double]$b=ig ".####" + [double]$c=ig "#######" + [double]$d=ig "[sign].##" -CustomData $sign + [double]$e=ig "###" + [double]$f=ig "[sign]##" -CustomData $sign + + #"{0},{1},{2},{3},{4},{5},{6},{7}" -f $from, $to, $a, $b, $c, $d, $e, $f + + [PSCustomObject][Ordered]@{ + From=$from + To=$to + RDollars=$a + RPercent=$b + MDollars=$c + MPercent=$d + Revenue=$e + Margin=$f + } +} | ConvertTo-Csv -NoTypeInformation) -replace '"','' + +#| Export-Excel +# | ConvertTo-Csv -NoTypeInformation) -replace '"','' | ConvertFrom-Csv | Export-Excel \ No newline at end of file