Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sterlite_custom_reports
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
suryakant
sterlite_custom_reports
Commits
0c4f8863
Commit
0c4f8863
authored
Oct 19, 2023
by
suryakant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ACP Custom Report Changes
parent
975dc483
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
273 additions
and
217 deletions
+273
-217
scripts/core/handler/event_handler.py
scripts/core/handler/event_handler.py
+26
-7
scripts/template/acp_report_template.py
scripts/template/acp_report_template.py
+247
-210
No files found.
scripts/core/handler/event_handler.py
View file @
0c4f8863
...
@@ -196,6 +196,7 @@ class CustomReportHandler:
...
@@ -196,6 +196,7 @@ class CustomReportHandler:
column_counter
=
0
column_counter
=
0
previous_category_cols
=
0
previous_category_cols
=
0
header_flag
=
False
header_flag
=
False
color_json
=
dict
()
logger
.
info
(
"Iterating through each block to create a dataframe"
)
logger
.
info
(
"Iterating through each block to create a dataframe"
)
# Iterate through the categories and concatenate their data
# Iterate through the categories and concatenate their data
...
@@ -221,6 +222,13 @@ class CustomReportHandler:
...
@@ -221,6 +222,13 @@ class CustomReportHandler:
column_counter
+=
shape
[
1
]
column_counter
+=
shape
[
1
]
previous_category_cols
=
column_counter
previous_category_cols
=
column_counter
# Checking if color in addition section
if
"addition"
in
category_data
and
"column_color"
in
category_data
[
"addition"
]:
color_json
.
update
(
category_data
[
"addition"
][
"column_color"
]
)
if
header_flag
:
if
header_flag
:
start_row
+=
1
start_row
+=
1
...
@@ -238,17 +246,28 @@ class CustomReportHandler:
...
@@ -238,17 +246,28 @@ class CustomReportHandler:
# Generating merged header for each dataframe
# Generating merged header for each dataframe
for
merge_index
,
border_value
in
border_json
.
items
():
for
merge_index
,
border_value
in
border_json
.
items
():
# (Start Rows, Start Column, End Row, End Column, Title, Format)
if
border_value
and
border_value
in
color_json
:
merge_style_format
=
copy
.
deepcopy
(
header_merge_format
)
merge_style_format
[
"fg_color"
]
=
color_json
[
border_value
]
worksheet
.
merge_range
(
*
merge_index
,
border_value
,
workbook
.
add_format
(
merge_style_format
))
else
:
worksheet
.
merge_range
(
*
merge_index
,
border_value
,
worksheet
.
merge_range
(
*
merge_index
,
border_value
,
workbook
.
add_format
(
header_merge_format
))
workbook
.
add_format
(
header_merge_format
))
# Write the column headers with the defined format.
# Write the column headers with the defined format.
for
col_index
,
value
in
enumerate
(
result_df
.
columns
.
values
):
for
col_index
,
value
in
enumerate
(
result_df
.
columns
.
values
):
if
value
:
if
value
:
if
color_json
and
value
in
color_json
:
style_format
=
copy
.
deepcopy
(
column_merge_format
)
style_format
[
"fg_color"
]
=
color_json
[
value
]
worksheet
.
write
(
worksheet
.
write
(
start_row
,
col_index
,
value
,
start_row
,
col_index
,
value
,
workbook
.
add_format
(
column_merge_format
)
workbook
.
add_format
(
style_format
))
)
else
:
worksheet
.
write
(
start_row
,
col_index
,
value
,
workbook
.
add_format
(
column_merge_format
))
else
:
else
:
worksheet
.
write
(
worksheet
.
write
(
start_row
,
col_index
,
value
,
start_row
,
col_index
,
value
,
...
...
scripts/template/acp_report_template.py
View file @
0c4f8863
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment