Dies ist ein Powershell-Script. Bitte erstelle die… · The Chat Archive
Explore / Programming Dies ist ein Powershell-Script. Bitte erstelle die Funktion des Buttons "$ButtonOutput",… Save Share Download ▾ ReportDies ist ein Powershell-Script. Bitte erstelle die Funktion des Buttons "$ButtonOutput", so dass folgendes passiert:
der Tree ReportStruk enthält die Organisationsstruktur, anhand derer die Outputs erstellt werden sollen. Alle Knoten unterhalb der Gesamtebene stellen Variablen des Datensatzes ($WSdata) dar. Für jeden Knoten soll ein eigener Output anhand der verschiedenen Ausprägungen der Variable erstellt werden. Sofern Unterknoten bestehen, werden diese für die jeweils derzeit gültige Ausprägung des übergeordneten Knotens erstellt. Wenn der Knoten oder der jeweilige Unterknoten weniger als 6 Personen beeinhaltet, wird statt der Auswertung ein "Datensatz zu klein (Kriterium)" im Output dargestellt.
Der Tree Outputstruk enthält die Variablen, die innerhalb des Outputs vorkommen sollen. Es soll für jeden Output eine Excel erstellt werden, die die Ebene des aktuell bearbeiteten Outputs sowie das im Bearbeitungsschritt gültige Variablenlabel und das im Arbeitsschritt gültige Label der Ausprägung der Variable im Namen der Excel beinhaltet. Das erste Tabellenblatt soll "Summary" heißen. Hier ist aufgelistet, um welche aktuell ausgewertete Variable und um welche Ausprägung dieser es sich handelt, sowie die Anzahl an Fällen im Datensatz. Es soll in dieser zudem die Abschnitte "Belastungen", "Ressourcen" und "Beanspruchung" geben, diese umfassen wiederum die Unterpunkte, die in dem Tree-Element dargestellt sind. Für jeden Knoten soll gecheckt werden, ob der Text des Knotens einem Variablennamen aus der $ItemsAndIndizesList entspricht. Falls ja, bedeutet das, dass der über geordnete Knoten im Output durch diese Variable definiert ist. Für den Abschnitt " Belastungen" sollen nun die entsprechenden Subabschnitte gebildet werden, hierbei werden für jede angegebene Variable der Mittelwert sowie die Standardabweichung für die aktuell ausgewertete Organisationseinheit berechnet.
Script:
###GUI bauen
#Hide PowerShell Console
Add-Type -Name Window -Namespace Console -MemberDefinition '
[DllImport("Kernel32.dll")]
public static extern IntPtr GetConsoleWindow();
[DllImport("user32.dll")]
public static extern bool ShowWindow(IntPtr hWnd, Int32 nCmdShow);
'
c o n s o l e P t r = [ C o n s o l e . W i n d o w ] consolePtr, 0)
Show full message · 2,353 lines Assistant2025-01-03 18:18 UTC Copy response
Copy first prompt
Details
Provider OpenAI
Model provenance As recorded by source dataset
Turns 1 (2 messages)
Language de
Conversation date Jan 3, 2025
Added to archive Nov 16, 2026
ID 01m7h42cpd8nt62aza9npxs595Source & license Imported from WildChat-4.8M (AI2) (source ). Imported records earn no Research Points.
Upstream record: afb424ff60dc56207d3b8e09ea3cc2b3
Zhao et al., WildChat: 1M ChatGPT Interaction Logs in the Wild (ICLR 2024). Contains information from WildChat-4.8M, made available under the ODC Attribution License.
License: ODC-BY-1.0
: : G e t C o n s o l e W i n d o w ( ) [ C o n s o l e . W i n d o w ] : : S h o w W i n d o w ( consolePtr = [Console.Window]::GetConsoleWindow()
[Console.Window]::ShowWindow( co n so l e P t r = [ C o n so l e . W in d o w ] :: G e tC o n so l e W in d o w ( ) [ C o n so l e . W in d o w ] :: S h o w W in d o w (
#Excel mit Projektdaten öffnen
o b j E x c e l = N e w − O b j e c t − C o m O b j e c t E x c e l . A p p l i c a t i o n objExcel = New-Object -ComObject Excel.Application
o bj E x ce l = N e w − O bj ec t − C o m O bj ec tE x ce l . A ppl i c a t i o n objExcel.Visible = f a l s e false
f a l se objExcel.DisplayAlerts=$false
p r o j e c t L i s t = N e w − O b j e c t S y s t e m . C o l l e c t i o n s . G e n e r i c . L i s t [ S y s t e m . O b j e c t ] projectList=New-Object System.Collections.Generic.List[System.Object]
p r o j ec t L i s t = N e w − O bj ec tS y s t e m . C o l l ec t i o n s . G e n er i c . L i s t [ S y s t e m . O bj ec t ] itemConcepts=New-Object System.Collections.Generic.List[System.Object]
$indexConcepts=New-Object System.Collections.Generic.List[System.Object]
#W B p r o j e c t D a t a = WBprojectData= W B p r o j ec t D a t a = objExcel.Workbooks.Open("F:\01 Programmierung\03 Programmierung\Polizeiberichte und Programmierung\Strukturierung Programm!Data\Projektliste.xlsx")
W B p r o j e c t D a t a = WBprojectData= W B p r o j ec t D a t a = objExcel.Workbooks.Open("F:\Ai1!Admin\Projektliste.xlsx")
foreach(W S i n WS in W S in WBprojectData.Worksheets){
S c r i p t : p r o j e c t L i s t . a d d ( Script:projectList.add( S cr i pt : p r o j ec t L i s t . a dd ( WS.name)
}
#W B i t e m C o n c e p t s = WBitemConcepts= W B i t e m C o n ce pt s = objExcel.Workbooks.Open("T:\2-GB+AP+GB_Hessen\05 Team\Tools, Programme und kleine Helferlein\Ai1!Data\Itemkonzepte.xlsx")
W B i t e m C o n c e p t s = WBitemConcepts= W B i t e m C o n ce pt s = objExcel.Workbooks.Open("F:\Ai1!Admin!Data\Itemkonzepte.xlsx")
foreach(W S i n WS in W S in WBitemConcepts.Worksheets){
S c r i p t : i t e m C o n c e p t s . a d d ( Script:itemConcepts.add( S cr i pt : i t e m C o n ce pt s . a dd ( WS.name)
}
#W B i n d e x C o n c e p t s = WBindexConcepts= W B in d e x C o n ce pt s = objExcel.Workbooks.Open("T:\2-GB+AP+GB_Hessen\05 Team\Tools, Programme und kleine Helferlein\Ai1!Data\Indexkonzepte.xlsx")
W B i n d e x C o n c e p t s = WBindexConcepts= W B in d e x C o n ce pt s = objExcel.Workbooks.Open("F:\Ai1!Admin!Data\Indexkonzepte.xlsx")
foreach(W S i n WS in W S in WBindexConcepts.Worksheets){
S c r i p t : i n d e x C o n c e p t s . a d d ( Script:indexConcepts.add( S cr i pt : in d e x C o n ce pt s . a dd ( WS.name)
}
}
catch{
"Projekt-, Konzept- oder Indexliste konnte nicht gefunden werden."
}
Sample showing a PowerShell GUI with drag-and-drop [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
Create form
Setup Variablen
P r o j e k t = " " Projekt=""
P r o j e k t = "" counter=0
f i l e n a m e E x c e l = " " filenameExcel=""
f i l e nam e E x ce l = "" Variablen=New-Object System.Collections.Generic.List[System.Object]
V a r I n h a l t = N e w − O b j e c t S y s t e m . C o l l e c t i o n s . G e n e r i c . L i s t [ S y s t e m . O b j e c t ] VarInhalt=New-Object System.Collections.Generic.List[System.Object]
V a r I nha l t = N e w − O bj ec tS y s t e m . C o l l ec t i o n s . G e n er i c . L i s t [ S y s KuerzelListeTabelle=New-Object System.Collections.Generic.List[System.Object]
S k a l e n P u n k t R e i h e = ′ ′ SkalenPunktReihe=''
S k a l e n P u nk tR e ih e = ′′ CurrentRowItemDataGrid=''
d i c t R e k V a r = [ o r d e r e d ] @ dictRekVar=[ordered]@{}
d i c tR e k V a r = [ or d er e d ] @ indexlist=New-Object System.Collections.Generic.List[System.Object]
i n d e x L i s t I t e m s = N e w − O b j e c t S y s t e m . C o l l e c t i o n s . G e n e r i c . L i s t [ S y s t e m . O b j e c t ] indexListItems=New-Object System.Collections.Generic.List[System.Object]
in d e xL i s t I t e m s = N e w ItemsAndIndizes=New-Object System.Collections.Generic.List[System.Object]
I t e m s A n d I n d i z e s D e s c = N e w − O b j e c t S y s t e m . C o l l e c t i o n s . G e n e r i c . L i s t [ S y s t e m . O b j e c t ] ItemsAndIndizesDesc=New-Object System.Collections.Generic.List[System.Object]
I t e m s A n d I n d i z esD esc = potentialDemosItems=New-Object System.Collections.Generic.List[System.Object]
p o t e n t i a l D e m o s D e s c r = N e w − O b j e c t S y s t e m . C o l l e c t i o n s . G e n e r i c . L i s t [ S y s t e m . O b j e c t ] potentialDemosDescr=New-Object System.Collections.Generic.List[System.Object]
p o t e n t ia l D e m osD escr = potentialDemosScale=New-Object System.Collections.Generic.List[System.Object]
$categoryList=New-Object System.Collections.ArrayList
MASCyan= "#A4CADE"
MASCyanRGB = [System.Drawing.Color]::FromArgb(165,200,220)
#M A S C y a n = C o l o r . F r o m A r g b ( MASCyan=Color.FromArgb( M A S C y an = C o l or . F r o m A r g b ( MASCyan.Replace("#", "0x"))
t e x t F a r b e = textFarbe= t e x tF a r b e = MASBlue
b u t t o n T e x t F a r b e = buttonTextFarbe= b u tt o n T e x tF a r b e = MASBlue
White="#FFFFFF"
WhiteRGB=[System.Drawing.Color]::FromArgb(255,255,255)
M A S B l u e R G B = [ S y s t e m . D r a w i n g . C o l o r ] : : F r o m A r g b ( 10 , 90 , 119 ) MASBlueRGB=[System.Drawing.Color]::FromArgb(10,90,119)
M A S B l u e R GB = [ S y s t e m . D r a w in g MASGreyRGB=[System.Drawing.Color]::FromArgb(218,218,218)
M A S O r a n g e R G B = [ S y s t e m . D r a w i n g . C o l o r ] : : F r o m A r g b ( 202 , 83 , 54 ) MASOrangeRGB=[System.Drawing.Color]::FromArgb(202,83,54)
M A S O r an g e R GB = [ S y s t e m . D r a Black=[System.Drawing.Color]::FromArgb(0,0,0)
B u t t o n f a r b e = Buttonfarbe= B u tt o n f a r b e = White
b u t t o n T e x t F a r b e = buttonTextFarbe= b u tt o n T e x tF a r b e = MASBlue
E x c e l P f a d = " " ExcelPfad=""
E x ce l P f a d = "" ResultsPfad=""
V o r l a g e n P f a d e = N e w − O b j e c t S y s t e m . C o l l e c t i o n s . G e n e r i c . L i s t [ S y s t e m . O b j e c t ] VorlagenPfade=New-Object System.Collections.Generic.List[System.Object]
V or l a g e n P f a d e = N e w − O bj ec tS y s t e m . C o l l ec t i o n s . G e n er i c . L i AusgabePfad=""
Function TextFarbeAnpassen{Param(V a r L i s t , VarList, V a r L i s t , Farbe)
foreach(V a r i n Var in V a r in VarList){
V a r . F o r e C o l o r = Var.ForeColor= V a r . F or e C o l or = Farbe}
}
Function ButtonFarbeAnpassen{Param(V a r L i s t , VarList, V a r L i s t , Farbe)
foreach(V a r i n Var in V a r in VarList){
V a r . B a c k C o l o r = Var.BackColor= V a r . B a c k C o l or = Farbe}
}
Add-Type -AssemblyName System.Windows.Forms
C h e c k = [ S y s t e m . W i n d o w s . F o r m s . S c r e e n ] : : A l l S c r e e n s Check=[System.Windows.Forms.Screen]::AllScreens
C h ec k = [ S y s t e m . W in d o w s . F or m s . S cr ee n ] :: A l l S cr ee n s Check=Check |Where-Object { _.Primary -like "True"}
H o e h e = Hoehe= H oe h e = Check.Bounds.Size.Height
B r e i t e = Breite= B r e i t e = Check.Bounds.Size.Width
#S k a l a = [ S y s t e m . W i n d o w s . F o r m s . S y s t e m I n f o r m a t i o n ] : : V i r t u a l S c r e e n . H e i g h t / Skala=[System.Windows.Forms.SystemInformation]::VirtualScreen.Height/ S k a l a = [ S y s t e m . W in d Hoehe
if (Hoehe -lt 1080){
Skala=H o e h e / 1080 Hoehe/1080
H oe h e /1080 Anpassen=1080/Hoehe
}
else{
Skala=1
$Anpassen=1}
B r e i t e = Breite= B r e i t e = Breite0.75 Anpassen
# MinBreite=B r e i t e ∗ 0.5 Breite*0.5
B r e i t e ∗ 0.5 Hoehe=H o e h e ∗ 0.75 ∗ Hoehe*0.75* H oe h e ∗ 0.75 ∗ Anpassen
#M i n H o e h e = MinHoehe= M in H oe h e = Hoehe*0.5
Startseite: Fenster bauen f o r m S t a r t = N e w − O b j e c t S y s t e m . W i n d o w s . F o r m s . F o r m formStart = New-Object System.Windows.Forms.Form
f or m S t a r t = N e w − O bj ec tS y s t e m . W in d o w s . F or m s . F or m formStart.Text = "Ai1 Reporting"
f o r m S t a r t . A u t o S i z e = formStart.AutoSize= f or m S t a r t . A u t o S i z e = True
f o r m S t a r t . S i z e = N e w − O b j e c t S y s t e m . D r a w i n g . S i z e ( formStart.Size = New-Object System.Drawing.Size( f or m S t a r t . S i z e = N e w − O bj ec tS Breite,H o e h e ) Hoehe)
H oe h e ) formStart.StartPosition = "CenterScreen"
#f o r m S t a r t . M i n i m u m S i z e = formStart.MinimumSize = f or m S t a r t . M inim u m S i z e = formStart.Size
#f o r m S t a r t . M i n i m u m S i z e = N e w − O b j e c t S y s t e m . D r a w i n g . S i z e ( formStart.MinimumSize = New-Object System.Drawing.Size( f or m S t a r t . M inim u m S i z e = N e w − MinBreite,M i n H o e h e ) MinHoehe)
M in H oe h e ) formStart.MaximumSize =f o r m S t a r t . S i z e formStart.Size
f or m S t a r t . S i z e formStart.MaximizeBox = F a l s e False
F a l se formStart.MinimizeBox = True
# formStart.Topmost = T r u e True
T r u e formStart.BackColor =W h i t e White
W hi t e formStart.AutoScroll = True
# formStart.ScrollControlIntoView($logoMAS)
tabControl = New-Object System.Windows.Forms.TabControl
# tabControl.Location = New-Object System.Drawing.Point((B r e i t e ∗ 0.125 ) , 100 ) Breite*0.125),100)
B r e i t e ∗ 0.125 ) , 100 ) tabControl.Size = New-Object System.Drawing.Size((B r e i t e − 20 ) , ( Breite-20),( B r e i t e − 20 ) , ( Hoehe-50))
#t a b C o n t r o l . S i z e = N e w − O b j e c t S y s t e m . D r a w i n g . S i z e ( ( tabControl.Size = New-Object System.Drawing.Size(( t ab C o n t r o l . S i z e = N e w − O bj ec Breite),(H o e h e ) ) Hoehe))
H oe h e )) tabControl.ForeColor =textFarbe
# tabControl.BackColor= W h i t e White
W hi t e tabControl.Font=New-Object System.Drawing.Font("Arial",12,[System.Drawing.FontStyle]::Bold)
t a b C o n t r o l . H o t T r a c k = tabControl.HotTrack= t ab C o n t r o l . H o tT r a c k = True
t a b C o n t r o l . S i z e M o d e = 1 tabControl.SizeMode=1
t ab C o n t r o l . S i z e M o d e = 1 tabControl.Appearance=1
t a b C o n t r o l . S h o w T o o l T i p s = tabControl.ShowToolTips = t ab C o n t r o l . S h o w T oo l T i p s = true
t a b C o n t r o l . A u t o S i z e = tabControl.AutoSize= t ab C o n t r o l . A u t o S i z e = True
T e x t s i z e S t a r t T e x t = 24 TextsizeStartText=24
T e x t s i z e S t a r tT e x t = 24 labelStart = New-Object Windows.Forms.Label
l a b e l S t a r t . T e x t = " A l l i n 1 R e p o r t i n g − S y s t e m " labelStart.Text = "All in 1 Reporting-System"
l ab e l S t a r t . T e x t = " A l l in 1 R e p or t in g − S y s t e m " labelStart.Font = New-Object System.Drawing.Font("Arial",T e x t s i z e S t a r t T e x t , [ S y s t e m . D r a w i n g . F o n t S t y l e ] : : B o l d ) TextsizeStartText,[System.Drawing.FontStyle]::Bold)
T e x t s i z e S t a r tT e x t , [ S y s t e m . D r labelStart.ForeColor =W h i t e White
W hi t e labelStart.BackColor = M A S B l u e MASBlue
M A S B l u e StartPunkt=(t a b C o n t r o l . W i d t h / 2 ) − ( 2 ∗ tabControl.Width/2)-(2* t ab C o n t r o l . W i d t h /2 ) − ( 2 ∗ LabelStart.Width)
l a b e l S t a r t . L o c a t i o n = N e w − O b j e c t S y s t e m . D r a w i n g . P o i n t ( ( labelStart.Location= New-Object System.Drawing.Point(( l ab e l S t a r t . L oc a t i o n = N e w − StartPunkt),50)
l a b e l S t a r t . S i z e = N e w − O b j e c t S y s t e m . D r a w i n g . S i z e ( 450 , 35 ) labelStart.Size=New-Object System.Drawing.Size(450,35)
l ab e l S t a r t . S i z e = N e w − O bj labelStart.TextAlign = 32
#######
####### Tab1
#######
t a b P a g e 1 = N e w − O b j e c t S y s t e m . W i n d o w s . F o r m s . T a b P a g e tabPage1= New-Object System.Windows.Forms.TabPage
t ab P a g e 1 = N e w − O bj ec tS y s t e m . W in d o w s . F or m s . T ab P a g e tabPage1.Text = "Projektdaten"
#t a b P a g e 1. S i z e = n e w S y s t e m . D r a w i n g . S i z e ( 300 , 250 ) tabPage1.Size = new System.Drawing.Size(300, 250)
t ab P a g e 1. S i z e = n e w S y s t e m . D r a w in g tabPage1.TabIndex = 0
t a b P a g e 1. B a c k C o l o r = tabPage1.BackColor = t ab P a g e 1. B a c k C o l or = MASBlue
t a b P a g e 1. F o n t = N e w − O b j e c t S y s t e m . D r a w i n g . F o n t ( " A r i a l " , tabPage1.Font = New-Object System.Drawing.Font("Arial", t ab P a g e 1. F o n t = N e w − O bj ec tS TextsizeStartText,[System.Drawing.FontStyle]::Bold)
P r o j e k t S i z e = 12 ProjektSize=12
P r o j e k tS i z e = 12 labelProjekt= New-Object Windows.Forms.Label
l a b e l P r o j e k t . T e x t = " P r o j e k t n a m e " labelProjekt.Text = "Projektname"
l ab e l P r o j e k t . T e x t = " P r o j e k t nam e " labelProjekt.Font = New-Object System.Drawing.Font("Arial",P r o j e k t S i z e , [ S y s t e m . D r a w i n g . F o n t S t y l e ] : : B o l d ) ProjektSize,[System.Drawing.FontStyle]::Bold)
P r o j e k tS i z e , [ S y s t e m . D r a w in g . F o labelProjekt.ForeColor = W h i t e White
W hi t e labelProjekt.location= New-Object System.Drawing.Point(100,75)
l a b e l P r o j e k t . A u t o s i z e = labelProjekt.Autosize= l ab e l P r o j e k t . A u t os i z e = True
#$labelProjekt.Size = New-Object System.Drawing.Size(190,50)
P r o j e k t = N e w − O b j e c t S y s t e m . W i n d o w s . F o r m s . C o m b o B o x Projekt = New-Object System.Windows.Forms.ComboBox
P r o j e k t = N e w − O bj ec tS y s t e m . W in d o w s . F or m s . C o mb o B o x Projekt.Location = New-Object System.Drawing.Point(100,100)
Projekt.Size = New-Object System.Drawing.Size(190,50)
# Test.Anchor=([System.Windows.Forms.AnchorStyles]::Right -bor [System.Windows.Forms.AnchorStyles]::Top -bor [System.Windows.Forms.DockStyle]::Left)
P r o j e k t . F o r e C o l o r = Projekt.ForeColor= P r o j e k t . F or e C o l or = textFarbe
Projekt.Font = New-Object System.Drawing.Font("Arial",10,[System.Drawing.FontStyle]::regular)
try{
foreach( name in projectList){
[void] Projekt.Items.Add($name)
}
}
catch{
"Projektliste konnte nicht gelesen werden"
}
L a d e n = N e w − O b j e c t W i n d o w s . F o r m s . B u t t o n Laden= New-Object Windows.Forms.Button
L a d e n = N e w − O bj ec t W in d o w s . F or m s . B u tt o n Laden.location= New-Object System.Drawing.Point(350,90)
L a d e n . T e x t = " V o r h a n d e n e P r o j e k t d a t e n l a d e n " Laden.Text="Vorhandene Projektdaten laden"
L a d e n . T e x t = " V or han d e n e P r o j e k t d a t e n Laden.Backcolor=B u t t o n f a r b e Buttonfarbe
B u tt o n f a r b e Laden.ForeColor=b u t t o n T e x t F a r b e buttonTextFarbe
b u tt o n T e x tF a r b e Laden.Font = New-Object System.Drawing.Font("Arial",10,[System.Drawing.FontStyle]::bold)
$Laden.Size = New-Object System.Drawing.Size(100,50)
P V P T e s t S i z e = 12 PVPTestSize=12
P V P T es tS i z e = 12 labelPVP= New-Object Windows.Forms.Label
l a b e l P V P . T e x t = " P r o j e k t v e r a n t w o r t l i c h e P e r s o n " labelPVP.Text = "Projektverantwortliche Person"
l ab e l P V P . T e x t = " P r o j e k t v er an tw or tl i c h e P er so n " labelPVP.Font = New-Object System.Drawing.Font("Arial",P V P T e s t S i z e , [ S y s t e m . D r a w i n g . F o n t S t y l e ] : : B o l d ) PVPTestSize,[System.Drawing.FontStyle]::Bold)
P V P T es tS i z e , [ S y s t e m . D r a w in g . F o n labelPVP.ForeColor = W h i t e White
W hi t e labelPVP.location= New-Object System.Drawing.Point(100,150)
#l a b e l P V P . A u t o s i z e = labelPVP.Autosize= l ab e l P V P . A u t os i z e = True
$labelPVP.Size = New-Object System.Drawing.Size(250,175)
P V P = N e w − O b j e c t S y s t e m . W i n d o w s . F o r m s . C o m b o B o x PVP = New-Object System.Windows.Forms.ComboBox
P V P = N e w − O bj ec tS y s t e m . W in d o w s . F or m s . C o mb o B o x PVP.Location = New-Object System.Drawing.Point(100,175)
PVP.Size = New-Object System.Drawing.Size(190,50)
# Test.Anchor=([System.Windows.Forms.AnchorStyles]::Right -bor [System.Windows.Forms.AnchorStyles]::Top -bor [System.Windows.Forms.DockStyle]::Left)
P V P . F o r e C o l o r = PVP.ForeColor= P V P . F or e C o l or = textFarbe
P V P . F o n t = N e w − O b j e c t S y s t e m . D r a w i n g . F o n t ( " A r i a l " , PVP.Font = New-Object System.Drawing.Font("Arial", P V P . F o n t = N e w − O bj ec tS y s t e Textsize,[System.Drawing.FontStyle]::regular)
$kuerzeltable =[ordered]@{
AP='Andrea Prues'
AC='Anna Caspelherr'
AE='Anna-Lisa Elger'
ES='Elena Stierstädter'
FB='Franziska Binder'
JMS='Jan-Michael Stürner'
JL='Dr. Jessica Lang'
KP='Kathrin Pauly'
LD='Lilly Dütz'
MB='Maria Sophie Bajorski'
MR='Meike Reimer'
MA='Miriam Agsten'
PD='Pauline Dewald'
SMH='Sophie-Minette Hundt'
TF='Dr. Tobias Felsing'
}
foreach(n a m e i n name in nam e in kuerzeltable.values){
[void] P V P . I t e m s . A d d ( PVP.Items.Add( P V P . I t e m s . A dd ( name)
}
D a t e n = N e w − O b j e c t W i n d o w s . F o r m s . B u t t o n Daten=New-Object Windows.Forms.Button
D a t e n = N e w − O bj ec t W in d o w s . F or m s . B u tt o n Daten.location= New-Object System.Drawing.Point(450,425)
D a t e n . T e x t = " D a t e n i n s S y s t e m l a d e n " Daten.Text="Daten ins System laden"
D a t e n . T e x t = " D a t e nin s S y s t e m l a d e n " Daten.Backcolor=B u t t o n f a r b e Buttonfarbe
B u tt o n f a r b e Daten.ForeColor=b u t t o n T e x t F a r b e buttonTextFarbe
b u tt o n T e x tF a r b e Daten.Font = New-Object System.Drawing.Font("Arial",10,[System.Drawing.FontStyle]::bold)
$Daten.Size = New-Object System.Drawing.Size(100,50)
l a b e l S o l l = N e w − O b j e c t W i n d o w s . F o r m s . L a b e l labelSoll= New-Object Windows.Forms.Label
l ab e l S o l l = N e w − O bj ec t W in d o w s . F or m s . L ab e l labelSoll.Text = "Anzahl befragter Personen"
l a b e l S o l l . F o n t = N e w − O b j e c t S y s t e m . D r a w i n g . F o n t ( " A r i a l " , labelSoll.Font = New-Object System.Drawing.Font("Arial", l ab e l S o l l . F o n t = N e w − O ProjektSize,[System.Drawing.FontStyle]::Bold)
l a b e l S o l l . F o r e C o l o r = labelSoll.ForeColor = l ab e l S o l l . F or e C o l or = White
l a b e l S o l l . l o c a t i o n = N e w − O b j e c t S y s t e m . D r a w i n g . P o i n t ( 100 , 225 ) labelSoll.location= New-Object System.Drawing.Point(100,225)
l ab e l S o l l . l oc a t i o n = N e w − labelSoll.Autosize=True
# labelProjekt.Size = New-Object System.Drawing.Size(190,50)
S o l l = N e w − O b j e c t W i n d o w s . F o r m s . T e x t b o x Soll= New-Object Windows.Forms.Textbox
S o l l = N e w − O bj ec t W in d o w s . F or m s . T e x t b o x Soll.location= New-Object System.Drawing.Point(100,250)
S o l l . A u t o s i z e = Soll.Autosize= S o l l . A u t os i z e = True
S o l l . F o r e C o l o r = Soll.ForeColor= S o l l . F or e C o l or = textFarbe
S o l l . F o n t = N e w − O b j e c t S y s t e m . D r a w i n g . F o n t ( " A r i a l " , Soll.Font = New-Object System.Drawing.Font("Arial", S o l l . F o n t = N e w − O bj ec tS y s t Textsize,[System.Drawing.FontStyle]::regular)
$Soll.Size = New-Object System.Drawing.Size(190,50)
l a b e l D a t u m S t a r t = N e w − O b j e c t W i n d o w s . F o r m s . L a b e l labelDatumStart = New-Object Windows.Forms.Label
l ab e l D a t u m S t a r t = N e w − O bj ec t W in d o w s . F or m s . L ab e l labelDatumStart.Text = "Startdatum der Befragung"
l a b e l D a t u m S t a r t . F o n t = N e w − O b j e c t S y s t e m . D r a w i n g . F o n t ( " A r i a l " , labelDatumStart.Font = New-Object System.Drawing.Font("Arial", l ab e l D a t u m S t a r t . F o n t = N ProjektSize,[System.Drawing.FontStyle]::Bold)
l a b e l D a t u m S t a r t . F o r e C o l o r = labelDatumStart.ForeColor = l ab e l D a t u m S t a r t . F or e C o l or = White
l a b e l D a t u m S t a r t . l o c a t i o n = N e w − O b j e c t S y s t e m . D r a w i n g . P o i n t ( 600 , 75 ) labelDatumStart.location= New-Object System.Drawing.Point(600,75)
l ab e l D a t u m S t a r t . l oc a t i o n = labelDatumStart.Autosize=True
# labelProjekt.Size = New-Object System.Drawing.Size(250,50)
DatumStart = New-Object Windows.Forms.MonthCalendar -Property @{
ShowTodayCircle = false
MaxSelectionCount = 1
ForeColor=W h i t e B a c k C o l o r = White
BackColor= W hi t e B a c k C o l or = MASBlue
TitleBackColor=W h i t e T i t l e F o r e C o l o r = White
TitleForeColor= W hi t e T i tl e F or e C o l or = MASBlue
TrailingForeColor=$MASCyan
}
D a t u m S t a r t . L o c a t i o n = N e w − O b j e c t S y s t e m . D r a w i n g . P o i n t ( 600 , 100 ) DatumStart.Location = New-Object System.Drawing.Point(600,100)
D a t u m S t a r t . L oc a t i o n = N e w − O bj ec tS y s t e m . D r a w in g . P o in t ( 600 , 100 ) DatumStart.Font = New-Object System.Drawing.Font("Arial",$ProjektSize,[System.Drawing.FontStyle]::Bold)
l a b e l D a t u m E n d e = N e w − O b j e c t W i n d o w s . F o r m s . L a b e l labelDatumEnde = New-Object Windows.Forms.Label
l ab e l D a t u m E n d e = N e w − O bj ec t W in d o w s . F or m s . L ab e l labelDatumEnde.Text = "Enddatum der Befragung"
l a b e l D a t u m E n d e . F o n t = N e w − O b j e c t S y s t e m . D r a w i n g . F o n t ( " A r i a l " , labelDatumEnde.Font = New-Object System.Drawing.Font("Arial", l ab e l D a t u m E n d e . F o n t = N e w ProjektSize,[System.Drawing.FontStyle]::Bold)
l a b e l D a t u m E n d e . F o r e C o l o r = labelDatumEnde.ForeColor = l ab e l D a t u m E n d e . F or e C o l or = White
l a b e l D a t u m E n d e . l o c a t i o n = N e w − O b j e c t S y s t e m . D r a w i n g . P o i n t ( 600 , 350 ) labelDatumEnde.location= New-Object System.Drawing.Point(600,350)
l ab e l D a t u m E n d e . l oc a t i o n = labelDatumEnde.Autosize=True
# labelProjekt.Size = New-Object System.Drawing.Size(150,50)
DatumEnde = New-Object Windows.Forms.MonthCalendar -Property @{
ShowTodayCircle = false
MaxSelectionCount = 1
ForeColor=W h i t e B a c k C o l o r = White
BackColor= W hi t e B a c k C o l or = MASBlue
TitleBackColor=W h i t e T i t l e F o r e C o l o r = White
TitleForeColor= W hi t e T i tl e F or e C o l or = MASBlue
TrailingForeColor=$MASCyan
}
D a t u m E n d e . L o c a t i o n = N e w − O b j e c t S y s t e m . D r a w i n g . P o i n t ( 600 , 375 ) DatumEnde.Location = New-Object System.Drawing.Point(600,375)
D a t u m E n d e . L oc a t i o n = N e w − O bj ec tS y s t e m . D r a w in g . P o in t ( 600 , 375 ) DatumEnde.Font = New-Object System.Drawing.Font("Arial",$ProjektSize,[System.Drawing.FontStyle]::Bold)
#DragDropExcel: Label
l a b e l E x c e l = N e w − O b j e c t W i n d o w s . F o r m s . L a b e l labelExcel = New-Object Windows.Forms.Label
l ab e l E x ce l = N e w − O bj ec t W in d o w s . F or m s . L ab e l labelExcel.Text = "Excel mit Rohdaten ablegen:"
l a b e l E x c e l . L o c a t i o n = ′ 100 , 350 ′ labelExcel.Location = '100,350'
l ab e l E x ce l . L oc a t i o n = ′ 100 , 35 0 labelExcel.Size = '250,25'
l a b e l E x c e l . F o r e C o l o r = labelExcel.ForeColor= l ab e l E x ce l . F or e C o l or = White
$labelExcel.Font = New-Object System.Drawing.Font("Arial",12,[System.Drawing.FontStyle]::bold)
E x c e l = N e w − O b j e c t W i n d o w s . F o r m s . L i s t B o x Excel = New-Object Windows.Forms.ListBox
E x ce l = N e w − O bj ec t W in d o w s . F or m s . L i s tB o x Excel.Location = '100,375'
E x c e l . H e i g h t = 150 Excel.Height = 150
E x ce l . H e i g h t = 150 Excel.Width = 325
#E x c e l . A n c h o r = ( [ S y s t e m . W i n d o w s . F o r m s . A n c h o r S t y l e s ] : : B o t t o m − b o r [ S y s t e m . W i n d o w s . F o r m s . A n c h o r S t y l e s ] : : L e f t − b o r [ S y s t e m . W i n d o w s . F o r m Excel.IntegralHeight = F a l s e False
F a l se Excel.AllowDrop = T r u e True
T r u e Excel.ForeColor=M A S B l u e MASBlue
M A S B l u e Excel.Font = New-Object System.Drawing.Font("Arial",$Textsize,[System.Drawing.FontStyle]::regular)
B u t t o n D e l E x c e l = N e w − O b j e c t W i n d o w s . F o r m s . B u t t o n ButtonDelExcel = New-Object Windows.Forms.Button
B u tt o n D e l E x ce l = N e w − O bj ec t W in d o w s . F or m s . B u tt o n ButtonDelExcel.location= New-Object System.Drawing.Point(100,550)
B u t t o n D e l E x c e l . T e x t = " D a t e n l o ¨ s c h e n " ButtonDelExcel.Text="Daten löschen"
B u tt o n D e l E x ce l . T e x t = " D a t e n l o ButtonDelExcel.Backcolor=B u t t o n f a r b e Buttonfarbe
B u tt o n f a r b e ButtonDelExcel.ForeColor=b u t t o n T e x t F a r b e buttonTextFarbe
b u tt o n T e x tF a r b e ButtonDelExcel.Font = New-Object System.Drawing.Font("Arial",10,[System.Drawing.FontStyle]::bold)
$ButtonDelExcel.Size = New-Object System.Drawing.Size(100,50)
#Button Projekt Speichern
S p e i c h e r n = N e w − O b j e c t W i n d o w s . F o r m s . B u t t o n Speichern= New-Object Windows.Forms.Button
S p e i c h er n = N e w − O bj ec t W in d o w s . F or m s . B u tt o n Speichern.location= New-Object System.Drawing.Point(950,163.5)
S p e i c h e r n . T e x t = " Z u m P r o j e k t k a t a l o g h i n z u f u ¨ g e n " Speichern.Text="Zum Projektkatalog hinzufügen"
S p e i c h er n . T e x t = " Z u m P r o j e k t k a Speichern.Backcolor=B u t t o n f a r b e Buttonfarbe
B u tt o n f a r b e Speichern.ForeColor=b u t t o n T e x t F a r b e buttonTextFarbe
b u tt o n T e x tF a r b e Speichern.Font = New-Object System.Drawing.Font("Arial",12,[System.Drawing.FontStyle]::bold)
$Speichern.Size = New-Object System.Drawing.Size(190,50)
#Button Konzept Speichern
K o n z e p t = N e w − O b j e c t W i n d o w s . F o r m s . B u t t o n Konzept=New-Object Windows.Forms.Button
K o n z e pt = N e w − O bj ec t W in d o w s . F or m s . B u tt o n Konzept.location= New-Object System.Drawing.Point(950,250)
K o n z e p t . T e x t = " A k t u e l l e s S e t u p a l s K o n z e p t s p e i c h e r n " Konzept.Text="Aktuelles Setup als Konzept speichern"
K o n z e pt . T e x t = " A k t u e l l es S e t u p a Konzept.Backcolor=B u t t o n f a r b e Buttonfarbe
B u tt o n f a r b e Konzept.ForeColor=b u t t o n T e x t F a r b e buttonTextFarbe
b u tt o n T e x tF a r b e Konzept.Font = New-Object System.Drawing.Font("Arial",12,[System.Drawing.FontStyle]::bold)
$Konzept.Size = New-Object System.Drawing.Size(190,50)
l a b e l P f a d = N e w − O b j e c t W i n d o w s . F o r m s . L a b e l labelPfad = New-Object Windows.Forms.Label
l ab e l P f a d = N e w − O bj ec t W in d o w s . F or m s . L ab e l labelPfad.Text = "Projektpfad auswählen"
l a b e l P f a d . F o n t = N e w − O b j e c t S y s t e m . D r a w i n g . F o n t ( " A r i a l " , 12 , [ S y s t e m . D r a w i n g . F o n t S t y l e ] : : B o l d ) labelPfad.Font = New-Object System.Drawing.Font("Arial",12,[System.Drawing.FontStyle]::Bold)
l ab e l P f a d . F labelPfad.ForeColor = W h i t e White
W hi t e labelPfad.location= New-Object System.Drawing.Point(950,350)
#l a b e l P V P . A u t o s i z e = labelPVP.Autosize= l ab e l P V P . A u t os i z e = True
$labelPfad.Size = New-Object System.Drawing.Size(250,25)
P f a d = N e w − O b j e c t W i n d o w s . F o r m s . T e x t b o x Pfad = New-Object Windows.Forms.Textbox
P f a d = N e w − O bj ec t W in d o w s . F or m s . T e x t b o x Pfad.location= New-Object System.Drawing.Point(950,375)
P f a d . A u t o s i z e = Pfad.Autosize= P f a d . A u t os i z e = True
P f a d . F o r e C o l o r = Pfad.ForeColor= P f a d . F or e C o l or = textFarbe
P f a d . F o n t = N e w − O b j e c t S y s t e m . D r a w i n g . F o n t ( " A r i a l " , Pfad.Font = New-Object System.Drawing.Font("Arial", P f a d . F o n t = N e w − O bj ec tS y s t Textsize,[System.Drawing.FontStyle]::regular)
$Pfad.Size = New-Object System.Drawing.Size(190,50)
b u t t o n P f a d = N e w − O b j e c t W i n d o w s . F o r m s . B u t t o n buttonPfad = New-Object Windows.Forms.Button
b u tt o n P f a d = N e w − O bj ec t W in d o w s . F or m s . B u tt o n buttonPfad.Location ='950,425'
b u t t o n P f a d . T e x t = ′ O r d n e r a u s w a ¨ h l e n ′ buttonPfad.Text ='Ordner auswählen'
b u tt o n P f a d . T e x t = ′ O r d n er a u s buttonPfad.BackColor =B u t t o n f a r b e Buttonfarbe
B u tt o n f a r b e buttonPfad.ForeColor = b u t t o n T e x t F a r b e buttonTextFarbe
b u tt o n T e x tF a r b e buttonPfad.Font = New-Object System.Drawing.Font("Arial",10,[System.Drawing.FontStyle]::bold)
$buttonPfad.Size = New-Object System.Drawing.Size(150,50)
p r o g r e s s b a r = N e w − O b j e c t W i n d o w s . F o r m s . P r o g r e s s B a r progressbar=New-Object Windows.Forms.ProgressBar
p r o g r ess ba r = N e w − O bj ec t W in d o w s . F or m s . P r o g r ess B a r progressbar.Location="100,25"
p r o g r e s s b a r . S i z e = N e w − O b j e c t S y s t e m . D r a w i n g . S i z e ( 300 , 25 ) progressbar.Size = New-Object System.Drawing.Size(300,25)
p r o g r ess ba r . S i z e = N e w − O bj progressbar.visible=f a l s e false
f a l se progressbar.Style="Blocks"
p r o g r e s s b a r . F o r e C o l o r = progressbar.ForeColor= p r o g r ess ba r . F or e C o l or = MASBlueRGB
p r o g r e s s b a r . B a c k C o l o r = progressbar.BackColor= p r o g r ess ba r . B a c k C o l or = WhiteRGB
progressbar.Text=""
# progressbar.Text.Forecolor=$WhiteRGB
p r o g r e s s b a r L a b e l = N e w − O b j e c t W i n d o w s . F o r m s . L a b e l progressbarLabel=New-Object Windows.Forms.Label
p r o g r ess ba r L ab e l = N e w − O bj ec t W in d o w s . F or m s . L ab e l progressbarLabel.Font = New-Object System.Drawing.Font("Arial",12,[System.Drawing.FontStyle]::Bold)
p r o g r e s s b a r L a b e l . F o r e C o l o r = progressbarLabel.ForeColor = p r o g r ess ba r L ab e l . F or e C o l or = White
progressbarLabel.location= New-Object System.Drawing.Point(410,28)
# labelPVP.Autosize=T r u e True
T r u e progressbarLabel.Size = New-Object System.Drawing.Size(250,25)
p r o g r e s s b a r L a b e l . T e x t = " " progressbarLabel.Text=""
p r o g r ess ba r L ab e l . T e x t = "" progressbarLabel.Visible=f a l s e false
f a l se progressbarLabel.BackColor = [System.Drawing.Color]::FromName("Transparent")
p r o g T x t = N e w − O b j e c t W i n d o w s . F o r m s . L a b e l progTxt=New-Object Windows.Forms.Label
p r o g T x t = N e w − O bj ec t W in d o w s . F or m s . L ab e l progTxt.Location="100,5"
p r o g T x t . F o n t = N e w − O b j e c t S y s t e m . D r a w i n g . F o n t ( " A r i a l " , 10 , [ S y s t e m . D r a w i n g . F o n t S t y l e ] : : B o l d ) progTxt.Font = New-Object System.Drawing.Font("Arial",10,[System.Drawing.FontStyle]::Bold)
p r o g T x t . F o n t progTxt.ForeColor = W h i t e White
W hi t e progTxt.Size = New-Object System.Drawing.Size(350,20)
p r o g T x t . T e x t = " " progTxt.Text=""
p r o g T x t . T e x t = "" progTxt.Visible=false
# transKey = "#c0c0c0"
progTxt.BackColor = [System.Drawing.Color]::FromName("Transparent")
# progTxt.TransparencyKey = [System.Drawing.Color]::FromName("Transparent")
#######
####### Tab2
#######
t a b P a g e 2 = N e w − O b j e c t S y s t e m . W i n d o w s . F o r m s . T a b P a g e tabPage2= New-Object System.Windows.Forms.TabPage
t ab P a g e 2 = N e w − O bj ec tS y s t e m . W in d o w s . F or m s . T ab P a g e tabPage2.Text = "Items"
#t a b P a g e 2. S i z e = n e w S y s t e m . D r a w i n g . S i z e ( 300 , 250 ) tabPage2.Size = new System.Drawing.Size(300, 250)
t ab P a g e 2. S i z e = n e w S y s t e m . D r a w in g tabPage2.TabIndex = 1
t a b P a g e 2. B a c k C o l o r = tabPage2.BackColor = t ab P a g e 2. B a c k C o l or = MASBlue
l a b e l I t e m s = N e w − O b j e c t W i n d o w s . F o r m s . L a b e l labelItems= New-Object Windows.Forms.Label
l ab e l I t e m s = N e w − O bj ec t W in d o w s . F or m s . L ab e l labelItems.Text = "Items"
l a b e l I t e m s . F o n t = N e w − O b j e c t S y s t e m . D r a w i n g . F o n t ( " A r i a l " , 12 , [ S y s t e m . D r a w i n g . F o n t S t y l e ] : : B o l d ) labelItems.Font = New-Object System.Drawing.Font("Arial",12,[System.Drawing.FontStyle]::Bold)
l ab e l I t e m s . F labelItems.ForeColor =W h i t e White
W hi t e labelItems.location= New-Object System.Drawing.Point(100,75)
#l a b e l P V P . A u t o s i z e = labelPVP.Autosize= l ab e l P V P . A u t os i z e = True
$labelItems.Size = New-Object System.Drawing.Size(250,25)
I t e m s = N e w − O b j e c t S y s t e m . W i n d o w s . F o r m s . D a t a G r i d V i e w Items = New-Object System.Windows.Forms.DataGridView
I t e m s = N e w − O bj ec tS y s t e m . W in d o w s . F or m s . D a t a G r i d V i e w Items.Location = New-Object System.Drawing.Point(100,100)
Items.Size = New-Object System.Drawing.Size(1200,400)
# Items.Anchor=([System.Windows.Forms.AnchorStyles]::Right -bor [System.Windows.Forms.AnchorStyles]::Top -bor [System.Windows.Forms.DockStyle]::Left)
I t e m s . F o r e C o l o r = Items.ForeColor= I t e m s . F or e C o l or = textFarbe
I t e m s . F o n t = N e w − O b j e c t S y s t e m . D r a w i n g . F o n t ( " A r i a l " , 11 , [ S y s t e m . D r a w i n g . F o n t S t y l e ] : : r e g u l a r ) Items.Font = New-Object System.Drawing.Font("Arial",11,[System.Drawing.FontStyle]::regular)
I t e m s . F o n t = Items.ColumnHeadersVisible = t r u e true
t r u e Items.ColumnHeadersHeight=50
I t e m s . R o w H e a d e r s W i d t h = 15 Items.RowHeadersWidth=15
I t e m s . R o w H e a d er s W i d t h = 15 Items.ColumnCount=5
I t e m s . C o l u m n s [ 0 ] . N a m e = " K u ¨ r z e l " Items.Columns[0].Name = "Kürzel"
I t e m s . C o l u mn s [ 0 ] . N am e = " K u ¨ r z e Items.Columns[0].Width = 100
I t e m s . C o l u m n s [ 1 ] . N a m e = " B e s c h r e i b u n g " Items.Columns[1].Name = "Beschreibung"
I t e m s . C o l u mn s [ 1 ] . N am e = " B esc h r e ib u n g " Items.Columns[1].Width = 575
I t e m s . C o l u m n s [ 2 ] . N a m e = " S k a l a " Items.Columns[2].Name = "Skala"
I t e m s . C o l u mn s [ 2 ] . N am e = " S k a l a " Items.Columns[2].Width = 275
I t e m s . C o l u m n s [ 3 ] . N a m e = " I n d e x " Items.Columns[3].Name = "Index"
I t e m s . C o l u mn s [ 3 ] . N am e = " I n d e x " Items.Columns[3].Width = 100
I t e m s . C o l u m n s [ 4 ] . N a m e = " U r s p r u n g s i t e m ( w e n n r e k o d i e r t ) " Items.Columns[4].Name = "Ursprungsitem (wenn rekodiert)"
I t e m s . C o l u mn s [ 4 ] . N am e = " U r s p Items.Columns[4].Width = 120
#$Items.RowTemplate.Height = 50
l a b e l I t e m S k a l a = N e w − O b j e c t W i n d o w s . F o r m s . L a b e l labelItemSkala= New-Object Windows.Forms.Label
l ab e l I t e m S k a l a = N e w − O bj ec t W in d o w s . F or m s . L ab e l labelItemSkala.Text = "Skala des Items"
l a b e l I t e m S k a l a . F o n t = N e w − O b j e c t S y s t e m . D r a w i n g . F o n t ( " A r i a l " , 12 , [ S y s t e m . D r a w i n g . F o n t S t y l e ] : : B o l d ) labelItemSkala.Font = New-Object System.Drawing.Font("Arial",12,[System.Drawing.FontStyle]::Bold)
l ab e l I t e m S labelItemSkala.ForeColor = W h i t e White
W hi t e labelItemSkala.location= New-Object System.Drawing.Point(100,525)
#l a b e l P V P . A u t o s i z e = labelPVP.Autosize= l ab e l P V P . A u t os i z e = True
$labelItemSkala.Size = New-Object System.Drawing.Size(250,25)
I t e m S k a l a = N e w − O b j e c t S y s t e m . W i n d o w s . F o r m s . T e x t B o x ItemSkala = New-Object System.Windows.Forms.TextBox
I t e m S k a l a = N e w − O bj ec tS y s t e m . W in d o w s . F or m s . T e x tB o x ItemSkala.AcceptsReturn=T r u e True
T r u e ItemSkala.MultiLine = T r u e True
T r u e ItemSkala.ScrollBars=3
I t e m S k a l a . L o c a t i o n = N e w − O b j e c t S y s t e m . D r a w i n g . P o i n t ( 100 , 550 ) ItemSkala.Location = New-Object System.Drawing.Point(100,550)
I t e m S k a l a . L oc a t i o n = N e w − ItemSkala.Size = New-Object System.Drawing.Size(350,150)
#I t e m s . A n c h o r = ( [ S y s t e m . W i n d o w s . F o r m s . A n c h o r S t y l e s ] : : R i g h t − b o r [ S y s t e m . W i n d o w s . F o r m s . A n c h o r S t y l e s ] : : T o p − b o r [ S y s t e m . W i n d o w s . F o r m s . ItemSkala.ForeColor=t e x t F a r b e textFarbe
t e x tF a r b e ItemSkala.Font = New-Object System.Drawing.Font("Arial",9,[System.Drawing.FontStyle]::regular)
l a b e l I t e m R e c o d e = N e w − O b j e c t W i n d o w s . F o r m s . L a b e l labelItemRecode= New-Object Windows.Forms.Label
l ab e l I t e m R eco d e = N e w − O bj ec t W in d o w s . F or m s . L ab e l labelItemRecode.Text = "Item rekodieren"
l a b e l I t e m R e c o d e . F o n t = N e w − O b j e c t S y s t e m . D r a w i n g . F o n t ( " A r i a l " , 12 , [ S y s t e m . D r a w i n g . F o n t S t y l e ] : : B o l d ) labelItemRecode.Font = New-Object System.Drawing.Font("Arial",12,[System.Drawing.FontStyle]::Bold)
l ab e l I t e m R labelItemRecode.ForeColor = W h i t e White
W hi t e labelItemRecode.location= New-Object System.Drawing.Point(1000,500)
#l a b e l P V P . A u t o s i z e = labelPVP.Autosize= l ab e l P V P . A u t os i z e = True
$labelItemRecode.Size = New-Object System.Drawing.Size(150,25)
##Skala Rekodieren Control
I t e m R e c o d e = N e w − O b j e c t S y s t e m . W i n d o w s . F o r m s . T e x t B o x ItemRecode = New-Object System.Windows.Forms.TextBox
I t e m R eco d e = N e w − O bj ec tS y s t e m . W in d o w s . F or m s . T e x tB o x ItemRecode.AcceptsReturn=T r u e True
T r u e ItemRecode.MultiLine = T r u e True
T r u e ItemRecode.ScrollBars=3
I t e m R e c o d e . L o c a t i o n = N e w − O b j e c t S y s t e m . D r a w i n g . P o i n t ( 1000 , 550 ) ItemRecode.Location = New-Object System.Drawing.Point(1000,550)
I t e m R eco d e . L oc a t i o n = N e w − ItemRecode.Size = New-Object System.Drawing.Size(50,100)
#I t e m s . A n c h o r = ( [ S y s t e m . W i n d o w s . F o r m s . A n c h o r S t y l e s ] : : R i g h t − b o r [ S y s t e m . W i n d o w s . F o r m s . A n c h o r S t y l e s ] : : T o p − b o r [ S y s t e m . W i n d o w s . F o r m s . ItemRecode.ForeColor=t e x t F a r b e textFarbe
t e x tF a r b e ItemRecode.Font = New-Object System.Drawing.Font("Arial",9,[System.Drawing.FontStyle]::regular)
B u t t o n S k a l a = N e w − O b j e c t W i n d o w s . F o r m s . B u t t o n ButtonSkala=New-Object Windows.Forms.Button
B u tt o n S k a l a = N e w − O bj ec t W in d o w s . F or m s . B u tt o n ButtonSkala.location= New-Object System.Drawing.Point(500,575)
B u t t o n S k a l a . T e x t = " I t e m s k a l a s p e i c h e r n " ButtonSkala.Text="Itemskala speichern"
B u tt o n S k a l a . T e x t = " I t e m s k a l a s p e i c h ButtonSkala.Backcolor=B u t t o n f a r b e Buttonfarbe
B u tt o n f a r b e ButtonSkala.ForeColor=b u t t o n T e x t F a r b e buttonTextFarbe
b u tt o n T e x tF a r b e ButtonSkala.Font = New-Object System.Drawing.Font("Arial",10,[System.Drawing.FontStyle]::bold)
$ButtonSkala.Size = New-Object System.Drawing.Size(150,50)
B u t t o n R e c o d e = N e w − O b j e c t W i n d o w s . F o r m s . B u t t o n ButtonRecode=New-Object Windows.Forms.Button
B u tt o n R eco d e = N e w − O bj ec t W in d o w s . F or m s . B u tt o n ButtonRecode.location= New-Object System.Drawing.Point(500,625)
B u t t o n R e c o d e . T e x t = " I t e m i n r e k o d i e r t e r F o r m h i n z u f u ¨ g e n " ButtonRecode.Text="Item in rekodierter Form hinzufügen"
B u tt o n R eco d e . T e x t = " I t e min r e k o d ButtonRecode.Backcolor=B u t t o n f a r b e Buttonfarbe
B u tt o n f a r b e ButtonRecode.ForeColor=b u t t o n T e x t F a r b e buttonTextFarbe
b u tt o n T e x tF a r b e ButtonRecode.Font = New-Object System.Drawing.Font("Arial",10,[System.Drawing.FontStyle]::bold)
$ButtonRecode.Size = New-Object System.Drawing.Size(150,50)
Itemmatching
l a b e l M a t c h i n g = N e w − O b j e c t W i n d o w s . F o r m s . L a b e l labelMatching= New-Object Windows.Forms.Label
l ab e l M a t c hin g = N e w − O bj ec t W in d o w s . F or m s . L ab e l labelMatching.Text = "Itemmatching"
l a b e l M a t c h i n g . F o n t = N e w − O b j e c t S y s t e m . D r a w i n g . F o n t ( " A r i a l " , 12 , [ S y s t e m . D r a w i n g . F o n t S t y l e ] : : B o l d ) labelMatching.Font = New-Object System.Drawing.Font("Arial",12,[System.Drawing.FontStyle]::Bold)
l ab e l M a t c hin labelMatching.ForeColor = W h i t e White
W hi t e labelMatching.location= New-Object System.Drawing.Point(750,525)
#l a b e l P V P . A u t o s i z e = labelPVP.Autosize= l ab e l P V P . A u t os i z e = True
$labelMatching.Size = New-Object System.Drawing.Size(300,25)
M a t c h i n g B u t t o n = N e w − O b j e c t W i n d o w s . F o r m s . B u t t o n MatchingButton =New-Object Windows.Forms.Button
M a t c hin g B u tt o n = N e w − O bj ec t W in d o w s . F or m s . B u tt o n MatchingButton.location=New-Object System.Drawing.Point(750,600)
M a t c h i n g B u t t o n . T e x t = " I t e m − M a t c h ! " MatchingButton.Text="Item-Match!"
M a t c hin g B u tt o n . T e x t = " I t e m − M a t c h ! " MatchingButton.Backcolor=B u t t o n f a r b e Buttonfarbe
B u tt o n f a r b e MatchingButton.ForeColor=b u t t o n T e x t F a r b e buttonTextFarbe
b u tt o n T e x tF a r b e MatchingButton.Font = New-Object System.Drawing.Font("Arial",10,[System.Drawing.FontStyle]::bold)
$MatchingButton.Size = New-Object System.Drawing.Size(100,50)
l a b e l S t a n d a r d I t e m s = N e w − O b j e c t W i n d o w s . F o r m s . L a b e l labelStandardItems= New-Object Windows.Forms.Label
l ab e l S t an d a r d I t e m s = N e w − O bj ec t W in d o w s . F or m s . L ab e l labelStandardItems.Text = "Itemkonzept"
l a b e l S t a n d a r d I t e m s . F o n t = N e w − O b j e c t S y s t e m . D r a w i n g . F o n t ( " A r i a l " , 12 , [ S y s t e m . D r a w i n g . F o n t S t y l e ] : : B o l d ) labelStandardItems.Font = New-Object System.Drawing.Font("Arial",12,[System.Drawing.FontStyle]::Bold)
l ab e l S t an labelStandardItems.ForeColor = W h i t e White
W hi t e labelStandardItems.location= New-Object System.Drawing.Point(1000,525)
#l a b e l P V P . A u t o s i z e = labelPVP.Autosize= l ab e l P V P . A u t os i z e = True
$labelStandardItems.Size = New-Object System.Drawing.Size(300,25)
S t a n d a r d I t e m s = N e w − O b j e c t S y s t e m . W i n d o w s . F o r m s . C o m b o B o x StandardItems = New-Object System.Windows.Forms.ComboBox
S t an d a r d I t e m s = N e w − O bj ec tS y s t e m . W in d o w s . F or m s . C o mb o B o x StandardItems.Location = New-Object System.Drawing.Point(1000,550)
StandardItems.Size = New-Object System.Drawing.Size(200,50)
#Standard.Anchor=([System.Windows.Forms.AnchorStyles]::Right -bor [System.Windows.Forms.AnchorStyles]::Top -bor [System.Windows.Forms.DockStyle]::Left)
StandardItemsForeColor=t e x t F a r b e textFarbe
t e x tF a r b e StandardItems.Font = New-Object System.Drawing.Font("Arial",12,[System.Drawing.FontStyle]::regular)
try{
foreach(n a m e i n name in nam e in projectConcepts){
[void] S t a n d a r d . I t e m s . A d d ( Standard.Items.Add( S t an d a r d . I t e m s . A dd ( name.Text)
}
}
catch{
"Konzeptliste konnte nicht gelesen werden."
}
##Vorlage anwenden Button
S t a n d a r d I t e m s B u t t o n = N e w − O b j e c t W i n d o w s . F o r m s . B u t t o n StandardItemsButton =New-Object Windows.Forms.Button
S t an d a r d I t e m s B u tt o n = N e w − O bj ec t W in d o w s . F or m s . B u tt o n StandardItemsButton.location=New-Object System.Drawing.Point(1000,600)
S t a n d a r d I t e m s B u t t o n . T e x t = " K o n z e p t a n w e n d e n " StandardItemsButton.Text="Konzept anwenden"
S t an d a r d I t e m s B u tt o n . T e x t = " K o n z e pt StandardItemsButton.Backcolor=B u t t o n f a r b e Buttonfarbe
B u tt o n f a r b e StandardItemsButton.ForeColor=b u t t o n T e x t F a r b e buttonTextFarbe
b u tt o n T e x tF a r b e StandardItemsButton.Font = New-Object System.Drawing.Font("Arial",10,[System.Drawing.FontStyle]::bold)
$StandardItemsButton.Size = New-Object System.Drawing.Size(200,50)
##Vorlage Speichern Button
S t a n d a r d I t e m s S p e i c h e r n B u t t o n = N e w − O b j e c t W i n d o w s . F o r m s . B u t t o n StandardItemsSpeichernButton =New-Object Windows.Forms.Button
S t an d a r d I t e m s S p e i c h er n B u tt o n = N e w − O bj ec t W in d o w s . F or m s . B u tt o n StandardItemsSpeichernButton.location=New-Object System.Drawing.Point(1000,675)
S t a n d a r d I t e m s S p e i c h e r n B u t t o n . T e x t = " S p e i c h e r n " StandardItemsSpeichernButton.Text="Speichern"
S t an d a r d I t e m s S p e i c h er n B u tt o n . T e x t = StandardItemsSpeichernButton.Backcolor=B u t t o n f a r b e Buttonfarbe
B u tt o n f a r b e StandardItemsSpeichernButton.ForeColor=b u t t o n T e x t F a r b e buttonTextFarbe
b u tt o n T e x tF a r b e StandardItemsSpeichernButton.Font = New-Object System.Drawing.Font("Arial",10,[System.Drawing.FontStyle]::regular)
$StandardItemsSpeichernButton.Size = New-Object System.Drawing.Size(75,50)
Vorlage Speichern Button S t a n d a r d I t e m s D e l B u t t o n = N e w − O b j e c t W i n d o w s . F o r m s . B u t t o n StandardItemsDelButton =New-Object Windows.Forms.Button
S t an d a r d I t e m sD e l B u tt o n = N e w − O bj ec t W in d o w s . F or m s . B u tt o n StandardItemsDelButton.location=New-Object System.Drawing.Point(1125,675)
S t a n d a r d I t e m s D e l B u t t o n . T e x t = " L o ¨ s c h e n " StandardItemsDelButton.Text="Löschen"
S t an d a r d I t e m sD e l B u tt o n . T e x t = " L StandardItemsDelButton.Backcolor=B u t t o n f a r b e Buttonfarbe
B u tt o n f a r b e StandardItemsDelButton.ForeColor=b u t t o n T e x t F a r b e buttonTextFarbe
b u tt o n T e x tF a r b e StandardItemsDelButton.Font = New-Object System.Drawing.Font("Arial",10,[System.Drawing.FontStyle]::regular)
$StandardItemsDelButton.Size = New-Object System.Drawing.Size(75,50)
Button Rekodieren
B u t t o n E x e R e c o d e = N e w − O b j e c t W i n d o w s . F o r m s . B u t t o n ButtonExeRecode=New-Object Windows.Forms.Button
B u tt o n E x e R eco d e = N e w − O bj ec t W in d o w s . F or m s . B u tt o n ButtonExeRecode.location=New-Object System.Drawing.Point(1300,575)
B u t t o n E x e R e c o d e . T e x t = " I t e m s i m D a t e n s a t z b e a r b e i t e n " ButtonExeRecode.Text="Items im Datensatz bearbeiten"
B u tt o n E x e R eco d e . T e x t = " I t e m s im D a t ButtonExeRecode.Backcolor=B u t t o n f a r b e Buttonfarbe
B u tt o n f a r b e ButtonExeRecode.ForeColor=b u t t o n T e x t F a r b e buttonTextFarbe
b u tt o n T e x tF a r b e ButtonExeRecode.Font = New-Object System.Drawing.Font("Arial",12,[System.Drawing.FontStyle]::bold)
$ButtonExeRecode.Size = New-Object System.Drawing.Size(100,100)
#######
####### Tab3
#######
t a b P a g e 3 = N e w − O b j e c t S y s t e m . W i n d o w s . F o r m s . T a b P a g e tabPage3= New-Object System.Windows.Forms.TabPage
t ab P a g e 3 = N e w − O bj ec tS y s t e m . W in d o w s . F or m s . T ab P a g e tabPage3.Text = "Indizes"
#t a b P a g e 2. S i z e = n e w S y s t e m . D r a w i n g . S i z e ( 300 , 250 ) tabPage2.Size = new System.Drawing.Size(300, 250)
t ab P a g e 2. S i z e = n e w S y s t e m . D r a w in g tabPage3.TabIndex = 2
$tabPage3.BackColor ='#0a5a77'
l a b e l I n d e x = N e w − O b j e c t W i n d o w s . F o r m s . L a b e l labelIndex= New-Object Windows.Forms.Label
l ab e l I n d e x = N e w − O bj ec t W in d o w s . F or m s . L ab e l labelIndex.Text = "Indizes"
l a b e l I n d e x . F o n t = N e w − O b j e c t S y s t e m . D r a w i n g . F o n t ( " A r i a l " , 12 , [ S y s t e m . D r a w i n g . F o n t S t y l e ] : : B o l d ) labelIndex.Font = New-Object System.Drawing.Font("Arial",12,[System.Drawing.FontStyle]::Bold)
l ab e l I n d e x . F labelIndex.ForeColor = W h i t e White
W hi t e labelIndex.location= New-Object System.Drawing.Point(100,75)
#l a b e l P V P . A u t o s i z e = labelPVP.Autosize= l ab e l P V P . A u t os i z e = True
$labelIndex.Size = New-Object System.Drawing.Size(250,25)
I n d e x = N e w − O b j e c t S y s t e m . W i n d o w s . F o r m s . D a t a G r i d V i e w Index = New-Object System.Windows.Forms.DataGridView
I n d e x = N e w − O bj ec tS y s t e m . W in d o w s . F or m s . D a t a G r i d V i e w Index.Location = New-Object System.Drawing.Point(100,100)
Index.Size = New-Object System.Drawing.Size(1100,400)
# Items.Anchor=([System.Windows.Forms.AnchorStyles]::Right -bor [System.Windows.Forms.AnchorStyles]::Top -bor [System.Windows.Forms.DockStyle]::Left)
I n d e x . F o r e C o l o r = Index.ForeColor= I n d e x . F or e C o l or = textFarbe
I n d e x . F o n t = N e w − O b j e c t S y s t e m . D r a w i n g . F o n t ( " A r i a l " , 11 , [ S y s t e m . D r a w i n g . F o n t S t y l e ] : : r e g u l a r ) Index.Font = New-Object System.Drawing.Font("Arial",11,[System.Drawing.FontStyle]::regular)
I n d e x . F o n t = Index.ColumnHeadersVisible = t r u e true
t r u e Index.ColumnHeadersHeight=50
I n d e x . R o w H e a d e r s W i d t h = 15 Index.RowHeadersWidth=15
I n d e x . R o w H e a d er s W i d t h = 15 Index.ColumnCount=5
I n d e x . C o l u m n s [ 0 ] . N a m e = " K u ¨ r z e l " Index.Columns[0].Name = "Kürzel"
I n d e x . C o l u mn s [ 0 ] . N am e = " K u ¨ r z e Index.Columns[0].Width = 100
I n d e x . C o l u m n s [ 1 ] . N a m e = " B e s c h r e i b u n g " Index.Columns[1].Name = "Beschreibung"
I n d e x . C o l u mn s [ 1 ] . N am e = " B esc h r e ib u n g " Index.Columns[1].Width = 285
I n d e x . C o l u m n s [ 2 ] . N a m e = " I t e m s " Index.Columns[2].Name = "Items"
I n d e x . C o l u mn s [ 2 ] . N am e = " I t e m s " Index.Columns[2].Width = 380
I n d e x . C o l u m n s [ 3 ] . N a m e = " I n d e x f o r m e l " Index.Columns[3].Name = "Indexformel"
I n d e x . C o l u mn s [ 3 ] . N am e = " I n d e x f or m e l " Index.Columns[3].Width = 165
I n d e x . C o l u m n s [ 4 ] . N a m e = " K a t e g o r i e " Index.Columns[4].Name = "Kategorie"
I n d e x . C o l u mn s [ 4 ] . N am e = " K a t e g or i e " Index.Columns[4].Width = 145
l a b e l I n d e x I t e m s = N e w − O b j e c t W i n d o w s . F o r m s . L a b e l labelIndexItems= New-Object Windows.Forms.Label
l ab e l I n d e x I t e m s = N e w − O bj ec t W in d o w s . F or m s . L ab e l labelIndexItems.Text = "Items des Index"
l a b e l I n d e x I t e m s . F o n t = N e w − O b j e c t S y s t e m . D r a w i n g . F o n t ( " A r i a l " , 12 , [ S y s t e m . D r a w i n g . F o n t S t y l e ] : : B o l d ) labelIndexItems.Font = New-Object System.Drawing.Font("Arial",12,[System.Drawing.FontStyle]::Bold)
l ab e l I n d e x labelIndexItems.ForeColor = W h i t e White
W hi t e labelIndexItems.location= New-Object System.Drawing.Point(100,525)
#l a b e l P V P . A u t o s i z e = labelPVP.Autosize= l ab e l P V P . A u t os i z e = True
$labelIndexItems.Size = New-Object System.Drawing.Size(250,25)
l n d e x I t e m s = N e w − O b j e c t S y s t e m . W i n d o w s . F o r m s . T e x t B o x lndexItems = New-Object System.Windows.Forms.TextBox
l n d e x I t e m s = N e w − O bj ec tS y s t e m . W in d o w s . F or m s . T e x tB o x lndexItems.AcceptsReturn=T r u e True
T r u e lndexItems.MultiLine = T r u e True
T r u e lndexItems.ScrollBars=3
l n d e x I t e m s . L o c a t i o n = N e w − O b j e c t S y s t e m . D r a w i n g . P o i n t ( 100 , 550 ) lndexItems.Location = New-Object System.Drawing.Point(100,550)
l n d e x I t e m s . L oc a t i o n = N e w − lndexItems.Size = New-Object System.Drawing.Size(350,150)
#I t e m s . A n c h o r = ( [ S y s t e m . W i n d o w s . F o r m s . A n c h o r S t y l e s ] : : R i g h t − b o r [ S y s t e m . W i n d o w s . F o r m s . A n c h o r S t y l e s ] : : T o p − b o r [ S y s t e m . W i n d o w s . F o r m s . lndexItems.ForeColor=t e x t F a r b e textFarbe
t e x tF a r b e lndexItems.Font = New-Object System.Drawing.Font("Arial",9,[System.Drawing.FontStyle]::regular)
B u t t o n l n d e x I t e m s = N e w − O b j e c t W i n d o w s . F o r m s . B u t t o n ButtonlndexItems=New-Object Windows.Forms.Button
B u tt o n l n d e x I t e m s = N e w − O bj ec t W in d o w s . F or m s . B u tt o n ButtonlndexItems.location=New-Object System.Drawing.Point(500,600)
B u t t o n l n d e x I t e m s . T e x t = " I t e m s s p e i c h e r n " ButtonlndexItems.Text="Items speichern"
B u tt o n l n d e x I t e m s . T e x t = " I t e m ss p e i c h er ButtonlndexItems.Backcolor=B u t t o n f a r b e Buttonfarbe
B u tt o n f a r b e ButtonlndexItems.ForeColor=b u t t o n T e x t F a r b e buttonTextFarbe
b u tt o n T e x tF a r b e ButtonlndexItems.Font = New-Object System.Drawing.Font("Arial",10,[System.Drawing.FontStyle]::bold)
$ButtonlndexItems.Size = New-Object System.Drawing.Size(150,50)
Indexmatching
l a b e l I n d e x M a t c h i n g = N e w − O b j e c t W i n d o w s . F o r m s . L a b e l labelIndexMatching= New-Object Windows.Forms.Label
l ab e l I n d e x M a t c hin g = N e w − O bj ec t W in d o w s . F or m s . L ab e l labelIndexMatching.Text = "Index aus Itemblatt"
l a b e l I n d e x M a t c h i n g . F o n t = N e w − O b j e c t S y s t e m . D r a w i n g . F o n t ( " A r i a l " , 12 , [ S y s t e m . D r a w i n g . F o n t S t y l e ] : : B o l d ) labelIndexMatching.Font = New-Object System.Drawing.Font("Arial",12,[System.Drawing.FontStyle]::Bold)
l ab e l I n d labelIndexMatching.ForeColor = W h i t e White
W hi t e labelIndexMatching.location= New-Object System.Drawing.Point(750,525)
#l a b e l P V P . A u t o s i z e = labelPVP.Autosize= l ab e l P V P . A u t os i z e = True
$labelIndexMatching.Size = New-Object System.Drawing.Size(300,25)
I n d e x M a t c h i n g B u t t o n = N e w − O b j e c t W i n d o w s . F o r m s . B u t t o n IndexMatchingButton =New-Object Windows.Forms.Button
I n d e x M a t c hin g B u tt o n = N e w − O bj ec t W in d o w s . F or m s . B u tt o n IndexMatchingButton.location=New-Object System.Drawing.Point(750,600)
I n d e x M a t c h i n g B u t t o n . T e x t = " I n d e x e n ! " IndexMatchingButton.Text="Indexen!"
I n d e x M a t c hin g B u tt o n . T e x t = " I n d e x e n ! " IndexMatchingButton.Backcolor=B u t t o n f a r b e Buttonfarbe
B u tt o n f a r b e IndexMatchingButton.ForeColor=b u t t o n T e x t F a r b e buttonTextFarbe
b u tt o n T e x tF a r b e IndexMatchingButton.Font = New-Object System.Drawing.Font("Arial",10,[System.Drawing.FontStyle]::bold)
$IndexMatchingButton.Size = New-Object System.Drawing.Size(100,50)
l a b e l S t a n d a r d = N e w − O b j e c t W i n d o w s . F o r m s . L a b e l labelStandard= New-Object Windows.Forms.Label
l ab e l S t an d a r d = N e w − O bj ec t W in d o w s . F or m s . L ab e l labelStandard.Text = "Indexkonzept"
l a b e l S t a n d a r d . F o n t = N e w − O b j e c t S y s t e m . D r a w i n g . F o n t ( " A r i a l " , 12 , [ S y s t e m . D r a w i n g . F o n t S t y l e ] : : B o l d ) labelStandard.Font = New-Object System.Drawing.Font("Arial",12,[System.Drawing.FontStyle]::Bold)
l ab e l S t an d a r labelStandard.ForeColor = W h i t e White
W hi t e labelStandard.location= New-Object System.Drawing.Point(1000,525)
#l a b e l P V P . A u t o s i z e = labelPVP.Autosize= l ab e l P V P . A u t os i z e = True
$labelStandard.Size = New-Object System.Drawing.Size(300,25)
S t a n d a r d = N e w − O b j e c t S y s t e m . W i n d o w s . F o r m s . C o m b o B o x Standard = New-Object System.Windows.Forms.ComboBox
S t an d a r d = N e w − O bj ec tS y s t e m . W in d o w s . F or m s . C o mb o B o x Standard.Location = New-Object System.Drawing.Point(1000,550)
Standard.Size = New-Object System.Drawing.Size(200,50)
#Standard.Anchor=([System.Windows.Forms.AnchorStyles]::Right -bor [System.Windows.Forms.AnchorStyles]::Top -bor [System.Windows.Forms.DockStyle]::Left)
Standard.ForeColor=t e x t F a r b e textFarbe
t e x tF a r b e Standard.Font = New-Object System.Drawing.Font("Arial",12,[System.Drawing.FontStyle]::regular)
try{
foreach(n a m e i n name in nam e in projectConcepts){
[void] S t a n d a r d . I t e m s . A d d ( Standard.Items.Add( S t an d a r d . I t e m s . A dd ( name.Text)
}
}
catch{
"Konzeptliste konnte nicht gelesen werden."
}
##Vorlage anwenden Button
S t a n d a r d B u t t o n = N e w − O b j e c t W i n d o w s . F o r m s . B u t t o n StandardButton =New-Object Windows.Forms.Button
S t an d a r d B u tt o n = N e w − O bj ec t W in d o w s . F or m s . B u tt o n StandardButton.location=New-Object System.Drawing.Point(1000,600)
S t a n d a r d B u t t o n . T e x t = " K o n z e p t a n w e n d e n " StandardButton.Text="Konzept anwenden"
S t an d a r d B u tt o n . T e x t = " K o n z e pt an w e n d e n StandardButton.Backcolor=B u t t o n f a r b e Buttonfarbe
B u tt o n f a r b e StandardButton.ForeColor=b u t t o n T e x t F a r b e buttonTextFarbe
b u tt o n T e x tF a r b e StandardButton.Font = New-Object System.Drawing.Font("Arial",10,[System.Drawing.FontStyle]::bold)
$StandardButton.Size = New-Object System.Drawing.Size(200,50)
##Vorlage Speichern Button
S t a n d a r d S p e i c h e r n B u t t o n = N e w − O b j e c t W i n d o w s . F o r m s . B u t t o n StandardSpeichernButton =New-Object Windows.Forms.Button
S t an d a r d S p e i c h er n B u tt o n = N e w − O bj ec t W in d o w s . F or m s . B u tt o n StandardSpeichernButton.location=New-Object System.Drawing.Point(1000,675)
S t a n d a r d S p e i c h e r n B u t t o n . T e x t = " S p e i c h e r n " StandardSpeichernButton.Text="Speichern"
S t an d a r d S p e i c h er n B u tt o n . T e x t = " S p e StandardSpeichernButton.Backcolor=B u t t o n f a r b e Buttonfarbe
B u tt o n f a r b e StandardSpeichernButton.ForeColor=b u t t o n T e x t F a r b e buttonTextFarbe
b u tt o n T e x tF a r b e StandardSpeichernButton.Font = New-Object System.Drawing.Font("Arial",10,[System.Drawing.FontStyle]::regular)
$StandardSpeichernButton.Size = New-Object System.Drawing.Size(75,50)
S t a n d a r d D e l B u t t o n = N e w − O b j e c t W i n d o w s . F o r m s . B u t t o n StandardDelButton =New-Object Windows.Forms.Button
S t an d a r d D e l B u tt o n = N e w − O bj ec t W in d o w s . F or m s . B u tt o n StandardDelButton.location=New-Object System.Drawing.Point(1125,675)
S t a n d a r d D e l B u t t o n . T e x t = " L o ¨ s c h e n " StandardDelButton.Text="Löschen"
S t an d a r d D e l B u tt o n . T e x t = " L o ¨ sc h StandardDelButton.Backcolor=B u t t o n f a r b e Buttonfarbe
B u tt o n f a r b e StandardDelButton.ForeColor=b u t t o n T e x t F a r b e buttonTextFarbe
b u tt o n T e x tF a r b e StandardDelButton.Font = New-Object System.Drawing.Font("Arial",10,[System.Drawing.FontStyle]::regular)
$StandardDelButton.Size = New-Object System.Drawing.Size(75,50)
B u t t o n E x e C a l c = N e w − O b j e c t W i n d o w s . F o r m s . B u t t o n ButtonExeCalc=New-Object Windows.Forms.Button
B u tt o n E x e C a l c = N e w − O bj ec t W in d o w s . F or m s . B u tt o n ButtonExeCalc.location=New-Object System.Drawing.Point(1300,575)
B u t t o n E x e C a l c . T e x t = " I n d i z e s i m D a t e n s a t z b e r e c h n e n " ButtonExeCalc.Text="Indizes im Datensatz berechnen"
B u tt o n E x e C a l c . T e x t = " I n d i z es im D ButtonExeCalc.Backcolor=B u t t o n f a r b e Buttonfarbe
B u tt o n f a r b e ButtonExeCalc.ForeColor=b u t t o n T e x t F a r b e buttonTextFarbe
b u tt o n T e x tF a r b e ButtonExeCalc.Font = New-Object System.Drawing.Font("Arial",12,[System.Drawing.FontStyle]::bold)
$ButtonExeCalc.Size = New-Object System.Drawing.Size(100,100)
#######
####### Tab4
#######
t a b P a g e 4 = N e w − O b j e c t S y s t e m . W i n d o w s . F o r m s . T a b P a g e tabPage4= New-Object System.Windows.Forms.TabPage
t ab P a g e 4 = N e w − O bj ec tS y s t e m . W in d o w s . F or m s . T ab P a g e tabPage4.Text = "Auswertung"
#t a b P a g e 4. S i z e = n e w S y s t e m . D r a w i n g . S i z e ( 300 , 250 ) tabPage4.Size = new System.Drawing.Size(300, 250)
t ab P a g e 4. S i z e = n e w S y s t e m . D r a w in g tabPage4.TabIndex = 4
$tabPage4.BackColor ='#0a5a77'
R e p o r t S t r u k = N e w − O b j e c t S y s t e m . W i n d o w s . F o r m s . T r e e V i e w ReportStruk= New-Object System.Windows.Forms.TreeView
R e p or tS t r u k = N e w − O bj ec tS y s t e m . W in d o w s . F or m s . T r ee V i e w ReportStruk.Location = New-Object System.Drawing.Point(100,100)
R e p o r t S t r u k . S i z e = N e w − O b j e c t S y s t e m . D r a w i n g . S i z e ( 475 , 150 ) ReportStruk.Size = New-Object System.Drawing.Size(475,150)
R e p or tS t r u k . S i z e = N e w − O ReportStruk.LabelEdit=t r u e true
t r u e ReportStruk.Nodes.Add("Gesamtebene")
O u t p u t S t r u k = N e w − O b j e c t S y s t e m . W i n d o w s . F o r m s . T r e e V i e w OutputStruk= New-Object System.Windows.Forms.TreeView
O u tp u tS t r u k = N e w − O bj ec tS y s t e m . W in d o w s . F or m s . T r ee V i e w OutputStruk.Location = New-Object System.Drawing.Point(100,300)
O u t p u t S t r u k . S i z e = N e w − O b j e c t S y s t e m . D r a w i n g . S i z e ( 475 , 225 ) OutputStruk.Size = New-Object System.Drawing.Size(475,225)
O u tp u tS t r u k . S i z e = N e w − O OutputStruk.LabelEdit=t r u e true
t r u e OutputStruk.Nodes.Add("Demographische Variablen")
O u t p u t S t r u k . N o d e s . A d d ( " B e l a s t u n g e n " ) OutputStruk.Nodes.Add("Belastungen")
O u tp u tS t r u k . N o d es . A dd ( " B e l a s t u n g e n " ) OutputStruk.Nodes[1].Nodes.Add("Aufgabe")
O u t p u t S t r u k . N o d e s [ 1 ] . N o d e s . A d d ( " B e d i n g u n g e n " ) OutputStruk.Nodes[1].Nodes.Add("Bedingungen")
O u tp u tS t r u k . N o d es [ 1 ] . N o d es . A dd ( " B e d in g OutputStruk.Nodes.Add("Ressourcen")
O u t p u t S t r u k . N o d e s [ 2 ] . N o d e s . A d d ( " A u f g a b e " ) OutputStruk.Nodes[2].Nodes.Add("Aufgabe")
O u tp u tS t r u k . N o d es [ 2 ] . N o d es . A dd ( " A u f g ab e OutputStruk.Nodes[2].Nodes.Add("Bedingungen")
O u t p u t S t r u k . N o d e s . A d d ( " B e a n s p r u c h u n g " ) OutputStruk.Nodes.Add("Beanspruchung")
O u tp u tS t r u k . N o d es . A dd ( " B e an s p r u c h u n g " ) OutputStruk.Nodes[3].Nodes.Add("Stressreaktionen")
O u t p u t S t r u k . N o d e s [ 3 ] . N o d e s . A d d ( " B e s c h w e r d e l i s t e " ) OutputStruk.Nodes[3].Nodes.Add("Beschwerdeliste")
O u tp u tS t r u k . N o d es [ 3 ] . N o d es . A dd ( " B esc h OutputStruk.Nodes[3].Nodes.Add("Zusatzauswertungen")
Buttons für Outputstruktur B u t t o n A d d N o d e = N e w − O b j e c t W i n d o w s . F o r m s . B u t t o n ButtonAddNode=New-Object Windows.Forms.Button
B u tt o n A dd N o d e = N e w − O bj ec t W in d o w s . F or m s . B u tt o n ButtonAddNode.location=New-Object System.Drawing.Point(250,575)
B u t t o n A d d N o d e . T e x t = " + " ButtonAddNode.Text="+"
B u tt o n A dd N o d e . T e x t = " + " ButtonAddNode.Backcolor=B u t t o n f a r b e Buttonfarbe
B u tt o n f a r b e ButtonAddNode.ForeColor=b u t t o n T e x t F a r b e buttonTextFarbe
b u tt o n T e x tF a r b e ButtonAddNode.Font = New-Object System.Drawing.Font("Arial",18,[System.Drawing.FontStyle]::bold)
$ButtonAddNode.Size = New-Object System.Drawing.Size(50,50)
B u t t o n D e l N o d e = N e w − O b j e c t W i n d o w s . F o r m s . B u t t o n ButtonDelNode=New-Object Windows.Forms.Button
B u tt o n D e l N o d e = N e w − O bj ec t W in d o w s . F or m s . B u tt o n ButtonDelNode.location=New-Object System.Drawing.Point(300,575)
B u t t o n D e l N o d e . T e x t = " − " ButtonDelNode.Text="-"
B u tt o n D e l N o d e . T e x t = " − " ButtonDelNode.Backcolor=B u t t o n f a r b e Buttonfarbe
B u tt o n f a r b e ButtonDelNode.ForeColor=b u t t o n T e x t F a r b e buttonTextFarbe
b u tt o n T e x tF a r b e ButtonDelNode.Font = New-Object System.Drawing.Font("Arial",18,[System.Drawing.FontStyle]::bold)
$ButtonDelNode.Size = New-Object System.Drawing.Size(50,50)
B u t t o n A d d I t e m I n d e x = N e w − O b j e c t W i n d o w s . F o r m s . B u t t o n ButtonAddItemIndex=New-Object Windows.Forms.Button
B u tt o n A dd I t e m I n d e x = N e w − O bj ec t W in d o w s . F or m s . B u tt o n ButtonAddItemIndex.location=New-Object System.Drawing.Point(1020,575)
B u t t o n A d d I t e m I n d e x . T e x t = " + " ButtonAddItemIndex.Text="+"
B u tt o n A dd I t e m I n d e x . T e x t = " + " ButtonAddItemIndex.Backcolor=B u t t o n f a r b e Buttonfarbe
B u tt o n f a r b e ButtonAddItemIndex.ForeColor=b u t t o n T e x t F a r b e buttonTextFarbe
b u tt o n T e x tF a r b e ButtonAddItemIndex.Font = New-Object System.Drawing.Font("Arial",18,[System.Drawing.FontStyle]::bold)
$ButtonAddItemIndex.Size = New-Object System.Drawing.Size(50,50)
B u t t o n O u t p u t = N e w − O b j e c t W i n d o w s . F o r m s . B u t t o n ButtonOutput=New-Object Windows.Forms.Button
B u tt o n O u tp u t = N e w − O bj ec t W in d o w s . F or m s . B u tt o n ButtonOutput.location=New-Object System.Drawing.Point(1300,575)
B u t t o n O u t p u t . T e x t = " O u t p u t s e r s t e l l e n " ButtonOutput.Text="Outputs erstellen"
B u tt o n O u tp u t . T e x t = " O u tp u t ser s t e l l e n " ButtonOutput.Backcolor=B u t t o n f a r b e Buttonfarbe
B u tt o n f a r b e ButtonOutput.ForeColor=b u t t o n T e x t F a r b e buttonTextFarbe
b u tt o n T e x tF a r b e ButtonOutput.Font = New-Object System.Drawing.Font("Arial",12,[System.Drawing.FontStyle]::bold)
$ButtonOutput.Size = New-Object System.Drawing.Size(100,100)
Item & Indexliste
I t e m s A n d I n d i z e s L i s t = N e w − O b j e c t S y s t e m . W i n d o w s . F o r m s . D a t a G r i d V i e w ItemsAndIndizesList = New-Object System.Windows.Forms.DataGridView
I t e m s A n d I n d i z es L i s t = N e w − O bj ec tS y s t e m . W in d o w s . F or m s . D a t a G r i d V i e w ItemsAndIndizesList.Location = New-Object System.Drawing.Point(820,100)
I t e m s A n d I n d i z e s L i s t . S i z e = N e w − O b j e c t S y s t e m . D r a w i n g . S i z e ( 475 , 425 ) ItemsAndIndizesList.Size = New-Object System.Drawing.Size(475,425)
I t e m s A n d I n d i z es L i s t . S i z e = ItemsAndIndizesList.ColumnCount=1
I t e m s A n d I n d i z e s L i s t . F o r e C o l o r = ItemsAndIndizesList.ForeColor= I t e m s A n d I n d i z es L i s t . F or e C o l or = textFarbe
I t e m s A n d I n d i z e s L i s t . R o w H e a d e r s W i d t h = 5 ItemsAndIndizesList.RowHeadersWidth=5
I t e m s A n d I n d i z es L i s t . R o w H e a d er s W i d t h = ItemsAndIndizesList.Columns[0].Width = 500
#t a b P a g e 4. C o n t r o l s . A d d ( tabPage4.Controls.Add( t ab P a g e 4. C o n t r o l s . A dd ( ButtonAddItemIndex)
#######
####### Tab5
#######
t a b P a g e 5 = N e w − O b j e c t S y s t e m . W i n d o w s . F o r m s . T a b P a g e tabPage5= New-Object System.Windows.Forms.TabPage
t ab P a g e 5 = N e w − O bj ec tS y s t e m . W in d o w s . F or m s . T ab P a g e tabPage5.Text = "Cluster-Logik"
#t a b P a g e 4. S i z e = n e w S y s t e m . D r a w i n g . S i z e ( 300 , 250 ) tabPage4.Size = new System.Drawing.Size(300, 250)
t ab P a g e 4. S i z e = n e w S y s t e m . D r a w in g tabPage5.TabIndex = 4
$tabPage5.BackColor ='#0a5a77'
T r e e = N e w − O b j e c t S y s t e m . W i n d o w s . F o r m s . T r e e V i e w Tree = New-Object System.Windows.Forms.TreeView
T r ee = N e w − O bj ec tS y s t e m . W in d o w s . F or m s . T r ee V i e w Tree.Location = New-Object System.Drawing.Point(100,100)
T r e e . S i z e = N e w − O b j e c t S y s t e m . D r a w i n g . S i z e ( 1100 , 400 ) Tree.Size = New-Object System.Drawing.Size(1100,400)
T r ee . S i z e = N e w − O bj ec tS y s t e m . Tree.Nodes.Add("Gesamtbericht")
T r e e . N o d e s [ 0 ] . N o d e s . A d d ( " D e m o g r a p h i s c h e V a r i a b l e n " ) Tree.Nodes[0].Nodes.Add("Demographische Variablen")
T r ee . N o d es [ 0 ] . N o d es . A dd ( " D e m o g r a p hi Tree.Nodes[0].Nodes.Add("Erschöpfung hoch/niedrig")
T r e e . N o d e s [ 0 ] . N o d e s . A d d ( " T a ¨ t i g k e i t " ) Tree.Nodes[0].Nodes.Add("Tätigkeit")
T r ee . N o d es [ 0 ] . N o d es . A dd ( " T a ¨ t i g k Tree.Nodes[0].Nodes.Add("Abteilung")
T r e e . N o d e s [ 0 ] . N o d e s [ 3 ] . N o d e s . A d d ( " G r u p p e " ) Tree.Nodes[0].Nodes[3].Nodes.Add("Gruppe")
T r ee . N o d es [ 0 ] . N o d es [ 3 ] . N o d es . A dd ( " G r u pp e Tree.Nodes.Add("Abteilungsberichte")
T r e e . N o d e s [ 1 ] . N o d e s . A d d ( " T a ¨ t i g k e i t " ) Tree.Nodes[1].Nodes.Add("Tätigkeit")
T r ee . N o d es [ 1 ] . N o d es . A dd ( " T a ¨ t i g k Tree.Nodes[1].Nodes.Add("Gruppe")
$Tree.Nodes.Add("Gruppenberichte")
T r e e . L a b e l E d i t = Tree.LabelEdit= T r ee . L ab e l E d i t = true
#T r e e . C h e c k b o x e s = Tree.Checkboxes= T r ee . C h ec k b o x es = true
#T r e e . S h o w L i n e s = Tree.ShowLines= T r ee . S h o w L in es = true
#T r e e . S h o w N o d e T o o l T i p s = Tree.ShowNodeToolTips= T r ee . S h o w N o d e T oo l T i p s = true
#T r e e . S h o w P l u s M i n u s = Tree.ShowPlusMinus= T r ee . S h o w P l u s M in u s = true
#T r e e . S h o w R o o t L i n e s = Tree.ShowRootLines= T r ee . S h o w R oo t L in es = true
#######
####### Tab6
#######
t a b P a g e 6 = N e w − O b j e c t S y s t e m . W i n d o w s . F o r m s . T a b P a g e tabPage6= New-Object System.Windows.Forms.TabPage
t ab P a g e 6 = N e w − O bj ec tS y s t e m . W in d o w s . F or m s . T ab P a g e tabPage6.Text = "Anova"
#t a b P a g e 6. S i z e = n e w S y s t e m . D r a w i n g . S i z e ( 300 , 250 ) tabPage6.Size = new System.Drawing.Size(300, 250)
t ab P a g e 6. S i z e = n e w S y s t e m . D r a w in g tabPage6.TabIndex = 5
$tabPage6.BackColor ='#0a5a77'
Controls zu Form hinzufügen $formStart.SuspendLayout()
f o r m S t a r t . C o n t r o l s . A d d ( formStart.Controls.Add( f or m S t a r t . C o n t r o l s . A dd ( labelStart)
#f o r m S t a r t . C o n t r o l s . A d d ( formStart.Controls.Add( f or m S t a r t . C o n t r o l s . A dd ( buttonQuit)
#Tab-Control
f o r m S t a r t . C o n t r o l s . A d d ( formStart.Controls.Add( f or m S t a r t . C o n t r o l s . A dd ( tabControl)
#t a b P a g e 1. C o n t r o l s . A d d ( tabPage1.Controls.Add( t ab P a g e 1. C o n t r o l s . A dd ( labelStart)
t a b P a g e 1. C o n t r o l s . A d d ( tabPage1.Controls.Add( t ab P a g e 1. C o n t r o l s . A dd ( PVP)
t a b P a g e 1. C o n t r o l s . A d d ( tabPage1.Controls.Add( t ab P a g e 1. C o n t r o l s . A dd ( labelPVP)
t a b P a g e 1. C o n t r o l s . A d d ( tabPage1.Controls.Add( t ab P a g e 1. C o n t r o l s . A dd ( Projekt)
t a b P a g e 1. C o n t r o l s . A d d ( tabPage1.Controls.Add( t ab P a g e 1. C o n t r o l s . A dd ( labelProjekt)
t a b P a g e 1. C o n t r o l s . A d d ( tabPage1.Controls.Add( t ab P a g e 1. C o n t r o l s . A dd ( labelSoll)
t a b P a g e 1. C o n t r o l s . A d d ( tabPage1.Controls.Add( t ab P a g e 1. C o n t r o l s . A dd ( Soll)
t a b P a g e 1. C o n t r o l s . A d d ( tabPage1.Controls.Add( t ab P a g e 1. C o n t r o l s . A dd ( Laden)
t a b P a g e 1. C o n t r o l s . A d d ( tabPage1.Controls.Add( t ab P a g e 1. C o n t r o l s . A dd ( Daten)
t a b P a g e 1. C o n t r o l s . A d d ( tabPage1.Controls.Add( t ab P a g e 1. C o n t r o l s . A dd ( labelDatumStart)
t a b P a g e 1. C o n t r o l s . A d d ( tabPage1.Controls.Add( t ab P a g e 1. C o n t r o l s . A dd ( DatumStart)
t a b P a g e 1. C o n t r o l s . A d d ( tabPage1.Controls.Add( t ab P a g e 1. C o n t r o l s . A dd ( labelDatumEnde)
t a b P a g e 1. C o n t r o l s . A d d ( tabPage1.Controls.Add( t ab P a g e 1. C o n t r o l s . A dd ( DatumEnde)
t a b P a g e 1. C o n t r o l s . A d d ( tabPage1.Controls.Add( t ab P a g e 1. C o n t r o l s . A dd ( Speichern)
t a b P a g e 1. C o n t r o l s . A d d ( tabPage1.Controls.Add( t ab P a g e 1. C o n t r o l s . A dd ( labelExcel)
t a b P a g e 1. C o n t r o l s . A d d ( tabPage1.Controls.Add( t ab P a g e 1. C o n t r o l s . A dd ( Excel)
t a b P a g e 1. C o n t r o l s . A d d ( tabPage1.Controls.Add( t ab P a g e 1. C o n t r o l s . A dd ( ButtonDelExcel)
#t a b P a g e 1. C o n t r o l s . A d d ( tabPage1.Controls.Add( t ab P a g e 1. C o n t r o l s . A dd ( Konzept)
t a b P a g e 1. C o n t r o l s . A d d ( tabPage1.Controls.Add( t ab P a g e 1. C o n t r o l s . A dd ( labelPfad)
t a b P a g e 1. C o n t r o l s . A d d ( tabPage1.Controls.Add( t ab P a g e 1. C o n t r o l s . A dd ( Pfad)
t a b P a g e 1. C o n t r o l s . A d d ( tabPage1.Controls.Add( t ab P a g e 1. C o n t r o l s . A dd ( buttonPfad)
t a b P a g e 1. C o n t r o l s . A d d ( tabPage1.Controls.Add( t ab P a g e 1. C o n t r o l s . A dd ( progressbar)
t a b P a g e 1. C o n t r o l s . A d d ( tabPage1.Controls.Add( t ab P a g e 1. C o n t r o l s . A dd ( progressbarLabel)
t a b P a g e 1. C o n t r o l s . A d d ( tabPage1.Controls.Add( t ab P a g e 1. C o n t r o l s . A dd ( progTxt)
#t a b P a g e 1. C o n t r o l s . A d d ( tabPage1.Controls.Add( t ab P a g e 1. C o n t r o l s . A dd ( PVP)
#t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( labelStart)
t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( labelItems)
t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( Items)
#t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( labelItemIndex)
#t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( ItemIndex)
t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( labelItemSkala)
t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( ItemSkala)
#t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( labelItemRecode)
#t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( ItemRecode)
#t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( ButtonIndex)
t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( ButtonRecode)
#t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( ButtonItemDel)
#t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( ButtonItemAdd)
t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( ButtonExeRecode)
t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( ButtonSkala)
#t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( labelItemName)
#t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( ItemName)
#t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( ButtonItemName)
#t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( labelItemDescr)
#t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( ItemDescr)
#t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( ButtonItemDescr)
#t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( labelStandardItems)
#t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( StandardItems)
#t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( StandardItemsButton)
#t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( StandardItemsSpeichernButton)
#t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( StandardItemsDelButton)
#t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( labelMatching)
#t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( MatchingButton)
#t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( progressbar2)
t a b P a g e 3. C o n t r o l s . A d d ( tabPage3.Controls.Add( t ab P a g e 3. C o n t r o l s . A dd ( labelIndex)
t a b P a g e 3. C o n t r o l s . A d d ( tabPage3.Controls.Add( t ab P a g e 3. C o n t r o l s . A dd ( Index)
#t a b P a g e 3. C o n t r o l s . A d d ( tabPage3.Controls.Add( t ab P a g e 3. C o n t r o l s . A dd ( labelStandard)
t a b P a g e 3. C o n t r o l s . A d d ( tabPage3.Controls.Add( t ab P a g e 3. C o n t r o l s . A dd ( labelIndexItems)
t a b P a g e 3. C o n t r o l s . A d d ( tabPage3.Controls.Add( t ab P a g e 3. C o n t r o l s . A dd ( lndexItems)
#t a b P a g e 3. C o n t r o l s . A d d ( tabPage3.Controls.Add( t ab P a g e 3. C o n t r o l s . A dd ( Standard)
#t a b P a g e 3. C o n t r o l s . A d d ( tabPage3.Controls.Add( t ab P a g e 3. C o n t r o l s . A dd ( StandardButton)
#t a b P a g e 3. C o n t r o l s . A d d ( tabPage3.Controls.Add( t ab P a g e 3. C o n t r o l s . A dd ( StandardSpeichernButton)
#t a b P a g e 3. C o n t r o l s . A d d ( tabPage3.Controls.Add( t ab P a g e 3. C o n t r o l s . A dd ( StandardDelButton)
t a b P a g e 3. C o n t r o l s . A d d ( tabPage3.Controls.Add( t ab P a g e 3. C o n t r o l s . A dd ( ButtonExeCalc)
t a b P a g e 3. C o n t r o l s . A d d ( tabPage3.Controls.Add( t ab P a g e 3. C o n t r o l s . A dd ( ButtonlndexItems)
#t a b P a g e 3. C o n t r o l s . A d d ( tabPage3.Controls.Add( t ab P a g e 3. C o n t r o l s . A dd ( labelIndexMatching)
#t a b P a g e 3. C o n t r o l s . A d d ( tabPage3.Controls.Add( t ab P a g e 3. C o n t r o l s . A dd ( IndexMatchingButton)
#t a b P a g e 3. C o n t r o l s . A d d ( tabPage3.Controls.Add( t ab P a g e 3. C o n t r o l s . A dd ( progressbar)
#Tab-Seite 4
#t a b P a g e 4. C o n t r o l s . A d d ( tabPage4.Controls.Add( t ab P a g e 4. C o n t r o l s . A dd ( Tree)
#t a b P a g e 4. C o n t r o l s . A d d ( tabPage4.Controls.Add( t ab P a g e 4. C o n t r o l s . A dd ( ButtonOutputs)
#t a b P a g e 4. C o n t r o l s . A d d ( tabPage4.Controls.Add( t ab P a g e 4. C o n t r o l s . A dd ( progressbar)
t a b P a g e 4. C o n t r o l s . A d d ( tabPage4.Controls.Add( t ab P a g e 4. C o n t r o l s . A dd ( OutputStruk)
t a b P a g e 4. C o n t r o l s . A d d ( tabPage4.Controls.Add( t ab P a g e 4. C o n t r o l s . A dd ( ReportStruk)
t a b P a g e 4. C o n t r o l s . A d d ( tabPage4.Controls.Add( t ab P a g e 4. C o n t r o l s . A dd ( ItemsAndIndizesList)
t a b P a g e 4. C o n t r o l s . A d d ( tabPage4.Controls.Add( t ab P a g e 4. C o n t r o l s . A dd ( ButtonAddNode)
t a b P a g e 4. C o n t r o l s . A d d ( tabPage4.Controls.Add( t ab P a g e 4. C o n t r o l s . A dd ( ButtonDelNode)
t a b P a g e 4. C o n t r o l s . A d d ( tabPage4.Controls.Add( t ab P a g e 4. C o n t r o l s . A dd ( ButtonAddItemIndex)
t a b P a g e 4. C o n t r o l s . A d d ( tabPage4.Controls.Add( t ab P a g e 4. C o n t r o l s . A dd ( ButtonOutput)
#Tab-Seite 5
t a b P a g e 5. C o n t r o l s . A d d ( tabPage5.Controls.Add( t ab P a g e 5. C o n t r o l s . A dd ( Tree)
#t a b P a g e 5. C o n t r o l s . A d d ( tabPage5.Controls.Add( t ab P a g e 5. C o n t r o l s . A dd ( progressbar)
###Tabs zu TabControl hinzufügen
t a b C o n t r o l . C o n t r o l s . A d d ( tabControl.Controls.Add( t ab C o n t r o l . C o n t r o l s . A dd ( tabPage1)
t a b C o n t r o l . C o n t r o l s . A d d ( tabControl.Controls.Add( t ab C o n t r o l . C o n t r o l s . A dd ( tabPage2)
t a b C o n t r o l . C o n t r o l s . A d d ( tabControl.Controls.Add( t ab C o n t r o l . C o n t r o l s . A dd ( tabPage3)
t a b C o n t r o l . C o n t r o l s . A d d ( tabControl.Controls.Add( t ab C o n t r o l . C o n t r o l s . A dd ( tabPage4)
t a b C o n t r o l . C o n t r o l s . A d d ( tabControl.Controls.Add( t ab C o n t r o l . C o n t r o l s . A dd ( tabPage5)
t a b C o n t r o l . C o n t r o l s . A d d ( tabControl.Controls.Add( t ab C o n t r o l . C o n t r o l s . A dd ( tabPage6)
Excel_DragOver = [System.Windows.Forms.DragEventHandler]{
if ( .Data.GetDataPresent([Windows.Forms.DataFormats]::FileDrop)) # _ = [System.Windows.Forms.DragEventArgs]
{
.Effect = 'Copy'
}
else
{
$_.Effect = 'None'
}
}
Excel_DragDrop = [System.Windows.Forms.DragEventHandler]{
script:filenameExcel=_.Data.GetData([Windows.Forms.DataFormats]::FileDrop) # _ = [System.Windows.Forms.DragEventArgs]
s c r i p t : E x c e l P f a d = script:ExcelPfad= scr i pt : E x ce l P f a d = filenameExcel.split()
k u r z n a m e E x c e l = kurznameExcel= k u r z nam e E x ce l = filenameExcel.split("")
k u r z n a m e E x c e l = kurznameExcel= k u r z nam e E x ce l = kurznameExcel[-1]
E x c e l . I t e m s . A d d ( Excel.Items.Add( E x ce l . I t e m s . A dd ( kurznameExcel)
Pfad_Choose={
Pfad.Text=""
[System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms")|Out-Null
f o l d e r n a m e = N e w − O b j e c t S y s t e m . W i n d o w s . F o r m s . F o l d e r B r o w s e r D i a l o g foldername = New-Object System.Windows.Forms.FolderBrowserDialog
f o l d er nam e = N e w − O bj ec tS y s t e m . W in d o w s . F or m s . F o l d er B r o w ser D ia l o g foldername.Description = "Ordner wählen"
#foldername.rootfolder = "T:"
try{
foldername.SelectedPath = "T:\2-GB+AP"
}
catch{
$foldername.SelectedPath = "C:"
}
code Copy code
if($foldername.ShowDialog() -eq "OK")
{
$Pfad.Text= $foldername.SelectedPath
#$script:AusgabePfad=$foldername.SelectedPath
ButtonDelExcel_deleteClick = {
#foreach(s in Excel.Items.
E x c e l . I t e m s . C l e a r ( ) Excel.Items.Clear()
E x ce l . I t e m s . C l e a r ( ) script:Excel=""
}
#B u t t o n I t e m D e l − − > ButtonItemDel --> B u tt o n I t e m D e l − − > Items
P r o j e k t = Projekt = P r o j e k t = Projekt.Text
if($Projekt -match "Polizei"){
O u t p u t S t r u k . N o d e s [ 1 ] . N o d e s [ 3 ] . N o d e s . A d d ( " A r b e i t s f a ¨ h i g k e i t " ) OutputStruk.Nodes[1].Nodes[3].Nodes.Add("Arbeitsfähigkeit")
O u tp u tS t r u k . N o d es [ 1 ] . N o d es [ 3 ] . N o d es . A dd ( " A r b e i t s f a ¨ hi g k e i t " ) OutputStruk.Nodes[1].Nodes[3].Nodes.Add("Identifikation")
O u t p u t S t r u k . N o d e s [ 1 ] . N o d e s [ 1 ] . N o d e s [ 0 ] . N o d e s . A d d ( " K o g [ K o g n i t i v e A n f o r d e r u n g e n ] " ) OutputStruk.Nodes[1].Nodes[1].Nodes[0].Nodes.Add("Kog [Kognitive Anforderungen]")
O u tp u tS t r u k . N o d es [ 1 ] . N o d es [ 1 ] . N o d es [ 0 ] . N o d es . A dd ( " K o g [ K o g ni t i v e A n f or d er u n g e n ] " ) OutputStruk.Nodes[1].Nodes[1].Nodes[0].Nodes.Add("Emo [Emotionale Anforderungen]")
O u t p u t S t r u k . N o d e s [ 1 ] . N o d e s [ 1 ] . N o d e s [ 0 ] . N o d e s . A d d ( " G e f a h r [ G e f a h r e n s i t u a t i o n e n ] " ) OutputStruk.Nodes[1].Nodes[1].Nodes[0].Nodes.Add("Gefahr [Gefahrensituationen]")
O u tp u tS t r u k . N o d es OutputStruk.Nodes[1].Nodes[1].Nodes[0].Nodes.Add("Zust [Unklare Zuständigkeiten]")
$OutputStruk.Nodes[1].Nodes[1].Nodes[0].Nodes.Add("Info [Fehlende Informationen]")
#Belastungen - Bedingungen
O u t p u t S t r u k . N o d e s [ 1 ] . N o d e s [ 1 ] . N o d e s [ 1 ] . N o d e s . A d d ( " Z e i t [ Z e i t d r u c k ] " ) OutputStruk.Nodes[1].Nodes[1].Nodes[1].Nodes.Add("Zeit [Zeitdruck]")
O u tp u tS t r u k . N o d es [ 1 ] . N o d es [ 1 ] . N o d es [ 1 ] . N o d es . A dd ( " Z e i t [ Z e i t d r u c k ] " ) OutputStruk.Nodes[1].Nodes[1].Nodes[1].Nodes.Add("BerufPrivat [Konflikt Beruf & Privatleben]")
O u t p u t S t r u k . N o d e s [ 1 ] . N o d e s [ 1 ] . N o d e s [ 1 ] . N o d e s . A d d ( " A u n [ A r b e i t s u n t e r b r e c h u n g e n ] " ) OutputStruk.Nodes[1].Nodes[1].Nodes[1].Nodes.Add("Aun [Arbeitsunterbrechungen]")
O u tp u tS t r u k . N o d es OutputStruk.Nodes[1].Nodes[1].Nodes[1].Nodes.Add("Am [Probleme Arbeitsmittel]")
O u t p u t S t r u k . N o d e s [ 1 ] . N o d e s [ 1 ] . N o d e s [ 1 ] . N o d e s . A d d ( " A u s [ P r o b l e m e A u s r u ¨ s t u n g ] " ) OutputStruk.Nodes[1].Nodes[1].Nodes[1].Nodes.Add("Aus [Probleme Ausrüstung]")
O u tp u tS t r u k . N o d es OutputStruk.Nodes[1].Nodes[1].Nodes[1].Nodes.Add("Aum [Probleme Arbeitsumgebung]")
O u t p u t S t r u k . N o d e s [ 1 ] . N o d e s [ 1 ] . N o d e s [ 1 ] . N o d e s . A d d ( " K o n T [ K o n f l i k t e T e a m ] " ) OutputStruk.Nodes[1].Nodes[1].Nodes[1].Nodes.Add("KonT [Konflikte Team]")
O u tp u tS t r u k . N o d es [ 1 ] . OutputStruk.Nodes[1].Nodes[1].Nodes[1].Nodes.Add("KonB [Konflikte bereichsübergreifend]")
O u t p u t S t r u k . N o d e s [ 1 ] . N o d e s [ 2 ] . N o d e s [ 0 ] . N o d e s . A d d ( " A i n [ A r b e i t s i n h a l t e ] " ) OutputStruk.Nodes[1].Nodes[2].Nodes[0].Nodes.Add("Ain [Arbeitsinhalte]")
O u tp u tS t r u k . N o d es [ 1 ] . N o d es [ 2 ] . N o d es [ 0 ] . N o d es . A dd ( " A in [ A r b e i t s inha l t e ] " ) OutputStruk.Nodes[1].Nodes[2].Nodes[0].Nodes.Add("Sinn [Sinnhaftigkeit]")
O u t p u t S t r u k . N o d e s [ 1 ] . N o d e s [ 2 ] . N o d e s [ 0 ] . N o d e s . A d d ( " H a n [ H a n d l u n g s s p i e l r a u m ] " ) OutputStruk.Nodes[1].Nodes[2].Nodes[0].Nodes.Add("Han [Handlungsspielraum ]")
O u tp u tS t r u k . N o d es [ 1 OutputStruk.Nodes[1].Nodes[2].Nodes[0].Nodes.Add("Qual [Qualifikationen]")
$OutputStruk.Nodes[1].Nodes[2].Nodes[0].Nodes.Add("Ent [Entwicklungsmöglichkeiten]")
#Ressourcen - Bedingungen
O u t p u t S t r u k . N o d e s [ 1 ] . N o d e s [ 2 ] . N o d e s [ 1 ] . N o d e s . A d d ( " P a u s e n [ P a u s e n k u l t u r ] " ) OutputStruk.Nodes[1].Nodes[2].Nodes[1].Nodes.Add("Pausen [Pausenkultur]")
O u tp u tS t r u k . N o d es [ 1 ] . N o d es [ 2 ] . N o d es [ 1 ] . N o d es . A dd ( " P a u se n [ P a u se nk u l t u r ] " ) OutputStruk.Nodes[1].Nodes[2].Nodes[1].Nodes.Add("Azeit [Arbeitszeitregelungen]")
O u t p u t S t r u k . N o d e s [ 1 ] . N o d e s [ 2 ] . N o d e s [ 1 ] . N o d e s . A d d ( " U n K o [ U n t e r s t u ¨ t z u n g K o l l e g e n / − i n n e n ] " ) OutputStruk.Nodes[1].Nodes[2].Nodes[1].Nodes.Add("UnKo [Unterstützung Kollegen/-innen]")
O u tp u tS t r u k OutputStruk.Nodes[1].Nodes[2].Nodes[1].Nodes.Add("UnVor [Unterstützung Führungskraft]")
O u t p u t S t r u k . N o d e s [ 1 ] . N o d e s [ 2 ] . N o d e s [ 1 ] . N o d e s . A d d ( " F u e S a [ F u ¨ h r u n g S a c h e b e n e ] " ) OutputStruk.Nodes[1].Nodes[2].Nodes[1].Nodes.Add("FueSa [Führung Sachebene]")
O u tp u tS t r u k . N o d es OutputStruk.Nodes[1].Nodes[2].Nodes[1].Nodes.Add("FueBe [Führung Beziehungsebene]")
OutputStruk.Nodes[1].Nodes[2].Nodes[1].Nodes.Add("Wert [Wertschätzung & Fairness]")
OutputStruk.Nodes[1].Nodes[2].Nodes[1].Nodes.Add("Normen [Normen & Werte]")
#Beanspruchung- Stressreaktionen
O u t p u t S t r u k . N o d e s [ 1 ] . N o d e s [ 3 ] . N o d e s [ 0 ] . N o d e s . A d d ( " A n s p [ A n s p a n n u n g ] " ) OutputStruk.Nodes[1].Nodes[3].Nodes[0].Nodes.Add("Ansp [Anspannung]")
O u tp u tS t r u k . N o d es [ 1 ] . N o d es [ 3 ] . N o d es [ 0 ] . N o d es . A dd ( " A n s p [ A n s p ann u n g ] " ) OutputStruk.Nodes[1].Nodes[3].Nodes[0].Nodes.Add("Ersch [Erschöpfung]")
#Beanspruchung- Beschwerdeliste
O u t p u t S t r u k . N o d e s [ 1 ] . N o d e s [ 3 ] . N o d e s [ 1 ] . N o d e s . A d d ( " A u g e n [ P r o b l e m e m i t d e n A u g e n ( z . B . B r e n n e n , E r m u ¨ d u n g ) ] " ) OutputStruk.Nodes[1].Nodes[3].Nodes[1].Nodes.Add("Augen [Probleme mit den Augen (z.B. Brennen, Ermüdung)]")
O u tp u tS t r u k . N o d es [ 1 ] . N o d es [ 3 ] . N o d es [ 1 ] . N o d es . A dd ( " A ug e n [ P r o b l e m e mi t d e n A ug e n ( z . B . B r e nn e n , E r m u ¨ d u n g )] " ) OutputStruk.Nodes[1].Nodes[3].Nodes[1].Nodes.Add("Konz [Konzentrationsstörungen]")
O u t p u t S t r u k . N o d e s [ 1 ] . N o d e s [ 3 ] . N o d e s [ 1 ] . N o d e s . A d d ( " S c h l a f [ E i n s c h l a f − o d e r D u r c h s c h l a f s c h w i e r i g k e i t e n ] " ) OutputStruk.Nodes[1].Nodes[3].Nodes[1].Nodes.Add("Schlaf [Einschlaf- oder Durchschlafschwierigkeiten]")
O u tp u tS OutputStruk.Nodes[1].Nodes[3].Nodes[1].Nodes.Add("Angst [Angstgefühle]")
O u t p u t S t r u k . N o d e s [ 1 ] . N o d e s [ 3 ] . N o d e s [ 1 ] . N o d e s . A d d ( " K o p f [ K o p f s c h m e r z e n ] " ) OutputStruk.Nodes[1].Nodes[3].Nodes[1].Nodes.Add("Kopf [Kopfschmerzen]")
O u tp u tS t r u k . N o d es [ 1 ] . OutputStruk.Nodes[1].Nodes[3].Nodes[1].Nodes.Add("HaendeArme [Beschwerden in den Händen oder Armen]")
$OutputStruk.Nodes[1].Nodes[3].Nodes[1].Nodes.Add("NaSchu [Nacken-, Schulter- oder Rückenschmerzen]")
#Beanspruchung- Arbeitsfähigkeit
O u t p u t S t r u k . N o d e s [ 1 ] . N o d e s [ 3 ] . N o d e s [ 2 ] . N o d e s . A d d ( " F a e h i g P h y s i s [ W i e s c h a ¨ t z e n S i e I h r e j e t z i g e A r b e i t s f a ¨ h i g k e i t i n B e z u g a u f d i e k o ¨ r p e r l i c h e n A r b e i t s a n f o r d e r u n g e n e i n ? ] " ) OutputStruk.Nodes[1].Nodes[3].Nodes[2].Nodes.Add("FaehigPhysis [Wie schätzen Sie Ihre jetzige Arbeitsfähigkeit in Bezug auf die körperlichen Arbeitsanforderungen ein?]")
O u tp u tS t r u k . N o d es [ 1 ] . N o d es [ 3 ] . N o d es [ 2 ] . N o d es . A dd ( " F a e hi g P h y s i s [ W i esc h OutputStruk.Nodes[1].Nodes[3].Nodes[2].Nodes.Add("FaehigPsyche [Wie schätzen Sie Ihre jetzige Arbeitsfähigkeit in Bezug auf die psychischen Arbeitsanforderungen ein?]")
#Beanspruchung- Identifikation
O u t p u t S t r u k . N o d e s [ 1 ] . N o d e s [ 3 ] . N o d e s [ 3 ] . N o d e s . A d d ( " I d e n E i g e n e [ E i g e n e ] " ) OutputStruk.Nodes[1].Nodes[3].Nodes[3].Nodes.Add("IdenEigene [Eigene]")
O u tp u tS t r u k . N o d es [ 1 ] . N o d es [ 3 ] . N o d es [ 3 ] . N o d es . A dd ( " I d e n E i g e n e [ E i g e n e ] " ) OutputStruk.Nodes[1].Nodes[3].Nodes[3].Nodes.Add("IdenFremd [Kollegen/-innen]")
S c r i p t : W B d a t a = Script:WBdata= S cr i pt : W B d a t a = objExcel.Workbooks.Open(f i l e n a m e E x c e l ) filenameExcel)
f i l e nam e E x ce l ) Script:WSdata = W B d a t a . S h e e t s . i t e m ( " r e s u l t s " ) WBdata.Sheets.item("results")
W B d a t a . S h ee t s . i t e m ( " r es u l t s " ) Script:WScodePlan=W B d a t a . S h e e t s . i t e m ( " c o d e p l a n " ) WBdata.Sheets.item("code_plan")
W B d a t a . S h ee t s . i t e m ( " co d e p l an " ) Script:WSItemKonzept=$WBitemConcepts.Sheets.item("Polizei")
C o u n t e r = 0 Counter=0
C o u n t er = 0 prog=0
p r o g r e s s b a r . V i s i b l e = progressbar.Visible= p r o g r ess ba r . V i s ib l e = true
p r o g r e s s b a r . M i n i m u m = 1 progressbar.Minimum=1
p r o g r ess ba r . M inim u m = 1 progressbar.Maximum=W S c o d e P l a n . u s e d R a n g e . r o w s . c o u n t WScodePlan.usedRange.rows.count
W S co d e P l an . u se d R an g e . r o w s . co u n t progressbar.Value = 1
$progressbar.Step=1
p r o g T x t . V i s i b l e = progTxt.Visible= p r o g T x t . V i s ib l e = true
$progTxt.Text="Items werden gematcht..."
p r o g r e s s b a r L a b e l . V i s i b l e = progressbarLabel.Visible= p r o g r ess ba r L ab e l . V i s ib l e = true
p r o g r e s s T e x t = " 0 progressText="0%"
p r o g r ess T e x t = "0 progressbarLabel.text=$progressText
#W B d a t a = WBdata= W B d a t a = objExcel.Workbooks.Open(filenameExcel)
# WSdata = WBdata.Sheets.item("results")
# WScodePlan=WBdata.Sheets.item("code_plan")
# WSItemKonzept=$WBitemConcepts.Sheets.item("Polizei")
for(R e i h e = 2 ; Reihe=2; R e ih e = 2 ; Reihe -le W S c o d e P l a n . u s e d R a n g e . r o w s . c o u n t ; WScodePlan.usedRange.rows.count; W S co d e P l an . u se d R an g e . r o w s . co u n t ; Reihe++){
s k a l a K o n s t r u k t = " " skalaKonstrukt=""
s k a l a K o n s t r u k t = "" naechsteReihe=0
#while((W S c o d e P l a n . R a n g e ( ′ B ′ + WScodePlan.Range('B'+ W S co d e P l an . R an g e ( ′ B ′ + naechsteReihe).value2 -notlike "") -and(n a e c h s t e R e i h e − l e naechsteReihe -le na ec h s t e R e ih e − l e WScodePlan.usedRange.rows.count)){
if(W S c o d e P l a n . R a n g e ( ′ A ′ + WScodePlan.Range('A'+ W S co d e P l an . R an g e ( ′ A ′ + Reihe).value2 -notlike ""){
try{
r e k I t e m = " 0 r " − f rekItem= "{0}_r" -f r e k I t e m = " 0 r " − f WScodePlan.Range('A'+R e i h e ) . v a l u e 2 Reihe).value2
R e ih e ) . v a l u e 2 Zeile=W S I t e m K o n z e p t . C e l l s . F i n d ( WSItemKonzept.Cells.Find( W S I t e m K o n z e pt . C e l l s . F in d ( rekItem,[Type]::Missing,[Type]::Missing,1).Address() -replace "[^0-9]"
I t e m s . R o w s . A d d ( Items.Rows.Add( I t e m s . R o w s . A dd ( WSItemKonzept.Range("A"+Z e i l e ) . v a l u e 2 , Zeile).value2, Z e i l e ) . v a l u e 2 , WSItemKonzept.Range("B"+Z e i l e ) . v a l u e 2 , Zeile).value2, Z e i l e ) . v a l u e 2 , WSItemKonzept.Range("C"+Z e i l e ) . v a l u e 2 , Zeile).value2, Z e i l e ) . v a l u e 2 , WSItemKonzept.Range("D"+Z e i l e ) . v a l u e 2 , Zeile).value2, Z e i l e ) . v a l u e 2 , WSItemKonzept.Range("E"+Z e i l e ) . v a l u e 2 ) Zeile).value2)
Z e i l e ) . v a l u e 2 ) a=W S I t e m K o n z e p t . R a n g e ( ′ A ′ + WSItemKonzept.Range('A'+ W S I t e m K o n z e pt . R an g e ( ′ A ′ + Zeile).value2
b = b= b = WSItemKonzept.Range('B'+Z e i l e ) . v a l u e 2 Zeile).value2
Z e i l e ) . v a l u e 2 Script:ItemsAndIndizes+=a
# Script:ItemsAndIndizesDesc+="{0} [{1}]" -f a , a, a , b
B l a = " 0 [ 1 ] " − f Bla="{0} [{1}]" -f B l a = " 0 [ 1 ] " − f a,b b
b Script:ItemsAndIndizesList.Rows.Add($Bla)
#R o w I a n d I = RowIandI= R o w I an d I = ItemsAndIndizesList.Rows[Counter]
# Row=I t e m s A n d I n d i z e s L i s t . R o w s [ ItemsAndIndizesList.Rows[ I t e m s A n d I n d i z es L i s t . R o w s [ Counter]
#R o w . D e f a u l t C e l l S t y l e . F o r e C o l o r = Row.DefaultCellStyle.ForeColor = R o w . D e f a u l tC e l l S t y l e . F or e C o l or = MASCyanRGB
S c r i p t : C o u n t e r = Script:Counter= S cr i pt : C o u n t er = Counter++
}
catch{
"Item gibt's net in rekodiert :)"}
try{
Z e i l e = Zeile= Z e i l e = WSItemKonzept.cells.find(W S c o d e P l a n . R a n g e ( ′ A ′ + WScodePlan.Range('A'+ W S co d e P l an . R an g e ( ′ A ′ + Reihe).value2,[Type]::Missing,[Type]::Missing,1).Address() -replace "[^0-9]"
I t e m s . R o w s . A d d ( Items.Rows.Add( I t e m s . R o w s . A dd ( WSItemKonzept.Range("A"+Z e i l e ) . v a l u e 2 , Zeile).value2, Z e i l e ) . v a l u e 2 , WSItemKonzept.Range("B"+Z e i l e ) . v a l u e 2 , Zeile).value2, Z e i l e ) . v a l u e 2 , WSItemKonzept.Range("C"+Z e i l e ) . v a l u e 2 , Zeile).value2, Z e i l e ) . v a l u e 2 , WSItemKonzept.Range("D"+Z e i l e ) . v a l u e 2 , Zeile).value2, Z e i l e ) . v a l u e 2 , WSItemKonzept.Range("E"+Z e i l e ) . v a l u e 2 ) Zeile).value2)
Z e i l e ) . v a l u e 2 ) a=W S I t e m K o n z e p t . R a n g e ( ′ A ′ + WSItemKonzept.Range('A'+ W S I t e m K o n z e pt . R an g e ( ′ A ′ + Zeile).value2
b = b= b = WSItemKonzept.Range('B'+Z e i l e ) . v a l u e 2 Zeile).value2
Z e i l e ) . v a l u e 2 Script:ItemsAndIndizes+=a
# Script:ItemsAndIndizesDesc+="{0} [{1}]" -f a , a, a , b
B l a = " 0 [ 1 ] " − f Bla="{0} [{1}]" -f B l a = " 0 [ 1 ] " − f a,b b
b Script:ItemsAndIndizesList.Rows.Add(Bla)
# RowIandI=I t e m s A n d I n d i z e s L i s t . R o w s [ ItemsAndIndizesList.Rows[ I t e m s A n d I n d i z es L i s t . R o w s [ Counter]
#R o w = Row= R o w = ItemsAndIndizesList.Rows[Counter]
# Row.DefaultCellStyle.ForeColor = M A S C y a n R G B MASCyanRGB
M A S C y an R GB Script:Counter=$Counter++
}
if ((W S c o d e P l a n . R a n g e ( ′ B ′ + WScodePlan.Range('B'+ W S co d e P l an . R an g e ( ′ B ′ + Reihe).value2 -like 'answer') -or (W S c o d e P l a n . R a n g e ( ′ C ′ + WScodePlan.Range('C'+ W S co d e P l an . R an g e ( ′ C ′ + Reihe).value2 -like 'multiple_choice') -or (W S c o d e P l a n . R a n g e ( ′ C ′ + WScodePlan.Range('C'+ W S co d e P l an . R an g e ( ′ C ′ + Reihe).value2 -like 'checkbox')){
n a e c h s t e R e i h e = naechsteReihe= na ec h s t e R e ih e = Reihe+1
while((W S c o d e P l a n . R a n g e ( ′ A ′ + WScodePlan.Range('A'+ W S co d e P l an . R an g e ( ′ A ′ + naechsteReihe).value2 -like "") -and(n a e c h s t e R e i h e − l e naechsteReihe -le na ec h s t e R e ih e − l e WScodePlan.usedRange.rows.count)){
if (skalaKonstrukt -like ""){
skalaKonstrukt='{0} {1}' -f W S c o d e P l a n . R a n g e ( ′ E ′ + WScodePlan.Range('E'+ W S co d e P l an . R an g e ( ′ E ′ + naechsteReihe).value2,W S c o d e P l a n . R a n g e ( ′ F ′ + WScodePlan.Range('F'+ W S co d e P l an . R an g e ( ′ F ′ + naechsteReihe).value2
skalaKonstrukt
}
else{
skalaKonstrukt='{0};{1} {2}' -f s k a l a K o n s t r u k t , skalaKonstrukt, s k a l a K o n s t r u k t , WScodePlan.Range('E'+n a e c h s t e R e i h e ) . v a l u e 2 , naechsteReihe).value2, na ec h s t e R e ih e ) . v a l u e 2 , WScodePlan.Range('F'+n a e c h s t e R e i h e ) . v a l u e 2 naechsteReihe).value2
na ec h s t e R e ih e ) . v a l u e 2 skalaKonstrukt
}
$naechsteReihe++
}
a = a= a = WScodePlan.Range('A'+R e i h e ) . v a l u e 2 Reihe).value2
R e ih e ) . v a l u e 2 b=W S c o d e P l a n . R a n g e ( ′ F ′ + WScodePlan.Range('F'+ W S co d e P l an . R an g e ( ′ F ′ + Reihe).value2
I t e m s . R o w s . A d d ( Items.Rows.Add( I t e m s . R o w s . A dd ( a,b , b, b , skalaKonstrukt)
#S c r i p t : K u e r z e l L i s t e T a b e l l e + = Script:KuerzelListeTabelle+= S cr i pt : K u er z e l L i s t e T ab e l l e + = WScodePlan.Range('A'+$Reihe).value2
S c r i p t : p o t e n t i a l D e m o s I t e m s + = Script:potentialDemosItems+= S cr i pt : p o t e n t ia l D e m os I t e m s + = WScodePlan.Range('A'+R e i h e ) . v a l u e 2 Reihe).value2
R e ih e ) . v a l u e 2 Script:potentialDemosDescr+=W S c o d e P l a n . R a n g e ( ′ F ′ + WScodePlan.Range('F'+ W S co d e P l an . R an g e ( ′ F ′ + Reihe).value2
S c r i p t : p o t e n t i a l D e m o s S c a l e + = Script:potentialDemosScale+= S cr i pt : p o t e n t ia l D e m os S c a l e + = skalaKonstrukt
S c r i p t : I t e m s A n d I n d i z e s + = Script:ItemsAndIndizes+= S cr i pt : I t e m s A n d I n d i z es + = a
#S c r i p t : I t e m s A n d I n d i z e s D e s c + = " 0 [ 1 ] " − f Script:ItemsAndIndizesDesc+="{0} [{1}]" -f S cr i pt : I t e m s A n d I n d i z esD esc + = " 0 [ 1 ] " a,b b
b Bla="{0} [{1}]" -f a , a, a , b
S c r i p t : I t e m s A n d I n d i z e s L i s t . R o w s . A d d ( Script:ItemsAndIndizesList.Rows.Add( S cr i pt : I t e m s A n d I n d i z es L i s t . R o w s . A dd ( Bla)
R o w I a n d I = RowIandI= R o w I an d I = ItemsAndIndizesList.Rows[C o u n t e r ] Counter]
C o u n t er ] RowIandI.DefaultCellStyle.ForeColor = $MASCyanRGB
R o w = Row= R o w = Items.Rows[C o u n t e r ] Counter]
C o u n t er ] Row.DefaultCellStyle.ForeColor = W h i t e R G B WhiteRGB
W hi t e R GB Row.DefaultCellStyle.BackColor = M A S C y a n R G B MASCyanRGB
M A S C y an R GB Script:Counter=$Counter++
}
p r o g = prog= p r o g = prog+1
p r o g z a h l = progzahl= p r o g z ah l = WScodePlan.usedRange.rows.count
p r o g z a h l = progzahl= p r o g z ah l = prog/p r o g z a h l ∗ 100 progzahl*100
p r o g z ah l ∗ 100 progzahl=[math]::Round(p r o g z a h l ) progzahl)
p r o g z ah l ) progressText="{0}%" -f p r o g z a h l progzahl
p r o g z ah l progressbarLabel.text=p r o g r e s s T e x t progressText
p r o g r ess T e x t progressbar.PerformStep()
[System.Windows.Forms.MessageBox]::Show("Items importiert!","Prozess abgeschlossen",0)
p r o g r e s s b a r . V i s i b l e = progressbar.Visible= p r o g r ess ba r . V i s ib l e = false
p r o g T x t . V i s i b l e = progTxt.Visible= p r o g T x t . V i s ib l e = false
p r o g r e s s b a r L a b e l . v i s i b l e = progressbarLabel.visible= p r o g r ess ba r L ab e l . v i s ib l e = false
Items_CellMouseClick={
Script:ItemSkala.Text=""
C u r r e n t R o w I t e m D a t a G r i d = CurrentRowItemDataGrid= C u r r e n tR o w I t e m D a t a G r i d = Items.CurrentCellAddress.Y
#z a e h l e r = 0 zaehler=0
z a e h l er = 0 SkalaBox=I t e m s . R o w s [ Items.Rows[ I t e m s . R o w s [ CurrentRowItemDataGrid].Cells[2].Value.tostring()
S k a l a B o x = SkalaBox= S k a l a B o x = SkalaBox.split(';')
foreach(S k a l e n P u n k t i n SkalenPunkt in S k a l e n P u nk t in SkalaBox){
#z a e h l e r + + i f ( zaehler++
if( z a e h l er + + i f ( SkalenPunktReihe -like ''){
S k a l e n P u n k t R e i h e = SkalenPunktReihe= S k a l e n P u nk tR e ih e = SkalenPunkt
}
else{
S k a l e n P u n k t R e i h e = ′ 01 ′ − f SkalenPunktReihe='{0}
{1}' -f S k a l e n P u nk tR e ih e = ′ 0 1 ′ − SkalenPunktReihe,$SkalenPunkt
}
#I t e m S k a l a . I t e m s . a d d ( ItemSkala.Items.add( I t e m S k a l a . I t e m s . a dd ( zaehler,$SkalenPunktReihe)
}
S c r i p t : I t e m S k a l a . T e x t = Script:ItemSkala.Text= S cr i pt : I t e m S k a l a . T e x t = SkalenPunktReihe
#z a e h l e r = 0 zaehler=0
z a e h l er = 0 Script:CurrentRowItemDataGrid=""
}
ButtonSkala_Click={
CurrentRowItemDataGrid=I t e m s . C u r r e n t C e l l A d d r e s s . Y Items.CurrentCellAddress.Y
I t e m s . C u r r e n tC e l l A dd r ess . Y Items.Rows[C u r r e n t R o w I t e m D a t a G r i d ] . C e l l s [ 2 ] . V a l u e = CurrentRowItemDataGrid].Cells[2].Value= C u r r e n tR o w I t e m D a t a G r i d ] . C e l l s [ 2 ] . V a l u e = ItemSkala.Text.Replace("rn",";")
}
C u r r e n t R o w I t e m D a t a G r i d = CurrentRowItemDataGrid= C u r r e n tR o w I t e m D a t a G r i d = Items.CurrentCellAddress.Y
i t e m K u e r z e l A k t u e l l = itemKuerzelAktuell= i t e m K u er z e l A k t u e l l = Items.Rows[C u r r e n t R o w I t e m D a t a G r i d ] . C e l l s [ 0 ] . V a l u e CurrentRowItemDataGrid].Cells[0].Value
C u r r e n tR o w I t e m D a t a G r i d ] . C e l l s [ 0 ] . V a itemKuerzelAktuell='{0}_r' -f i t e m K u e r z e l A k t u e l l itemKuerzelAktuell
i t e m K u er z e l A k t u e l l itemTextAktuell=I t e m s . R o w s [ Items.Rows[ I t e m s . R o w s [ CurrentRowItemDataGrid].Cells[1].Value
i t e m T e x t A k t u e l l = ′ 0 ∗ ′ − f itemTextAktuell='{0} *' -f i t e m T e x t A k t u e l l = ′ 0 ∗ ′ itemTextAktuell
i t e m S k a l a A k t u e l l = itemSkalaAktuell= i t e m S k a l a A k t u e l l = ItemSkala.Text.Replace("rn",";")
i t e m I n d e x A k t u e l l = itemIndexAktuell= i t e m I n d e x A k t u e l l = Items.Rows[C u r r e n t R o w I t e m D a t a G r i d ] . C e l l s [ 3 ] . V a l u e CurrentRowItemDataGrid].Cells[3].Value
C u r r e n tR o w I t e m D a t a G r i d ] . C e l l s [ 3 ] . V a itemUrsprungAktuell=I t e m s . R o w s [ Items.Rows[ I t e m s . R o w s [ CurrentRowItemDataGrid].Cells[0].Value
I t e m s . R o w s . A d d ( Items.Rows.Add( I t e m s . R o w s . A dd ( itemKuerzelAktuell, i t e m T e x t A k t u e l l , itemTextAktuell, i t e m T e x t A k t u e l l , itemSkalaAktuell,i t e m I n d e x A k t u e l l , itemIndexAktuell, i t e m I n d e x A k t u e l l , itemUrsprungAktuell)
t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( progressbar)
t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( progressbarLabel)
t a b P a g e 2. C o n t r o l s . A d d ( tabPage2.Controls.Add( t ab P a g e 2. C o n t r o l s . A dd ( progTxt)
p r o g = 0 prog=0
p r o g = 0 progressbarLabel.visible=t r u e true
t r u e progressbarLabel.text=""
p r o g r e s s b a r . V i s i b l e = progressbar.Visible= p r o g r ess ba r . V i s ib l e = true
p r o g r e s s b a r . M i n i m u m = 1 progressbar.Minimum=1
p r o g r ess ba r . M inim u m = 1 progressbar.Maximum=I t e m s . r o w s . c o u n t − 1 Items.rows.count-1
I t e m s . r o w s . co u n t − 1 progressbar.Value = 1
$progressbar.Step=1
p r o g T x t . V i s i b l e = progTxt.Visible= p r o g T x t . V i s ib l e = true
$progTxt.Text="Items werden rekodiert.."
for(R e i h e = 0 ; Reihe=0; R e ih e = 0 ; Reihe -le I t e m s . r o w s . c o u n t − 1 ; Items.rows.count-1; I t e m s . r o w s . co u n t − 1 ; Reihe++){
if((I t e m s . R o w s [ Items.Rows[ I t e m s . R o w s [ Reihe].Cells[3].Value -notin i n d e x L i s t ) − a n d ( indexList) -and ( in d e xL i s t ) − an d ( Items.Rows[Reihe].Cells[3].Value -notlike "")){
Script:indexList.add(I t e m s . R o w s [ Items.Rows[ I t e m s . R o w s [ Reihe].Cells[3].Value)
}
r e k o d i e r t J a = rekodiertJa= r e k o d i er t J a = Items.Rows[$Reihe].Cells[4].Value
if($rekodiertJa -notlike ""){
i t e m U r s p r u n g = itemUrsprung= i t e m U r s p r u n g = WSdata.Cells.Find($rekodiertJa,[Type]::Missing,[Type]::Missing,1).Address()
i t e m U r s p r u n g = itemUrsprung= i t e m U r s p r u n g = itemUrsprung -replace "[^A-Z]"
i t e m S k a l a W S = itemSkalaWS= i t e m S k a l aW S = Items.Rows[R e i h e ] . C e l l s [ 2 ] . V a l u e Reihe].Cells[2].Value
R e ih e ] . C e l l s [ 2 ] . V a l u e itemSkalaRek=i t e m S k a l a W S − r e p l a c e ′ [ > ; 0123456789 ] ′ , ′ ′ itemSkalaWS -replace '[^>;0123456789]',''
i t e m S k a l aW S − r e pl a c e ′ [ itemSkalaRek=$itemSkalaRek -split(";")
foreach(P a a r i n Paar in P aa r in itemSkalaRek){
w e r t e S p l i t = werteSplit= w er t e S pl i t = Paar.split(">")
d i c t R e k V a r . a d d ( dictRekVar.add( d i c tR e k V a r . a dd ( werteSplit[0],$werteSplit[1])
}
##Werte im Datensatz ersetzen##
n e u e S p a l t e = neueSpalte= n e u e S p a l t e = WSdata.usedRange.columns.count
n e u e S p a l t e = neueSpalte= n e u e S p a l t e = neueSpalte+1
for(R e i h e W S = 3 ; ReiheWS=3; R e ih e W S = 3 ; ReiheWS -le W S d a t a . u s e d R a n g e . r o w s . c o u n t ; WSdata.usedRange.rows.count; W S d a t a . u se d R an g e . r o w s . co u n t ; ReiheWS++){
if(ReiheWS -eq 3){
WSdata.Cells(R e i h e W S , ReiheWS, R e ih e W S , neueSpalte).value2=I t e m s . R o w s [ Items.Rows[ I t e m s . R o w s [ Reihe].Cells[0].Value
W S d a t a . C e l l s ( WSdata.Cells( W S d a t a . C e l l s ( ReiheWS,n e u e S p a l t e ) . i n t e r i o r . c o l o r = neueSpalte).interior.color= n e u e S p a l t e ) . in t er i or . co l or = MASCyanRGB
a k t u e l l e r W e r t = " 01 " − f aktuellerWert="{0}{1}" -f ak t u e l l er W er t = " 0 1 " − f itemUrsprung,$ReiheWS
a k t u e l l e r W e r t = aktuellerWert= ak t u e l l er W er t = WSdata.Cells.Range(aktuellerWert).value2
try{
aktuellerWert=[string]a k t u e l l e r W e r t aktuellerWert
ak t u e l l er W er t neuerWert=d i c t R e k V a r [ dictRekVar[ d i c tR e k V a r [ aktuellerWert]
}
catch{
neuerWert=""
}
WSdata.Cells(R e i h e W S , ReiheWS, R e ih e W S , neueSpalte).value2=$neuerWert
}
}
##Item im Code Plan ergänzen
n e u e Z e i l e = neueZeile= n e u e Z e i l e = WScodePlan.usedRange.rows.count
n e u e Z e i l e = neueZeile= n e u e Z e i l e = neueZeile+1
W S c o d e P l a n . C e l l s . R a n g e ( ′ A ′ + WScodePlan.Cells.Range('A'+ W S co d e P l an . C e l l s . R an g e ( ′ A ′ + neueZeile).value2=I t e m s . R o w s [ Items.Rows[ I t e m s . R o w s [ Reihe].Cells[0].Value
W S c o d e P l a n . C e l l s . R a n g e ( ′ F ′ + WScodePlan.Cells.Range('F'+ W S co d e P l an . C e l l s . R an g e ( ′ F neueZeile).value2=I t e m s . R o w s [ Items.Rows[ I t e m s . R o w s [ Reihe].Cells[1].Value
i t e m S k a l a W S = itemSkalaWS= i t e m S k a l aW S = itemSkalaWS -replace '\d>',''
i t e m S k a l a W S = itemSkalaWS= i t e m S k a l aW S = itemSkalaWS.split(';')
foreach(i i n i in iin itemSkalaWS){
i S p l i t = iSplit= i S pl i t = i -split ' ',2
n e u e Z e i l e = neueZeile= n e u e Z e i l e = neueZeile+1
W S c o d e P l a n . C e l l s . R a n g e ( ′ E ′ + WScodePlan.Cells.Range('E'+ W S co d e P l an . C e l l s . R an g e ( ′ E ′ + neueZeile).value2=i S p l i t [ 0 ] iSplit[0]
i S pl i t [ 0 ] WScodePlan.Cells.Range('F'+n e u e Z e i l e ) . v a l u e 2 = neueZeile).value2= n e u e Z e i l e ) . v a l u e 2 = iSplit[1]
}
}
try{
r e i h e n I n h a l t = reihenInhalt= r e ih e n I nha l t = Items.Rows[R e i h e ] . C e l l s [ 0 ] . V a l u e Reihe].Cells[0].Value
R e ih e ] . C e l l s [ 0 ] . V a l u e reiheInWS=W S c o d e P l a n . c e l l s . F i n d ( WScodePlan.cells.Find( W S co d e P l an . ce l l s . F in d ( reihenInhalt,[Type]::Missing,[Type]::Missing,1).Address()
r e i h e I n W S = reiheInWS= r e ih e I nW S = reiheInWS -replace "[^0-9]"
W S c o d e P l a n . C e l l s . R a n g e ( ′ F ′ + WScodePlan.Cells.Range('F'+ W S co d e P l an . C e l l s . R an g e ( ′ F reiheInWS).value2=I t e m s . R o w s [ Items.Rows[ I t e m s . R o w s [ Reihe].Cells[1].Value
}
catch{
"Klappt net :("}
}
$Script:dictRekVar=[ordered]@{}
#i n d e x L i s t I t e m s = indexListItems= in d e xL i s t I t e m s = indexListItems -join ";"
#I n d e x . R o w s . A d d ( Index.Rows.Add( I n d e x . R o w s . A dd ( index, l e e r , leer, l eer , indexListItems, f o r m e l , formel, f or m e l , leer)
#$indexListItems= New-Object System.Collections.Generic.List[System.Object]
#W B d a t a . S a v e ( ) WBdata.Save()
W B d a t a . S a v e ( ) prog=p r o g + 1 prog+1
p r o g + 1 progzahl=I t e m s . r o w s . c o u n t − 1 Items.rows.count-1
I t e m s . r o w s . co u n t − 1 progzahl=p r o g / prog/ p r o g / progzahl*100
p r o g z a h l = [ m a t h ] : : R o u n d ( progzahl=[math]::Round( p r o g z ah l = [ ma t h ] :: R o u n d ( progzahl)
p r o g r e s s T e x t = " 0 progressText="{0}%" -f p r o g r ess T e x t = " 0 progzahl
p r o g r e s s b a r L a b e l . t e x t = progressbarLabel.text= p r o g r ess ba r L ab e l . t e x t = progressText
$progressbar.PerformStep()
###############################################
###Indizes in den zugehörigen Tab überführen###
###############################################
p r o g r e s s b a r . v a l u e = 1 progressbar.value=1
p r o g r ess ba r . v a l u e = 1 progressbar.Maximum=$indexList.count
$progTxt.Text="Indizes werden hinzugefügt..."
p r o g = 0 prog=0
p r o g = 0 progressbarLabel.text=""
W S I d x C o n c = WSIdxConc= W S I d x C o n c = WBindexConcepts.Sheets.item("Polizei")
foreach(i n d e x i n index in in d e x in indexList){
for(R e i h e = 0 ; Reihe=0; R e ih e = 0 ; Reihe -le I t e m s . r o w s . c o u n t − 1 ; Items.rows.count-1; I t e m s . r o w s . co u n t − 1 ; Reihe++){
if((I t e m s . R o w s [ Items.Rows[ I t e m s . R o w s [ Reihe].Cells[3].Value -like i n d e x ) − a n d ( index) -and ( in d e x ) − an d ( Items.Rows[Reihe].Cells[3].Value -notlike "")){
indexListItems.add(I t e m s . R o w s [ Items.Rows[ I t e m s . R o w s [ Reihe].Cells[0].Value)
}
i n d e x L i s t I t e m s = indexListItems= in d e xL i s t I t e m s = indexListItems -join ";"
try{
R e i h e = Reihe= R e ih e = WSIdxConc.cells.find(i n d e x , [ T y p e ] : : M i s s i n g , [ T y p e ] : : M i s s i n g , 1 ) . A d d r e s s ( ) index,[Type]::Missing,[Type]::Missing,1).Address()
in d e x , [ T y p e ] :: M i ss in g , [ T y p e ] :: M i ss in g , 1 ) . A dd r ess ( ) Reihe=R e i h e − r e p l a c e " [ 0 − 9 ] " Reihe -replace "[^0-9]"
R e ih e − r e pl a ce " [ 0 − 9 ] " descr=W S I d x C o n c . c e l l s . r a n g e ( " B " + WSIdxConc.cells.range("B"+ W S I d x C o n c . ce l l s . r an g e ( " B " + Reihe).value2
f o r m e l = formel= f or m e l = WSIdxConc.cells.range("D"+R e i h e ) . v a l u e 2 Reihe).value2
R e ih e ) . v a l u e 2 kategorie=W S I d x C o n c . c e l l s . r a n g e ( " E " + WSIdxConc.cells.range("E"+ W S I d x C o n c . ce l l s . r an g e ( " E " + Reihe).value2
}
catch{
d e s c r = " " descr=""
d escr = "" formel="Mean"
$kategorie=""
}
try{
S c r i p t : I n d e x . R o w s . A d d ( Script:Index.Rows.Add( S cr i pt : I n d e x . R o w s . A dd ( index, d e s c r , descr, d escr , indexListItems, f o r m e l , formel, f or m e l , kategorie)
S c r i p t : I t e m s A n d I n d i z e s + = Script:ItemsAndIndizes+= S cr i pt : I t e m s A n d I n d i z es + = index
S c r i p t : I t e m s A n d I n d i z e s D e s c + = " 0 [ 1 ] " − f Script:ItemsAndIndizesDesc+="{0} [{1}]" -f S cr i pt : I t e m s A n d I n d i z esD esc + = " 0 [ 1 ] " index,$descr
B l a = " 0 [ 1 ] " − f Bla="{0} [{1}]" -f B l a = " 0 [ 1 ] " − f index,d e s c r descr
d escr Script:ItemsAndIndizesList.Rows.Insert(0,B l a ) Bla)
B l a ) RowIandI=I t e m s A n d I n d i z e s L i s t . R o w s [ 0 ] ItemsAndIndizesList.Rows[0]
I t e m s A n d I n d i z es L i s t . R o w s [ 0 ] RowIandI.DefaultCellStyle.ForeColor = $Black
if(index -like "Ersch"){
Bla="Ersch_neu [Erschöpfung hoch/niedrig]"
S c r i p t : I t e m s A n d I n d i z e s L i s t . R o w s . I n s e r t ( 0 , Script:ItemsAndIndizesList.Rows.Insert(0, S cr i pt : I t e m s A n d I n d i z es L i s t . R o w s . I n ser t ( 0 , Bla)
R o w I a n d I = RowIandI= R o w I an d I = ItemsAndIndizesList.Rows[0]
R o w I a n d I . D e f a u l t C e l l S t y l e . F o r e C o l o r = RowIandI.DefaultCellStyle.ForeColor = R o w I an d I . D e f a u l tC e l l S t y l e . F or e C o l or MASOrangeRGB
B l a = " E r s c h d r e i s t u f i g [ E r s c h o ¨ p f u n g d r e i s t u f i g ] " Bla="Ersch_dreistufig [Erschöpfung dreistufig]"
B l a = " E r sc h d r e i s t u f Script:ItemsAndIndizesList.Rows.Insert(0,B l a ) Bla)
B l a ) RowIandI=I t e m s A n d I n d i z e s L i s t . R o w s [ 0 ] ItemsAndIndizesList.Rows[0]
I t e m s A n d I n d i z es L i s t . R o w s [ 0 ] RowIandI.DefaultCellStyle.ForeColor = MASOrangeRGB
}
elseif( index -like "Ansp"){
B l a = " A n s p d r e i s t u f i g [ A n s p a n n u n g d r e i s t u f i g ] " Bla="Ansp_dreistufig [Anspannung dreistufig]"
B l a = " A n s p d r e i s t u f i g [ Script:ItemsAndIndizesList.Rows.Insert(0,B l a ) Bla)
B l a ) RowIandI=I t e m s A n d I n d i z e s L i s t . R o w s [ 0 ] ItemsAndIndizesList.Rows[0]
I t e m s A n d I n d i z es L i s t . R o w s [ 0 ] RowIandI.DefaultCellStyle.ForeColor = $MASOrangeRGB
}
}
catch{
Read-Host i n d e x R e a d − H o s t index
Read-Host in d e x R e a d − H os t indexListItems
Read-Host $counter
}
i n d e x L i s t I t e m s = N e w − O b j e c t S y s t e m . C o l l e c t i o n s . G e n e r i c . L i s t [ S y s t e m . O b j e c t ] indexListItems= New-Object System.Collections.Generic.List[System.Object]
in d e xL i s t I t e m s = N e w − O bj ec tS y s t e m . C o l l ec t i o n s . G e n er i c . L i s t [ S y s t e m . O bj ec t ] counter=$counter+1
p r o g = prog= p r o g = prog+1
p r o g z a h l = progzahl= p r o g z ah l = indexList.count
p r o g z a h l = progzahl= p r o g z ah l = prog/p r o g z a h l ∗ 100 progzahl*100
p r o g z ah l ∗ 100 progzahl=[math]::Round(p r o g z a h l ) progzahl)
p r o g z ah l ) progressText="{0}%" -f p r o g z a h l progzahl
p r o g z ah l progressbarLabel.text=$progressText
$progressbar.PerformStep()
}
#foreach(n a m e i n name in nam e in ItemsAndIndizesDesc){
#if(n a m e − n o t i n name -notin nam e − n o t in ItemsAndIndizesList) {
#[void] S c r i p t : I t e m s A n d I n d i z e s L i s t . R o w s . A d d ( Script:ItemsAndIndizesList.Rows.Add( S cr i pt : I t e m s A n d I n d i z es L i s t . R o w s . A dd ( name)
#}
#}
#D a t e n S a t z r e k o d i e r t = DatenSatz_rekodiert= D a t e n S a t z r e k o d i er t = filenameExcel.replace('.xlsx','')
#D a t e n S a t z r e k o d i e r t = ′ 0 r e k o d i e r t . x l s x ′ − f DatenSatz_rekodiert='{0}_rekodiert.xlsx' -f D a t e n S a t z r e k o d i er t = ′ 0 r e k o DatenSatz_rekodiert
#W B d a t a . S a v e A s ( WBdata.SaveAs( W B d a t a . S a v e A s ( DatenSatz_rekodiert)
p r o g T x t . v i s i b l e = progTxt.visible= p r o g T x t . v i s ib l e = false
p r o g r e s s b a r . v i s i b l e = progressbar.visible= p r o g r ess ba r . v i s ib l e = false
p r o g r e s s b a r L a b e l . v i s i b l e = progressbarLabel.visible= p r o g r ess ba r L ab e l . v i s ib l e = false
[System.Windows.Forms.MessageBox]::Show("Items rekodiert!","Prozess abgeschlossen",0)
t a b P a g e 3. C o n t r o l s . A d d ( tabPage3.Controls.Add( t ab P a g e 3. C o n t r o l s . A dd ( progressbar)
t a b P a g e 3. C o n t r o l s . A d d ( tabPage3.Controls.Add( t ab P a g e 3. C o n t r o l s . A dd ( progTxt)
t a b P a g e 3. C o n t r o l s . A d d ( tabPage3.Controls.Add( t ab P a g e 3. C o n t r o l s . A dd ( progressbarLabel)
p r o g r e s s b a r . V i s i b l e = progressbar.Visible= p r o g r ess ba r . V i s ib l e = true
p r o g r e s s b a r . M i n i m u m = 1 progressbar.Minimum=1
p r o g r ess ba r . M inim u m = 1 progressbar.Maximum=I n d e x . r o w s . c o u n t − 1 Index.rows.count-1
I n d e x . r o w s . co u n t − 1 progressbar.Value = 1
$progressbar.Step=1
p r o g = 0 prog=0
p r o g = 0 progressbarLabel.Text=""
p r o g r e s s b a r L a b e l . v i s i b l e = progressbarLabel.visible= p r o g r ess ba r L ab e l . v i s ib l e = true
p r o g T x t . v i s i b l e = progTxt.visible= p r o g T x t . v i s ib l e = true
$progTxt.Text="Indizes werden berechnet..."
##Means im Datensatz berechnen##
$misslist=(-9999,-7777,"#miss")
for(R e i h e = 0 ; Reihe=0; R e ih e = 0 ; Reihe -le (I n d e x . r o w s . c o u n t − 1 ) ; Index.rows.count-1); I n d e x . r o w s . co u n t − 1 ) ; Reihe++){
n e u e S p a l t e = neueSpalte= n e u e S p a l t e = WSdata.usedRange.columns.count
n e u e S p a l t e = neueSpalte= n e u e S p a l t e = neueSpalte+1
if (I n d e x . r o w s [ Index.rows[ I n d e x . r o w s [ Reihe].Cells[4].value -notin i n d e x C a t e g o r y L i s t − a n d indexCategoryList -and in d e x C a t e g or y L i s t − an d Index.rows[Reihe].Cells[4].value -notlike ""){
try{
Script:indexCategoryList.add(I n d e x . r o w s [ Index.rows[ I n d e x . r o w s [ Reihe].Cells[4].value)
}
catch{
"Geht net :("
}
}
W S d a t a . c e l l s ( 3 , WSdata.cells(3, W S d a t a . ce l l s ( 3 , neueSpalte).value2=I n d e x . r o w s [ Index.rows[ I n d e x . r o w s [ Reihe].Cells[0].value
W S d a t a . c e l l s ( 3 , WSdata.cells(3, W S d a t a . ce l l s ( 3 , neueSpalte).interior.color=$Black
I n d e x I t e m s = IndexItems= I n d e x I t e m s = Index.rows[$Reihe].Cells[2].value -split(";")
if(I n d e x . r o w s [ Index.rows[ I n d e x . r o w s [ Reihe].Cells[3].value -like "Mean"){
for(R e i h e W S = 4 ; ReiheWS=4; R e ih e W S = 4 ; ReiheWS -le W S d a t a . u s e d R a n g e . r o w s . c o u n t ; WSdata.usedRange.rows.count; W S d a t a . u se d R an g e . r o w s . co u n t ; ReiheWS++){
$Werte=New-Object System.Collections.ArrayList
foreach(I t e m i n Item in I t e min IndexItems){
I t e m S p a l t e = ItemSpalte= I t e m S p a l t e = WSdata.cells.find(I t e m , [ T y p e ] : : M i s s i n g , [ T y p e ] : : M i s s i n g , 1 ) . A d d r e s s ( ) Item,[Type]::Missing,[Type]::Missing,1).Address()
I t e m , [ T y p e ] :: M i ss in g , [ T y p e ] :: M i ss in g , 1 ) . A dd r ess ( ) ItemSpalte=$ItemSpalte -replace "[^A-Z]"
#if((W S d a t a . c e l l s . r a n g e ( WSdata.cells.range( W S d a t a . ce l l s . r an g e ( ItemSpalte+R e i h e W S ) . v a l u e 2 − n o t l i k e " " ) − a n d ReiheWS).value2 -notlike "") -and R e ih e W S ) . v a l u e 2 − n o tl ik e "" ) − an d WSdata.cells.range(I t e m S p a l t e + ItemSpalte+ I t e m S p a l t e + ReiheWS).value2 -notin misslist ){
if( WSdata.cells.range(I t e m S p a l t e + ItemSpalte+ I t e m S p a l t e + ReiheWS).value2 -notin misslist ){
#Read-Host WSdata.cells.range(I t e m S p a l t e + ItemSpalte+ I t e m S p a l t e + ReiheWS).value2
W e r t e . a d d ( Werte.add( W er t e . a dd ( WSdata.cells.range(I t e m S p a l t e + ItemSpalte+ I t e m S p a l t e + ReiheWS).value2)
}
}
#Summe=0
#foreach( Wert in Werte){
# Summe=S u m m e + Summe+ S u mm e + Wert
#}
#M e a n = ( Mean=( M e an = ( Summe/Werte.count).tostring()
try{
Mean=W e r t e ∣ m e a s u r e − o b j e c t − a v e r a g e Werte |measure-object -average
W er t e ∣ m e a s u r e − o bj ec t − a v er a g e Mean=Mean.average
# Mean=(S u m m e / Summe/ S u mm e / Werte.count)
}
catch{
$Mean=""
}
try{
W S d a t a . c e l l s ( WSdata.cells( W S d a t a . ce l l s ( ReiheWS,n e u e S p a l t e ) . v a l u e = neueSpalte).value= n e u e S p a l t e ) . v a l u e = Mean
}
catch{
W S d a t a . c e l l s ( WSdata.cells( W S d a t a . ce l l s ( ReiheWS,n e u e S p a l t e ) . v a l u e 2 = neueSpalte).value2= n e u e S p a l t e ) . v a l u e 2 = Mean
}
#W S d a t a . c e l l s ( WSdata.cells( W S d a t a . ce l l s ( ReiheWS,neueSpalte).NumberFormat="0"
# WSdata.cells(R e i h e W S , ReiheWS, R e ih e W S , neueSpalte).NumberFormat="General"
#W S d a t a . c e l l s ( WSdata.cells( W S d a t a . ce l l s ( Reihe,n e u e S p a l t e ) = neueSpalte)= n e u e S p a l t e ) = Mean
}
p r o g = prog= p r o g = prog+1
p r o g z a h l = progzahl= p r o g z ah l = Index.rows.count-1
p r o g z a h l = progzahl= p r o g z ah l = prog/p r o g z a h l ∗ 100 progzahl*100
p r o g z ah l ∗ 100 progzahl=[math]::Round(p r o g z a h l ) progzahl)
p r o g z ah l ) progressText="{0}%" -f p r o g z a h l progzahl
p r o g z ah l progressbarLabel.text=$progressText
$progressbar.PerformStep()
}
##Erschöpfung hoch/niedrig
if($Projekt -notmatch "Deka" ){
try{
E r s c h S p a l t e = ErschSpalte= E r sc h S p a l t e = WSdata.cells.find("Ersch",[Type]::Missing,[Type]::Missing,1).Address()
E r s c h S p a l t e = ErschSpalte= E r sc h S p a l t e = ErschSpalte -replace "[^A-Z]"
n e u e S p a l t e = neueSpalte= n e u e S p a l t e = WSdata.usedRange.columns.count
#n e u e S p a l t e = neueSpalte= n e u e S p a l t e = neueSpalte+1
W S d a t a . c e l l s ( 3 , WSdata.cells(3, W S d a t a . ce l l s ( 3 , neueSpalte).value2="Ersch_neu"
W S d a t a . c e l l s ( 3 , WSdata.cells(3, W S d a t a . ce l l s ( 3 , neueSpalte).interior.color=$MASOrangeRGB
p r o g r e s s b a r . v a l u e = 1 progressbar.value=1
p r o g r ess ba r . v a l u e = 1 prog=0
p r o g r e s s b a r . m a x i m u m = progressbar.maximum= p r o g r ess ba r . ma x im u m = WSdata.usedRange.rows.count
$progTxt.Text="Erschöpfung hoch/niedrig wird erstellt..."
for(R e i h e W S = 4 ; ReiheWS=4; R e ih e W S = 4 ; ReiheWS -le W S d a t a . u s e d R a n g e . r o w s . c o u n t ; WSdata.usedRange.rows.count; W S d a t a . u se d R an g e . r o w s . co u n t ; ReiheWS++){
try{
if(W S d a t a . c e l l s . r a n g e ( WSdata.cells.range( W S d a t a . ce l l s . r an g e ( ErschSpalte+ReiheWS).value2 -le 3.495){
WSdata.cells(R e i h e W S , ReiheWS, R e ih e W S , neueSpalte).value2=0
}
elseif(W S d a t a . c e l l s . r a n g e ( WSdata.cells.range( W S d a t a . ce l l s . r an g e ( ErschSpalte+ReiheWS).value2 -ge 3.495){
WSdata.cells(R e i h e W S , ReiheWS, R e ih e W S , neueSpalte).value2=1
}
}
catch{
W S d a t a . c e l l s ( WSdata.cells( W S d a t a . ce l l s ( ReiheWS,$neueSpalte).value=""
}
p r o g = prog= p r o g = prog+1
p r o g z a h l = progzahl= p r o g z ah l = WSdata.usedRange.rows.count
p r o g z a h l = progzahl= p r o g z ah l = prog/p r o g z a h l ∗ 100 progzahl*100
p r o g z ah l ∗ 100 progzahl=[math]::Round(p r o g z a h l ) progzahl)
p r o g z ah l ) progressText="{0}%" -f p r o g z a h l progzahl
p r o g z ah l progressbarLabel.text=$progressText
$progressbar.PerformStep()
}
n e u e Z e i l e = neueZeile= n e u e Z e i l e = WScodePlan.usedRange.rows.count
n e u e Z e i l e = neueZeile= n e u e Z e i l e = neueZeile+1
W S c o d e P l a n . C e l l s . R a n g e ( ′ A ′ + WScodePlan.Cells.Range('A'+ W S co d e P l an . C e l l s . R an g e ( ′ A ′ + neueZeile).value2="Ersch_neu"
W S c o d e P l a n . C e l l s . R a n g e ( ′ F ′ + WScodePlan.Cells.Range('F'+ W S co d e P l an . C e l l s . R an g e ( ′ F neueZeile).value2="Erschöpfung hoch/niedrig"
n e u e Z e i l e = neueZeile= n e u e Z e i l e = neueZeile+1
W S c o d e P l a n . C e l l s . R a n g e ( ′ E ′ + WScodePlan.Cells.Range('E'+ W S co d e P l an . C e l l s . R an g e ( ′ E neueZeile).value2=0
W S c o d e P l a n . C e l l s . R a n g e ( ′ F ′ + WScodePlan.Cells.Range('F'+ W S co d e P l an . C e l l s . R an g e ( ′ F neueZeile).value2="Niedrig/Mittel erschöpft"
n e u e Z e i l e = neueZeile= n e u e Z e i l e = neueZeile+1
W S c o d e P l a n . C e l l s . R a n g e ( ′ E ′ + WScodePlan.Cells.Range('E'+ W S co d e P l an . C e l l s . R an g e ( ′ E neueZeile).value2=1
W S c o d e P l a n . C e l l s . R a n g e ( ′ F ′ + WScodePlan.Cells.Range('F'+ W S co d e P l an . C e l l s . R an g e ( ′ F neueZeile).value2="Hoch erschöpft"
catch{
"Gibt keine Erschöpfung :("
}
##Anspannung und Erschöpfung dreistufig
try{
A n s p S p a l t e = AnspSpalte= A n s pS p a l t e = WSdata.cells.find("Ansp",[Type]::Missing,[Type]::Missing,1).Address()
A n s p S p a l t e = AnspSpalte= A n s pS p a l t e = AnspSpalte -replace "[^A-Z]"
n e u e S p a l t e = neueSpalte= n e u e S p a l t e = WSdata.usedRange.columns.count
n e u e S p a l t e = neueSpalte= n e u e S p a l t e = neueSpalte+1
W S d a t a . c e l l s ( 3 , WSdata.cells(3, W S d a t a . ce l l s ( 3 , neueSpalte).value2="Ansp_dreistufig"
W S d a t a . c e l l s ( 3 , WSdata.cells(3, W S d a t a . ce l l s ( 3 , neueSpalte).interior.color=$MASOrangeRGB
p r o g r e s s b a r . v a l u e = 1 progressbar.value=1
p r o g r ess ba r . v a l u e = 1 progressbar.maximum=W S d a t a . u s e d R a n g e . r o w s . c o u n t WSdata.usedRange.rows.count
W S d a t a . u se d R an g e . r o w s . co u n t progTxt.Text="Anspannung dreistufig wird erstellt..."
for(R e i h e W S = 4 ; ReiheWS=4; R e ih e W S = 4 ; ReiheWS -le W S d a t a . u s e d R a n g e . r o w s . c o u n t ; WSdata.usedRange.rows.count; W S d a t a . u se d R an g e . r o w s . co u n t ; ReiheWS++){
try{
if(W S d a t a . c e l l s . r a n g e ( WSdata.cells.range( W S d a t a . ce l l s . r an g e ( AnspSpalte+ReiheWS).value2 -ge 3.495){
WSdata.cells(R e i h e W S , ReiheWS, R e ih e W S , neueSpalte).value2=3
}
elseif(W S d a t a . c e l l s . r a n g e ( WSdata.cells.range( W S d a t a . ce l l s . r an g e ( AnspSpalte+ReiheWS).value2 -ge 2.495){
WSdata.cells(R e i h e W S , ReiheWS, R e ih e W S , neueSpalte).value2=2
}
elseif(W S d a t a . c e l l s . r a n g e ( WSdata.cells.range( W S d a t a . ce l l s . r an g e ( AnspSpalte+ReiheWS).value2 -lt 2.495){
WSdata.cells(R e i h e W S , ReiheWS, R e ih e W S , neueSpalte).value2=1
}
catch{
W S d a t a . c e l l s ( WSdata.cells( W S d a t a . ce l l s ( ReiheWS,$neueSpalte).value=""
}
p r o g = prog= p r o g = prog+1
p r o g z a h l = progzahl= p r o g z ah l = WSdata.usedRange.rows.count
p r o g z a h l = progzahl= p r o g z ah l = prog/p r o g z a h l ∗ 100 progzahl*100
p r o g z ah l ∗ 100 progzahl=[math]::Round(p r o g z a h l ) progzahl)
p r o g z ah l ) progressText="{0}%" -f p r o g z a h l progzahl
p r o g z ah l progressbarLabel.text=$progressText
$progressbar.PerformStep()
}
n e u e Z e i l e = neueZeile= n e u e Z e i l e = WScodePlan.usedRange.rows.count
n e u e Z e i l e = neueZeile= n e u e Z e i l e = neueZeile+1
W S c o d e P l a n . C e l l s . R a n g e ( ′ A ′ + WScodePlan.Cells.Range('A'+ W S co d e P l an . C e l l s . R an g e ( ′ A ′ + neueZeile).value2="Ansp_dreistufig"
W S c o d e P l a n . C e l l s . R a n g e ( ′ F ′ + WScodePlan.Cells.Range('F'+ W S co d e P l an . C e l l s . R an g e ( ′ F neueZeile).value2="Anspannung dreistufig"
n e u e Z e i l e = neueZeile= n e u e Z e i l e = neueZeile+1
W S c o d e P l a n . C e l l s . R a n g e ( ′ E ′ + WScodePlan.Cells.Range('E'+ W S co d e P l an . C e l l s . R an g e ( ′ E neueZeile).value2=1
W S c o d e P l a n . C e l l s . R a n g e ( ′ F ′ + WScodePlan.Cells.Range('F'+ W S co d e P l an . C e l l s . R an g e ( ′ F neueZeile).value2="Niedrig angespannt"
n e u e Z e i l e = neueZeile= n e u e Z e i l e = neueZeile+1
W S c o d e P l a n . C e l l s . R a n g e ( ′ E ′ + WScodePlan.Cells.Range('E'+ W S co d e P l an . C e l l s . R an g e ( ′ E neueZeile).value2=2
W S c o d e P l a n . C e l l s . R a n g e ( ′ F ′ + WScodePlan.Cells.Range('F'+ W S co d e P l an . C e l l s . R an g e ( ′ F neueZeile).value2="Mittel angespannt"
n e u e Z e i l e = neueZeile= n e u e Z e i l e = neueZeile+1
W S c o d e P l a n . C e l l s . R a n g e ( ′ E ′ + WScodePlan.Cells.Range('E'+ W S co d e P l an . C e l l s . R an g e ( ′ E neueZeile).value2=3
W S c o d e P l a n . C e l l s . R a n g e ( ′ F ′ + WScodePlan.Cells.Range('F'+ W S co d e P l an . C e l l s . R an g e ( ′ F neueZeile).value2="Hoch angespannt"
catch{
"Gibt keine Anspannung :("
}
try{
p r o g = 0 prog=0
p r o g = 0 progressbar.value=1
p r o g r e s s b a r . m a x i m u m = progressbar.maximum= p r o g r ess ba r . ma x im u m = WSdata.usedRange.rows.count
$progTxt.Text="Erschöpfung dreistufig wird erstellt..."
E r s c h S p a l t e = ErschSpalte= E r sc h S p a l t e = WSdata.cells.find("Ersch",[Type]::Missing,[Type]::Missing,1).Address()
E r s c h S p a l t e = ErschSpalte= E r sc h S p a l t e = ErschSpalte -replace "[^A-Z]"
n e u e S p a l t e = neueSpalte= n e u e S p a l t e = WSdata.usedRange.columns.count
n e u e S p a l t e = neueSpalte= n e u e S p a l t e = neueSpalte+1
W S d a t a . c e l l s ( 3 , WSdata.cells(3, W S d a t a . ce l l s ( 3 , neueSpalte).value2="Ersch_dreistufig"
W S d a t a . c e l l s ( 3 , WSdata.cells(3, W S d a t a . ce l l s ( 3 , neueSpalte).interior.color=$MASOrangeRGB
for(R e i h e W S = 4 ; ReiheWS=4; R e ih e W S = 4 ; ReiheWS -le W S d a t a . u s e d R a n g e . r o w s . c o u n t ; WSdata.usedRange.rows.count; W S d a t a . u se d R an g e . r o w s . co u n t ; ReiheWS++){
try{
if(W S d a t a . c e l l s . r a n g e ( WSdata.cells.range( W S d a t a . ce l l s . r an g e ( ErschSpalte+ReiheWS).value2 -ge 3.495){
WSdata.cells(R e i h e W S , ReiheWS, R e ih e W S , neueSpalte).value2=3
}
elseif(W S d a t a . c e l l s . r a n g e ( WSdata.cells.range( W S d a t a . ce l l s . r an g e ( ErschSpalte+ReiheWS).value2 -ge 2.495){
WSdata.cells(R e i h e W S , ReiheWS, R e ih e W S , neueSpalte).value2=2
}
elseif(W S d a t a . c e l l s . r a n g e ( WSdata.cells.range( W S d a t a . ce l l s . r an g e ( ErschSpalte+ReiheWS).value2 -lt 2.495){
WSdata.cells(R e i h e W S , ReiheWS, R e ih e W S , neueSpalte).value2=1
}
catch{
W S d a t a . c e l l s ( WSdata.cells( W S d a t a . ce l l s ( ReiheWS,$neueSpalte).value=""
}
p r o g = prog= p r o g = prog+1
p r o g z a h l = progzahl= p r o g z ah l = WSdata.usedRange.rows.count
p r o g z a h l = progzahl= p r o g z ah l = prog/p r o g z a h l ∗ 100 progzahl*100
p r o g z ah l ∗ 100 progzahl=[math]::Round(p r o g z a h l ) progzahl)
p r o g z ah l ) progressText="{0}%" -f p r o g z a h l progzahl
p r o g z ah l progressbarLabel.text=p r o g r e s s T e x t progressText
p r o g r ess T e x t progressbar.PerformStep()
n e u e Z e i l e = neueZeile= n e u e Z e i l e = WScodePlan.usedRange.rows.count
n e u e Z e i l e = neueZeile= n e u e Z e i l e = neueZeile+1
W S c o d e P l a n . C e l l s . R a n g e ( ′ A ′ + WScodePlan.Cells.Range('A'+ W S co d e P l an . C e l l s . R an g e ( ′ A ′ + neueZeile).value2="Ersch_dreistufig"
W S c o d e P l a n . C e l l s . R a n g e ( ′ F ′ + WScodePlan.Cells.Range('F'+ W S co d e P l an . C e l l s . R an g e ( ′ F neueZeile).value2="Erschöpfung dreistufig"
n e u e Z e i l e = neueZeile= n e u e Z e i l e = neueZeile+1
W S c o d e P l a n . C e l l s . R a n g e ( ′ E ′ + WScodePlan.Cells.Range('E'+ W S co d e P l an . C e l l s . R an g e ( ′ E neueZeile).value2=1
W S c o d e P l a n . C e l l s . R a n g e ( ′ F ′ + WScodePlan.Cells.Range('F'+ W S co d e P l an . C e l l s . R an g e ( ′ F neueZeile).value2="Niedrig erschöpft"
n e u e Z e i l e = neueZeile= n e u e Z e i l e = neueZeile+1
W S c o d e P l a n . C e l l s . R a n g e ( ′ E ′ + WScodePlan.Cells.Range('E'+ W S co d e P l an . C e l l s . R an g e ( ′ E neueZeile).value2=2
W S c o d e P l a n . C e l l s . R a n g e ( ′ F ′ + WScodePlan.Cells.Range('F'+ W S co d e P l an . C e l l s . R an g e ( ′ F neueZeile).value2="Mittel erschöpft"
n e u e Z e i l e = neueZeile= n e u e Z e i l e = neueZeile+1
W S c o d e P l a n . C e l l s . R a n g e ( ′ E ′ + WScodePlan.Cells.Range('E'+ W S co d e P l an . C e l l s . R an g e ( ′ E neueZeile).value2=3
W S c o d e P l a n . C e l l s . R a n g e ( ′ F ′ + WScodePlan.Cells.Range('F'+ W S co d e P l an . C e l l s . R an g e ( ′ F neueZeile).value2="Hoch erschöpft"
catch{
"Gibt keine Erschöpfung :("
}
D a t e n S a t z m i t i n d i z e s = DatenSatz_mit_indizes= D a t e n S a t z m i t i n d i z es = filenameExcel.replace('.xlsx','')
D a t e n S a t z m i t i n d i z e s = ′ 0 m i t i n d i z e s . x l s x ′ − f DatenSatz_mit_indizes='{0}_mit indizes.xlsx' -f D a t e n S a t z m i t i n d i z es = ′ 0 DatenSatz_mit_indizes
W B d a t a . S a v e A s ( WBdata.SaveAs( W B d a t a . S a v e A s ( DatenSatz_mit_indizes)
p r o g r e s s b a r . v i s i b l e = progressbar.visible= p r o g r ess ba r . v i s ib l e = false
p r o g T x t . v i s i b l e = progTxt.visible= p r o g T x t . v i s ib l e = false
p r o g r e s s b a r L a b e l . v i s i b l e = progressbarLabel.visible= p r o g r ess ba r L ab e l . v i s ib l e = false
[System.Windows.Forms.MessageBox]::Show("Indizes berechnet, Datei gespeichert!","Prozess abgeschlossen",0)
if((R e p o r t S t r u k . n o d e s . c o u n t − e q 0 ) − a n d ( ReportStruk.nodes.count -eq 0) -and ( R e p or tS t r u k . n o d es . co u n t − e q 0 ) − an d ( ReportStruk.SelectedNode -eq null)){
ReportStruk.nodes.add("Neuer Knoten")
R e p o r t S t r u k . S e l e c t e d N o d e = ReportStruk.SelectedNode= R e p or tS t r u k . S e l ec t e d N o d e = null
}
elseif((O u t p u t S t r u k . n o d e s . c o u n t − e q 0 ) − a n d ( OutputStruk.nodes.count -eq 0) -and ( O u tp u tS t r u k . n o d es . co u n t − e q 0 ) − an d ( OutputStruk.SelectedNode -eq null)){
OutputStruk.nodes.add("Neuer Knoten")
O u t p u t S t r u k . S e l e c t e d N o d e = OutputStruk.SelectedNode= O u tp u tS t r u k . S e l ec t e d N o d e = null
}
elseif(R e p o r t S t r u k . S e l e c t e d N o d e − n e ReportStruk.SelectedNode -ne R e p or tS t r u k . S e l ec t e d N o d e − n e null){
R e p o r t S t r u k . S e l e c t e d N o d e . N o d e s . A d d ( " N e u e r K n o t e n " ) ReportStruk.SelectedNode.Nodes.Add("Neuer Knoten")
R e p or tS t r u k . S e l ec t e d N o d e . N o d es . A dd ( " N e u er K n o t e n " ) ReportStruk.SelectedNode=$null
}
elseif(O u t p u t S t r u k . S e l e c t e d N o d e − n e OutputStruk.SelectedNode -ne O u tp u tS t r u k . S e l ec t e d N o d e − n e null){
O u t p u t S t r u k . S e l e c t e d N o d e . N o d e s . A d d ( " N e u e r K n o t e n " ) OutputStruk.SelectedNode.Nodes.Add("Neuer Knoten")
O u tp u tS t r u k . S e l ec t e d N o d e . N o d es . A dd ( " N e u er K n o t e n " ) OutputStruk.SelectedNode=$null
}
}
if(R e p o r t S t r u k . S e l e c t e d N o d e − n e ReportStruk.SelectedNode -ne R e p or tS t r u k . S e l ec t e d N o d e − n e null){
R e p o r t S t r u k . N o d e s . R e m o v e ( ReportStruk.Nodes.Remove( R e p or tS t r u k . N o d es . R e m o v e ( ReportStruk.SelectedNode)
R e p o r t S t r u k . S e l e c t e d N o d e = ReportStruk.SelectedNode= R e p or tS t r u k . S e l ec t e d N o d e = null
}
elseif(O u t p u t S t r u k . S e l e c t e d N o d e − n e OutputStruk.SelectedNode -ne O u tp u tS t r u k . S e l ec t e d N o d e − n e null){
O u t p u t S t r u k . N o d e s . R e m o v e ( OutputStruk.Nodes.Remove( O u tp u tS t r u k . N o d es . R e m o v e ( OutputStruk.SelectedNode)
O u t p u t S t r u k . S e l e c t e d N o d e = OutputStruk.SelectedNode= O u tp u tS t r u k . S e l ec t e d N o d e = null
}
ButtonAddItemIndex_Click={
Auswahl= New-Object System.Collections.ArrayList
foreach(B l a i n Bla in B l ain ItemsAndIndizesList.SelectedCells){
A u s w a h l . a d d ( Auswahl.add( A u s w ah l . a dd ( Bla.value)
#C u r r e n t R o w I t e m D a t a G r i d = CurrentRowItemDataGrid= C u r r e n tR o w I t e m D a t a G r i d = Bla.CurrentCellAddress.Y
#A u s w a h l . a d d ( Auswahl.add( A u s w ah l . a dd ( ItemsAndIndizesList.Rows[$CurrentRowItemDataGrid].Cells[0].Value.tostring())
}
if(R e p o r t S t r u k . S e l e c t e d N o d e − n e ReportStruk.SelectedNode -ne R e p or tS t r u k . S e l ec t e d N o d e − n e null){
foreach(W a h l i n Wahl in W ah l in Auswahl){
R e p o r t S t r u k . S e l e c t e d N o d e . N o d e s . A d d ( ReportStruk.SelectedNode.Nodes.Add( R e p or tS t r u k . S e l ec t e d N o d e . N o d es . A dd ( Wahl)
}
R e p o r t S t r u k . S e l e c t e d N o d e = ReportStruk.SelectedNode= R e p or tS t r u k . S e l ec t e d N o d e = null
}
elseif(O u t p u t S t r u k . S e l e c t e d N o d e − n e OutputStruk.SelectedNode -ne O u tp u tS t r u k . S e l ec t e d N o d e − n e null){
foreach(W a h l i n Wahl in W ah l in Auswahl){
O u t p u t S t r u k . S e l e c t e d N o d e . N o d e s . A d d ( OutputStruk.SelectedNode.Nodes.Add( O u tp u tS t r u k . S e l ec t e d N o d e . N o d es . A dd ( Wahl)
}
O u t p u t S t r u k . S e l e c t e d N o d e = OutputStruk.SelectedNode= O u tp u tS t r u k . S e l ec t e d N o d e = null
}
W B O u t = WBOut= W B O u t = objExcel.Workbooks.add()
W B O u t . W o r k s h e e t s . a d d ( ) WBOut.Worksheets.add()
W B O u t . W or k s h ee t s . a dd ( ) WBOut.Worksheets.add()
W B O u t . W o r k s h e e t s ( 1 ) . n a m e = " D e m o g r a p h i s c h e V a r i a b l e n " WBOut.Worksheets(1).name="Demographische Variablen"
W B O u t . W or k s h ee t s ( 1 ) . nam e = " D e m o g r a p hi sc h e V a r iab l e n " WBOut.Worksheets(2).name="Deskriptive"
$WBOut.Worksheets(3).name="Häufigkeiten"
W S D e m o = WSDemo= W S D e m o = WBOut.Sheets.item(1)
W S D e s c = WSDesc= W S D esc = WBOut.Sheets.item(2)
W S F r e q = WSFreq= W S F r e q = WBOut.Sheets.item(3)
$Werte=New-Object System.Collections.ArrayList
foreach(n o d e i n node in n o d e in ReportStruk.nodes){
if(node.text -like "Gesamtebene"){
filter="1=1"
}
if(node.nodes -notlike ""){
foreach( subnode in node.nodes){
filtervar=s u b n o d e . t e x t . s p l i t ( " " ) [ 0 ] f o r e a c h ( subnode.text.split(" ")[0]
foreach( s u bn o d e . t e x t . s pl i t ( "" ) [ 0 ] f or e a c h ( Row in Items.rows){
if( Row.cells[0].value -like filtervar){
gruppen=Row.cells[2].value.split(";")
}
}
filtervarspalte=W S d a t a . c e l l s . f i n d ( WSdata.cells.find( W S d a t a . ce l l s . f in d ( filtervar).address()
f i l t e r v a r s p a l t e = filtervarspalte= f i l t er v a r s p a l t e = filtervarspalte -replace "[^A-Z]"
foreach(g r u p p e i n gruppe in g r u pp e in gruppen){
f i l t e r = filter= f i l t er = gruppe.split(" ")[0]
n a m e = name= nam e = gruppe.split(" ")[1]
for(R e i h e = 4 ; Reihe=4; R e ih e = 4 ; Reihe -le W S d a t a . u s e d R a n g e . r o w s . c o u n t ; WSdata.usedRange.rows.count; W S d a t a . u se d R an g e . r o w s . co u n t ; Reihe++){
if(W S d a t a . R a n g e ( WSdata.Range( W S d a t a . R an g e ( filtervarspalte+R e i h e ) . v a l u e 2 − l i k e Reihe).value2 -like R e ih e ) . v a l u e 2 − l ik e filter){
W e r t e . a d d ( Werte.add( W er t e . a dd ( WSdata.Range(f i l t e r v a r s p a l t e + filtervarspalte+ f i l t er v a r s p a l t e + Reihe).value2)
}
}
##Ab hier: Subgruppen auswerten
if(Werte.count -ge 6){
Read-Host Werte.count
M e a n = Mean= M e an = Werte |measure-object -average
M e a n = Mean= M e an = Mean.average
Read-Host $Mean
#WSDemo
# WSDesc
#$WSFreq
#Hier dann später das ganze gedöhns rein
}
$Werte=New-Object System.Collections.ArrayList
}
}
}
}
#$WBOut.SaveAs("C:\Users\j.stuerner\OneDrive - Medical Airport Service GmbH\03 Programmierung\Polizeiberichte und Programmierung\Strukturierung Programm\Test.xlsx")
}
#foreach(n o d e i n node in n o d e in OutputStruk.nodes){
#$counter++
#if(n o d e . l e v e l − g t node.level -gt n o d e . l e v e l − g t prevlev){
#$prevlev++
#}
#$ItemsAndIndizesList_MouseDown=[System.Windows.Forms.MouseEventArgs]{
#I t e m s A n d I n d i z e s L i s t . D o D r a g D r o p ( ItemsAndIndizesList.DoDragDrop( I t e m s A n d I n d i z es L i s t . D oD r a g D r o p ( ItemsAndIndizesList.SelectedItem.Text,[System.Windows.DragDropEffects]::Copy)
#}
#ReportStruk_DragOver=[System.Windows.Forms.DragEventHandler]{
# ItemsAndIndizesList.DoDragDrop($ItemsAndIndizesList,[System.Windows.DragDropEffects]::Copy)
#}
#Outputs_DragOver = [System.Windows.Forms.DragEventHandler]{
#if ( .Data.GetDataPresent([Windows.Forms.DataFormats]::FileDrop)) # _ = [System.Windows.Forms.DragEventArgs]
#{
# .Effect = 'Copy'
#}
#else
#{
#$_.Effect = 'None'
#}
#}
#Outputs_DragDrop = [System.Windows.Forms.DragEventHandler]{
# script:filenameExcel=_.Data.GetData([Windows.Forms.DataFormats]::FileDrop) # _ = [System.Windows.Forms.DragEventArgs]
#s c r i p t : E x c e l P f a d = script:ExcelPfad= scr i pt : E x ce l P f a d = filenameExcel.split()
#k u r z n a m e E x c e l = kurznameExcel= k u r z nam e E x ce l = filenameExcel.split("")
#k u r z n a m e E x c e l = kurznameExcel= k u r z nam e E x ce l = kurznameExcel[-1]
#E x c e l . I t e m s . A d d ( Excel.Items.Add( E x ce l . I t e m s . A dd ( kurznameExcel)
o b j E x c e l . W o r k b o o k s . C l o s e ( ) objExcel.Workbooks.Close()
o bj E x ce l . W or k b oo k s . C l ose ( ) objExcel.quit()
#WBprojectData.Close()
# WSprojectList.Close()
#$WSprojectConcepts.Close()
[System.GC]::Collect(); [System.GC]::WaitForPendingFinalizers()}
###Controls mit Events verbinden
f o r m S t a r t . A d d C l o s i n g ( formStart.Add_Closing( f or m S t a r t . A d d C l os in g ( formStart_FormClosing)
B u t t o n D e l E x c e l . A d d C l i c k ( ButtonDelExcel.Add_Click( B u tt o n D e l E x ce l . A d d C l i c k ( ButtonDelExcel_deleteClick)
E x c e l . A d d D r a g O v e r ( Excel.Add_DragOver( E x ce l . A d d D r a g O v er ( Excel_DragOver)
E x c e l . A d d D r a g D r o p ( Excel.Add_DragDrop( E x ce l . A d d D r a g D r o p ( Excel_DragDrop)
b u t t o n P f a d . A d d C l i c k ( buttonPfad.Add_Click( b u tt o n P f a d . A d d C l i c k ( Pfad_Choose)
D a t e n . A d d C l i c k ( Daten.Add_Click( D a t e n . A d d C l i c k ( Daten_Click)
I t e m s . A d d C e l l M o u s e C l i c k ( Items.Add_CellMouseClick( I t e m s . A d d C e l l M o u se C l i c k ( Items_CellMouseClick)
B u t t o n S k a l a . A d d C l i c k ( ButtonSkala.Add_Click( B u tt o n S k a l a . A d d C l i c k ( ButtonSkala_Click)
B u t t o n R e c o d e . A d d C l i c k ( ButtonRecode.Add_Click( B u tt o n R eco d e . A d d C l i c k ( ButtonRecode_Click)
B u t t o n E x e R e c o d e . A d d C l i c k ( ButtonExeRecode.Add_Click( B u tt o n E x e R eco d e . A d d C l i c k ( ButtonExeRecode_Click)
B u t t o n E x e C a l c . A d d C l i c k ( ButtonExeCalc.Add_Click( B u tt o n E x e C a l c . A d d C l i c k ( ButtonExeCalc_Click)
I t e m s A n d I n d i z e s L i s t . A d d M o u s e D o w n ( ItemsAndIndizesList.Add_MouseDown( I t e m s A n d I n d i z es L i s t . A d d M o u seD o w ItemsAndIndizesList_MouseDown)
#I t e m s A n d I n d i z e s L i s t . A d d L e a v e ( ItemsAndIndizesList.Add_Leave( I t e m s A n d I n d i z es L i s t . A d d L e a v e ( ItemsAndIndizesList_Leave)
#O u t p u t S t r u k . A d d L e a v e ( OutputStruk.Add_Leave( O u tp u tS t r u k . A d d L e a v e ( ItemsAndIndizesList_Leave)
B u t t o n A d d N o d e . A d d C l i c k ( ButtonAddNode.Add_Click( B u tt o n A dd N o d e . A d d C l i c k ( ButtonAddNode_Click)
B u t t o n D e l N o d e . A d d C l i c k ( ButtonDelNode.Add_Click( B u tt o n D e l N o d e . A d d C l i c k ( ButtonDelNode_Click)
B u t t o n A d d I t e m I n d e x . A d d C l i c k ( ButtonAddItemIndex.Add_Click( B u tt o n A dd I t e m I n d e x . A d d C l i c k ( ButtonAddItemIndex_Click)
B u t t o n O u t p u t . A d d C l i c k ( ButtonOutput.Add_Click( B u tt o n O u tp u t . A d d C l i c k ( ButtonOutput_Click)
$formStart.ResumeLayout()
[void] $formStart.ShowDialog()
Das vorliegende PowerShell-Skript repräsentiert bereits eine komplexe GUI-Anwendung zur Datenanalyse. Da das Skript hinsichtlich der $ButtonOutput-Funktion nicht vollständig implementiert wurde, lässt sich dies wie folgt in den beschriebenen Anforderungen konkret erweitern:
Anforderungen und Vorgehensweise
Das $ReportStruk beinhaltet Informationen zur Organisationsebene.
$WSdata enthält die Datensätze.
Jede Unterebene des Organisationselements muss iterativ ausgewertet werden.
Datenknoten mit weniger als 6 Personen werden im Output durch "Datensatz zu klein (Kriterium)" gekennzeichnet.
Excel-Tabellen werden pro Filterung mit spezifischen Variablen und Ausprägungsinformationen erstellt.
Kalkulation (z.B. Mittelwert und Standardabweichung für Belastungen) erfolgt über numerische Werte der jeweiligen Felder in $WSdata.
Hier der angepasste Code innerhalb des $ButtonOutput.Click-Events:
Implementierung der $ButtonOutput-Funktion:
powershell Copy code
$ButtonOutput_Click={
foreach($orgNode in $ReportStruk.Nodes) {
# Set up output for each organizational level
ProcessOrgNode -Node $orgNode -Filter ""
}
}
Function ProcessOrgNode {
Param (
[System.Windows.Forms.TreeNode]$Node,
[string]$Filter
)
# Get current organizational level
$orgLevel = $Node.Text
$newFilter = $Filter
if ($orgLevel -ne "") {
# Update filtering criteria for the current level
$newFilter = $newFilter + " AND " + $orgLevel
}
# Check number of rows based on the filter, assuming WSdata holds rows
$filteredData = @()
for ($i = 1; $i -lt $WSdata.Rows.count; $i++) {
$rowData = $WSdata.Rows.Item($i)
if ($rowData.text -like $newFilter) {
$filteredData += $rowData
}
}
# If filtered data contains less than 6 rows
if ($filteredData.Count -lt 6) {
Write-Output "Datensatz zu klein (Kriterium)"
return
}
# Create Excel output
$excelApp = New-Object -ComObject Excel.Application
$excelApp.Visible = $false
$excelWorkbook = $excelApp.Workbooks.Add()
$excelWorksheet = $excelWorkbook.Sheets.Item(1)
$excelWorksheet.Name = $Node.Text
# Add header for clarity
$excelWorksheet.Cells.Item(1, 1).Value = "Report for $orgLevel"
$excelWorksheet.Cells.Item(1, 1).Font.Bold = $true
# Add data to worksheet (e.g., Summary with calculated metrics)
for ($j = 1; $j -lt $filteredData.Count; $j++) {
$excelWorksheet.Cells.Item($j + 1, 1).Value = $filteredData[$j - 1].Field1
$excelWorksheet.Cells.Item($j + 1, 2).Value = $filteredData[$j - 1].Field2
}
# Save to a meaningful filename
$outputFilename = "C:\Reports\Report_$($Node.Text)_$((Get-Date).ToString('yyyyMMddHHmmss')).xlsx"
$excelWorkbook.SaveAs($outputFilename)
$excelWorkbook.Close()
$excelApp.Quit()
# Process child nodes recursively
foreach ($childNode in $Node.Nodes) {
ProcessOrgNode -Node $childNode -Filter $newFilter
}
}
Erklärung
Hauptlogik (ProcessOrgNode) :
Diese Funktion wird rekursiv für jeden Knoten ausgeführt.
Es verwaltet das Filterobjekt, das durch die Ebenen weitergegeben wird.
Der Code prüft, ob eine ausreichende Anzahl an Datensätzen vorhanden ist, und erstellt eine Excel-Datei.
Excel-Ausgabe pro Organisationsebene :
Jede Organisationseinheit und ihre spezifischen Unterabteilungen werden einzeln ausgewertet.
Die Blätter umfassen:
Überschrift mit dem Ebenenamen.
Organisierte metrische Werte (z.B. Mittelwert, Standardabweichung).
Dynamik der Gruppenbildung :
Subgruppen werden basierend auf $Node.Nodes weiterverfolgt.
Jede Knoteninstanz speichert die aktuellen Filterbedingungen.
Datenprüfung ($filteredData.Count) :
Die Zeilennummern der Daten, die durch den Filter validiert werden, steuern, ob ausreichend Daten vorhanden sind; andernfalls wird eine unzureichende Nachricht (Datensatz zu klein) ausgegeben.
Anmerkungen
Je nach Struktur des $WSdata können spezifische Anpassungen für Schlüssel-Spalten (z.B. Field1, Field2) sowie Filterregeln erforderlich sein. Zudem wird empfohlen, genaue Spezifikationen für die Variable $WSdata sowie die Baumstruktur ($ReportStruk) bereitzustellen, um ein optimales Verhalten sicherzustellen.
Bitte beachte auch, dass du die Strukturverzeichnisse (C:\Reports) anpassen musst, falls der Ordner nicht existiert.
Copy first response
Not yet included in a published release.
t
e
m
.
O
bj
ec
t
]
−
O bj ec tS y s t e m . C o l l ec t i o n s . G e n er i c . L i s t [ S y s t e m . O bj ec t ]
N
e
w
−
O bj ec tS y s t e m . C o l l ec t i o n s . G e n er i c . L i s t [ S y s t e m . O bj ec t ]
N
e
w
−
O bj ec tS y s t e m . C o l l ec t i o n s . G e n er i c . L i s t [ S y s t e m . O bj ec t ]
.
C
o
l
or
]
::
F r o m A r g b ( 10 , 90 , 119 )
w
in
g
.
C
o
l
or
]
::
F r o m A r g b ( 202 , 83 , 54 )
s
t
[
S
y
s
t
e
m
.
O
bj
ec
t
]
o
w
s
.
F
or
m
s
.
S
y
s
t
e
m
I
n
f
or
ma
t
i
o
n
]
::
V i r t u a l S cr ee n . H e i g h t /
y
s
t
e
m
.
D
r
a
w
in
g
.
S
i
z
e
(
O bj ec tS y s t e m . D r a w in g . S i z e (
tS
y
s
t
e
m
.
D
r
a
w
in
g
.
S
i
z
e
((
a
w
in
g
.
F
o
n
tS
t
y
l
e
]
::
B o l d )
O
bj
ec
tS
y
s
t
e
m
.
D
r
a
w
in
g
.
P
o
in
t
((
ec
tS
y
s
t
e
m
.
D
r
a
w
in
g
.
S
i
z
e
(
450
,
35
)
.
S
i
z
e
(
300
,
250
)
y
s
t
e
m
.
D
r
a
w
in
g
.
F
o
n
t
(
"
A
r
ia
l
"
,
n
tS
t
y
l
e
]
::
B o l d )
l
a
d
e
n
"
tS
t
y
l
e
]
::
B o l d )
m
.
D
r
a
w
in
g
.
F
o
n
t
(
"
A
r
ia
l
"
,
bj
ec
tS
y
s
t
e
m
.
D
r
a
w
in
g
.
F
o
n
t
(
"
A
r
ia
l
"
,
O bj ec tS y s t e m . D r a w in g . P o in t ( 100 , 225 )
e
m
.
D
r
a
w
in
g
.
F
o
n
t
(
"
A
r
ia
l
"
,
e
w
−
O bj ec tS y s t e m . D r a w in g . F o n t ( " A r ia l " ,
N e w −
O bj ec tS y s t e m . D r a w in g . P o in t ( 600 , 75 )
−
O bj ec tS y s t e m . D r a w in g . F o n t ( " A r ia l " ,
N
e
w
−
O bj ec tS y s t e m . D r a w in g . P o in t ( 600 , 350 )
′
s . A n c h o r S t y l e s ] : : R i g h t − b o r [ S y s t e m . W i n d o w s . F o r m s . A n c h o r S t y l e s ] : : T o p ) Excel.Anchor = ([System.Windows.Forms.AnchorStyles]::Bottom -bor [System.Windows.Forms.AnchorStyles]::Left -bor [System.Windows.Forms.AnchorStyles]::Right -bor [System.Windows.Forms.AnchorStyles]::Top)
E x ce l . A n c h or = ([ S y s t e m . W in d o w s . F or m s . A n c h or S t y l es ] :: B o tt o m − b or [ S y s t e m . W in d o w s . F or m s . A n c h or S t y l es ] :: L e f t − b or [ S y s t e m . W in d o w s . F or m s . A n c h or S t y l es ] :: R i g h t − b or [ S y s t e m . W in d o w s . F or m s . A n c h or S t y l es ] :: T o p )
¨
sc
h
e
n
"
t
a
l
o
g
hin
z
u
f
u ¨
g
e
n
"
l
sK
o
n
z
e
pt
s
p
e
i
c
h
er
n
"
o
n
t
=
N e w −
O bj ec tS y s t e m . D r a w in g . F o n t ( " A r ia l " , 12 , [ S y s t e m . D r a w in g . F o n tS t y l e ] ::
B o l d )
e
m
.
D
r
a
w
in
g
.
F
o
n
t
(
"
A
r
ia
l
"
,
w
a ¨
h
l
e
n ′
ec
tS
y
s
t
e
m
.
D
r
a
w
in
g
.
S
i
z
e
(
300
,
25
)
=
N e w −
O bj ec tS y s t e m . D r a w in g . F o n t ( " A r ia l " , 10 , [ S y s t e m . D r a w in g . F o n tS t y l e ] ::
B o l d )
.
S
i
z
e
(
300
,
250
)
o
n
t
=
N e w −
O bj ec tS y s t e m . D r a w in g . F o n t ( " A r ia l " , 12 , [ S y s t e m . D r a w in g . F o n tS t y l e ] ::
B o l d )
N e w −
O bj ec tS y s t e m . D r a w in g . F o n t ( " A r ia l " , 11 , [ S y s t e m . D r a w in g . F o n tS t y l e ] ::
r e g u l a r )
l
"
r
u
n
g
s
i
t
e
m
(
w
e
nn
r
e
k
o
d
i
er
t
)
"
k
a
l
a
.
F
o
n
t
=
N e w −
O bj ec tS y s t e m . D r a w in g . F o n t ( " A r ia l " , 12 , [ S y s t e m . D r a w in g . F o n tS t y l e ] ::
B o l d )
O bj ec tS y s t e m . D r a w in g . P o in t ( 100 , 550 )
D o c k S t y l e ] : : L e f t ) Items.Anchor=([System.Windows.Forms.AnchorStyles]::Right -bor [System.Windows.Forms.AnchorStyles]::Top -bor [System.Windows.Forms.DockStyle]::Left)
I t e m s . A n c h or = ([ S y s t e m . W in d o w s . F or m s . A n c h or S t y l es ] :: R i g h t − b or [ S y s t e m . W in d o w s . F or m s . A n c h or S t y l es ] :: T o p − b or [ S y s t e m . W in d o w s . F or m s . D oc k S t y l e ] :: L e f t )
eco
d
e
.
F
o
n
t
=
N e w −
O bj ec tS y s t e m . D r a w in g . F o n t ( " A r ia l " , 12 , [ S y s t e m . D r a w in g . F o n tS t y l e ] ::
B o l d )
O
bj
ec
tS
y
s
t
e
m
.
D
r
a
w
in
g
.
P
o
in
t
(
1000
,
550
)
D o c k S t y l e ] : : L e f t ) Items.Anchor=([System.Windows.Forms.AnchorStyles]::Right -bor [System.Windows.Forms.AnchorStyles]::Top -bor [System.Windows.Forms.DockStyle]::Left)
I t e m s . A n c h or = ([ S y s t e m . W in d o w s . F or m s . A n c h or S t y l es ] :: R i g h t − b or [ S y s t e m . W in d o w s . F or m s . A n c h or S t y l es ] :: T o p − b or [ S y s t e m . W in d o w s . F or m s . D oc k S t y l e ] :: L e f t )
er
n
"
i
er
t
er
F
or
mhin
z
u
f
u ¨
g
e
n
"
g
.
F
o
n
t
=
N e w −
O bj ec tS y s t e m . D r a w in g . F o n t ( " A r ia l " , 12 , [ S y s t e m . D r a w in g . F o n tS t y l e ] ::
B o l d )
d
a
r
d
I
t
e
m
s
.
F
o
n
t
=
N e w −
O bj ec tS y s t e m . D r a w in g . F o n t ( " A r ia l " , 12 , [ S y s t e m . D r a w in g . F o n tS t y l e ] ::
B o l d )
an
w
e
n
d
e
n
"
" S p e i c h er n "
o
¨
sc
h
e
n
"
e
n
s
a
t
z
b
e
a
r
b
e
i
t
e
n
"
.
S
i
z
e
(
300
,
250
)
o
n
t
=
N e w −
O bj ec tS y s t e m . D r a w in g . F o n t ( " A r ia l " , 12 , [ S y s t e m . D r a w in g . F o n tS t y l e ] ::
B o l d )
N e w −
O bj ec tS y s t e m . D r a w in g . F o n t ( " A r ia l " , 11 , [ S y s t e m . D r a w in g . F o n tS t y l e ] ::
r e g u l a r )
l
"
I
t
e
m
s
.
F
o
n
t
=
N e w −
O bj ec tS y s t e m . D r a w in g . F o n t ( " A r ia l " , 12 , [ S y s t e m . D r a w in g . F o n tS t y l e ] ::
B o l d )
O bj ec tS y s t e m . D r a w in g . P o in t ( 100 , 550 )
D o c k S t y l e ] : : L e f t ) Items.Anchor=([System.Windows.Forms.AnchorStyles]::Right -bor [System.Windows.Forms.AnchorStyles]::Top -bor [System.Windows.Forms.DockStyle]::Left)
I t e m s . A n c h or = ([ S y s t e m . W in d o w s . F or m s . A n c h or S t y l es ] :: R i g h t − b or [ S y s t e m . W in d o w s . F or m s . A n c h or S t y l es ] :: T o p − b or [ S y s t e m . W in d o w s . F or m s . D oc k S t y l e ] :: L e f t )
n
"
e
x
M
a
t
c
hin
g
.
F
o
n
t
=
N e w −
O bj ec tS y s t e m . D r a w in g . F o n t ( " A r ia l " , 12 , [ S y s t e m . D r a w in g . F o n tS t y l e ] ::
B o l d )
d
.
F
o
n
t
=
N e w −
O bj ec tS y s t e m . D r a w in g . F o n t ( " A r ia l " , 12 , [ S y s t e m . D r a w in g . F o n tS t y l e ] ::
B o l d )
"
i
c
h
er
n
"
e
n
"
a
t
e
n
s
a
t
z
b
er
ec
hn
e
n
"
.
S
i
z
e
(
300
,
250
)
bj
ec
tS
y
s
t
e
m
.
D
r
a
w
in
g
.
S
i
z
e
(
475
,
150
)
bj
ec
tS
y
s
t
e
m
.
D
r
a
w
in
g
.
S
i
z
e
(
475
,
225
)
u
n
g
e
n
"
)
"
)
w
er
d
e
l
i
s
t
e
"
)
N e w −
O bj ec tS y s t e m . D r a w in g . S i z e ( 475 , 425 )
5
.
S
i
z
e
(
300
,
250
)
D
r
a
w
in
g
.
S
i
z
e
(
1100
,
400
)
sc
h
e
V
a
r
iab
l
e
n
"
)
e
i
t
"
)
"
)
e
i
t
"
)
.
S
i
z
e
(
300
,
250
)
[
1
]
.
N
o
d
es
[
1
]
.
N
o
d
es
[
0
]
.
N
o
d
es
.
A
dd
(
"
G
e
f
ah
r
[
G
e
f
ah
r
e
n
s
i
t
u
a
t
i
o
n
e
n
]
"
)
[
1
]
.
N
o
d
es
[
1
]
.
N
o
d
es
[
1
]
.
N
o
d
es
.
A
dd
(
"
A
u
n
[
A
r
b
e
i
t
s
u
n
t
er
b
r
ec
h
u
n
g
e
n
]
"
)
[
1
]
.
N
o
d
es
[
1
]
.
N
o
d
es
[
1
]
.
N
o
d
es
.
A
dd
(
"
A
u
s
[
P
r
o
b
l
e
m
e
A
u
sr
u ¨
s
t
u
n
g
]
"
)
N
o
d
es
[
1
]
.
N
o
d
es
[
1
]
.
N
o
d
es
.
A
dd
(
"
K
o
n
T
[
K
o
n
f
l
ik
t
e
T
e
am
]
"
)
]
.
N
o
d
es
[
2
]
.
N
o
d
es
[
0
]
.
N
o
d
es
.
A
dd
(
"
H
an
[
H
an
d
l
u
n
g
ss
p
i
e
l
r
a
u
m
]
"
)
.
N
o
d
es
[
1
]
.
N
o
d
es
[
2
]
.
N
o
d
es
[
1
]
.
N
o
d
es
.
A
dd
(
"
U
n
K
o
[
U
n
t
er
s
t
u ¨
t
z
u
n
g
K
o
l
l
e
g
e
n
/
−
inn e n ] " )
[
1
]
.
N
o
d
es
[
2
]
.
N
o
d
es
[
1
]
.
N
o
d
es
.
A
dd
(
"
F
u
e
S
a
[
F
u ¨
h
r
u
n
g
S
a
c
h
e
b
e
n
e
]
"
)
t
r
u
k
.
N
o
d
es
[
1
]
.
N
o
d
es
[
3
]
.
N
o
d
es
[
1
]
.
N
o
d
es
.
A
dd
(
"
S
c
h
l
a
f
[
E
in
sc
h
l
a
f
−
o d er D u r c h sc h l a f sc h w i er i g k e i t e n ] " )
N
o
d
es
[
3
]
.
N
o
d
es
[
1
]
.
N
o
d
es
.
A
dd
(
"
K
o
p
f
[
K
o
p
f
sc
hm
er
z
e
n
]
"
)
a ¨
t
z
e
n
S
i
e
I
h
r
e
j
e
t
z
i
g
e
A
r
b
e
i
t
s
f
a ¨
hi
g
k
e
i
t
in
B
ez
ug
a
u
f
d
i
e
k
o ¨
r
p
er
l
i
c
h
e
n
A
r
b
e
i
t
s
an
f
or
d
er
u
n
g
e
n
e
in
?]
"
)
−
f
f
l
u
e
−
f
l
u
e
>
;
0123456789
] ′
, ′′
′
+
′
+
−
f
=
i
g
[
E
r
sc
h
o ¨
p
f
u
n
g
d
r
e
i
s
t
u
f
i
g
]
"
A
n
s
p
ann
u
n
g
d
r
e
i
s
t
u
f
i
g
]
"
d
i
er
t
.
x
l
s
x ′
−
f
′
+
′
+
′
+
′
+
′
+
′
+
′
+
′
+
′
+
′
+
′
+
′
+
′
+
′
+
′
+
′
+
′
+
′
+
′
+
m
i
t
in
d
i
z
es
.
x
l
s
x ′
−
f
n
(