profile letter
This commit is contained in:
parent
558c53d4d3
commit
116f8171ef
|
@ -3630,8 +3630,9 @@ namespace HRM.Report
|
||||||
file.ReplaceWords(sFilePath, table);
|
file.ReplaceWords(sFilePath, table);
|
||||||
|
|
||||||
file.CloseWordApplication();
|
file.CloseWordApplication();
|
||||||
pdfFilePath = System.IO.Path.ChangeExtension(sFilePath, ".pdf");
|
//pdfFilePath = System.IO.Path.ChangeExtension(sFilePath, ".pdf");
|
||||||
ConvertDocToPdf(sFilePath, pdfFilePath);
|
//ConvertDocToPdf(sFilePath, pdfFilePath);
|
||||||
|
pdfFilePath = sFilePath;
|
||||||
|
|
||||||
}
|
}
|
||||||
return pdfFilePath;
|
return pdfFilePath;
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
<div class="p-col-3">
|
<div class="p-col-3">
|
||||||
<kendo-dropdownlist [(ngModel)]="selectedreportType" [data]="reportTypes" [textField]="'text'"
|
<kendo-dropdownlist [(ngModel)]="selectedreportType" [data]="reportTypes" [textField]="'text'"
|
||||||
[valueField]="'value'" [defaultItem]="{ text: 'Select Report Type..', value: null }"
|
[valueField]="'value'" [defaultItem]="{ text: 'Select Report Type..', value: null }"
|
||||||
style="width:100%;">
|
style="width:100%;" (valueChange)="onSelectReport($event)">
|
||||||
</kendo-dropdownlist>
|
</kendo-dropdownlist>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="p-col-3" align="middle">
|
<!-- <div class="p-col-3" align="middle">
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
</div> -->
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="p-col-12" align="right">
|
<div class="p-col-12" align="right">
|
||||||
<button kendoButton icon="file-pdf" [primary]="true" (click)="preview('PDF')">Preview</button>
|
<button kendoButton icon="file-pdf" [primary]="true" (click)="preview('PDF')" *ngIf="isViewable">Preview</button>
|
||||||
<button kendoButton icon="download" [primary]="true" style="margin-left:5px;"
|
<button kendoButton icon="download" [primary]="true" style="margin-left:5px;"
|
||||||
(click)="preview('Download')">Download</button>
|
(click)="preview('Download')">Download</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -57,6 +57,7 @@ export class EmployeeProfileReportsComponent implements OnInit {
|
||||||
public showPopUp: boolean = false;
|
public showPopUp: boolean = false;
|
||||||
public src: any;
|
public src: any;
|
||||||
public PDFTitle = '';
|
public PDFTitle = '';
|
||||||
|
public isViewable: boolean = true;
|
||||||
|
|
||||||
public selectedreportType: EnumProfileReportType;
|
public selectedreportType: EnumProfileReportType;
|
||||||
public reportTypes = Object.keys(EnumProfileReportType)
|
public reportTypes = Object.keys(EnumProfileReportType)
|
||||||
|
@ -83,6 +84,7 @@ export class EmployeeProfileReportsComponent implements OnInit {
|
||||||
public router: Router, public loadingPanel: loadingPanelService,
|
public router: Router, public loadingPanel: loadingPanelService,
|
||||||
public notificationService: HRMNotificationService,
|
public notificationService: HRMNotificationService,
|
||||||
public apiService: ApiService, public authService: AuthService) {
|
public apiService: ApiService, public authService: AuthService) {
|
||||||
|
this.apiService.selectedMenuName = 'Profile Reports';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,9 +159,17 @@ export class EmployeeProfileReportsComponent implements OnInit {
|
||||||
if (reportType == 'PDF') {
|
if (reportType == 'PDF') {
|
||||||
var element = <HTMLIFrameElement>(document.getElementById("pdf-viewer-report"));
|
var element = <HTMLIFrameElement>(document.getElementById("pdf-viewer-report"));
|
||||||
element.src = URL.createObjectURL(new Blob([fileData], { type: 'application/pdf' }));
|
element.src = URL.createObjectURL(new Blob([fileData], { type: 'application/pdf' }));
|
||||||
|
|
||||||
|
// Doc
|
||||||
|
// var element = <HTMLIFrameElement>document.getElementById("pdf-viewer-report");
|
||||||
|
// const fileUrl = URL.createObjectURL(new Blob([fileData], { type: 'application/msword' }));
|
||||||
|
|
||||||
|
// // Using Google Docs Viewer
|
||||||
|
// element.src = `https://docs.google.com/gview?url=${encodeURIComponent(fileUrl)}&embedded=true`;
|
||||||
}
|
}
|
||||||
if (reportType == 'Download')
|
if (reportType == 'Download')
|
||||||
this.downloadBlob(new Blob([fileData], { type: 'application/pdf' }), 'application/pdf', this.PDFTitle);
|
this.downloadBlob(new Blob([fileData], { type: 'application/msword' }), 'application/msword', this.PDFTitle);
|
||||||
|
// this.downloadBlob(new Blob([fileData], { type: 'application/pdf' }), 'application/pdf', this.PDFTitle);
|
||||||
|
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
|
@ -242,7 +252,16 @@ export class EmployeeProfileReportsComponent implements OnInit {
|
||||||
// }
|
// }
|
||||||
// );
|
// );
|
||||||
}
|
}
|
||||||
|
onSelectReport(value: any) {
|
||||||
|
debugger;
|
||||||
|
if (this.selectedreportType['value'] != EnumProfileReportType.Appointment_Letter_Staff && this.selectedreportType['value'] != EnumProfileReportType.Appointment_Letter_Worker) {
|
||||||
|
this.isViewable = true;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this.isViewable = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum EnumProfileReportType {
|
export enum EnumProfileReportType {
|
||||||
|
|
|
@ -1812,15 +1812,16 @@ namespace HRM.UI.Controllers.Report
|
||||||
byte[] buffer = new byte[16 * 1024];
|
byte[] buffer = new byte[16 * 1024];
|
||||||
buffer = System.IO.File.ReadAllBytes(sFilePath);
|
buffer = System.IO.File.ReadAllBytes(sFilePath);
|
||||||
string contentType = GetFileType(sFilePath);
|
string contentType = GetFileType(sFilePath);
|
||||||
var name = System.IO.Path.ChangeExtension(lFileName, ".pdf");
|
//var name = System.IO.Path.ChangeExtension(lFileName, ".pdf");
|
||||||
|
var name = lFileName;
|
||||||
if (System.IO.File.Exists(sFilePath))
|
if (System.IO.File.Exists(sFilePath))
|
||||||
{
|
{
|
||||||
System.IO.File.Delete(sFilePath);
|
System.IO.File.Delete(sFilePath);
|
||||||
}
|
}
|
||||||
if (System.IO.File.Exists(System.IO.Path.ChangeExtension(sFilePath, ".doc")))
|
//if (System.IO.File.Exists(System.IO.Path.ChangeExtension(sFilePath, ".doc")))
|
||||||
{
|
//{
|
||||||
System.IO.File.Delete(System.IO.Path.ChangeExtension(sFilePath, ".doc"));
|
// System.IO.File.Delete(System.IO.Path.ChangeExtension(sFilePath, ".doc"));
|
||||||
}
|
//}
|
||||||
return File(buffer, contentType, name);
|
return File(buffer, contentType, name);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|
|
@ -1172,6 +1172,18 @@
|
||||||
<TypeScriptCompile Remove="ClientApp\src\app\_models\Recruitement\InterviewAssessmentKpi.ts" />
|
<TypeScriptCompile Remove="ClientApp\src\app\_models\Recruitement\InterviewAssessmentKpi.ts" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<COMReference Include="Microsoft.Office.Interop.Word">
|
||||||
|
<WrapperTool>tlbimp</WrapperTool>
|
||||||
|
<VersionMinor>7</VersionMinor>
|
||||||
|
<VersionMajor>8</VersionMajor>
|
||||||
|
<Guid>00020905-0000-0000-c000-000000000046</Guid>
|
||||||
|
<Lcid>0</Lcid>
|
||||||
|
<Isolated>false</Isolated>
|
||||||
|
<EmbedInteropTypes>true</EmbedInteropTypes>
|
||||||
|
</COMReference>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="appsettings.json" />
|
<EmbeddedResource Include="appsettings.json" />
|
||||||
<EmbeddedResource Include="RDLC\CandidateAssesmentDetails.rdlc" />
|
<EmbeddedResource Include="RDLC\CandidateAssesmentDetails.rdlc" />
|
||||||
|
|
Loading…
Reference in New Issue
Block a user