개정판 d469ad24
issue #1059: 공백 수정 및 Page에 해당되는 시트만 svg파일 추가
Change-Id: I67e541260a38d233bab51156a5e2694a49634379
HYTOS/HYTOS/MainWindow.py | ||
---|---|---|
2208 | 2208 |
save_file_name = file_name if ext.upper() == '.XLSX' else name_without_ext + '.xlsx' |
2209 | 2209 |
wb.save(filename=save_file_name) |
2210 | 2210 |
|
2211 |
input_svg_exe_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'ReportApp', |
|
2212 |
'ReportApp.exe') |
|
2213 |
blank_save_file_name = f'"{save_file_name}"' # Error : File or Directory used Black |
|
2211 |
report_app_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'ReportApp', |
|
2212 |
'ReportApp.exe') |
|
2214 | 2213 |
|
2215 |
svg_input_result = os.system(f"{input_svg_exe_path} {blank_save_file_name} {svg_path}") |
|
2214 |
# Error : File or Directory used Black |
|
2215 |
black_report_app_path = report_app_path.split(os.path.sep) |
|
2216 |
report_app_path = "" |
|
2217 |
for dir_name in black_report_app_path: |
|
2218 |
if dir_name.find(' ') != -1: # 공백이 없을 경우 -1 |
|
2219 |
dir_name = f'"{dir_name}"' |
|
2220 |
report_app_path += dir_name + '/' |
|
2221 |
report_app_path = report_app_path[:-1] |
|
2222 |
|
|
2223 |
blank_save_file_name = f'"{save_file_name}"' |
|
2224 |
svg_path = f'"{svg_path}"' |
|
2225 |
|
|
2226 |
svg_input_result = os.system(f"{report_app_path} {blank_save_file_name} {svg_path}") |
|
2216 | 2227 |
|
2217 | 2228 |
if svg_input_result == 1: |
2218 | 2229 |
os.startfile(save_file_name) |
2219 | 2230 |
# QMessageBox.information(self, self.tr('Information'), self.tr('Report is done')) |
2220 | 2231 |
elif svg_input_result == 0: |
2221 | 2232 |
QMessageBox.information(self, self.tr('Information'), |
2222 |
self.tr('Could not find excel file or svg file')) |
|
2233 |
self.tr(' Could not find excel file or svg file. ')) |
|
2234 |
if save_file_name is not None: |
|
2235 |
os.remove(save_file_name) |
|
2223 | 2236 |
except Exception as ex: |
2224 | 2237 |
message = f"error occurred({repr(ex)}) in {sys.exc_info()[-1].tb_frame.f_code.co_filename}:" \ |
2225 | 2238 |
f"{sys.exc_info()[-1].tb_lineno}" |
ReportApp/ReportApp/Program.cs | ||
---|---|---|
15 | 15 |
|
16 | 16 |
if (args[0] != null && args[1] != null && args.Count() == 2) |
17 | 17 |
{ |
18 |
string ExeclPath = args[0];
|
|
18 |
string ExcelPath = args[0];
|
|
19 | 19 |
string SvgPath = args[1].Replace("\\", "/"); |
20 | 20 |
|
21 |
var workbook = ExcelFile.Load(ExeclPath);
|
|
21 |
var workbook = ExcelFile.Load(ExcelPath);
|
|
22 | 22 |
|
23 | 23 |
foreach (var worksheet in workbook.Worksheets) |
24 |
{ |
|
25 |
worksheet.Pictures.Add(SvgPath, "A1", 1500, 990, LengthUnit.Pixel); |
|
24 |
{ |
|
25 |
if (worksheet.Name.Contains("Page")) |
|
26 |
{ |
|
27 |
worksheet.Pictures.Add(SvgPath, "A1", 1500, 990, LengthUnit.Pixel); |
|
28 |
} |
|
26 | 29 |
} |
27 |
workbook.Save(ExeclPath);
|
|
30 |
workbook.Save(ExcelPath);
|
|
28 | 31 |
return 1; |
29 | 32 |
} |
30 | 33 |
return 0; |
ReportApp/ReportApp/ReportApp.csproj | ||
---|---|---|
72 | 72 |
<None Include="packages.config" /> |
73 | 73 |
</ItemGroup> |
74 | 74 |
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
75 |
<PropertyGroup> |
|
76 |
<PreBuildEvent> |
|
77 |
</PreBuildEvent> |
|
78 |
</PropertyGroup> |
|
75 | 79 |
</Project> |
내보내기 Unified diff