Skip to content

Commit

Permalink
feat: added print option in Reports
Browse files Browse the repository at this point in the history
  • Loading branch information
AbleKSaju committed Jan 14, 2025
1 parent e60ec6b commit 2da76f2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/pages/PrintView/ReportPrintView.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<template>
<div class="flex flex-col w-full h-full">
<PageHeader :title="t`Print ${title}`">
<Button class="text-xs" type="primary" @click="savePDF">
<Button class="text-xs" type="primary" @click="savePDF()">
{{ t`Save as PDF` }}
</Button>
<Button class="text-xs" type="primary" @click="savePDF('print')">
{{ t`Print` }}
</Button>
</PageHeader>

<div
Expand Down Expand Up @@ -278,7 +281,7 @@ export default defineComponent({
this.scale = Math.min(containerWidth / width, 1);
},
async savePDF(): Promise<void> {
async savePDF(action: 'print'): Promise<void> {
// @ts-ignore
const innerHTML = this.$refs.scaledContainer.$el.children[0].innerHTML;
if (typeof innerHTML !== 'string') {
Expand All @@ -290,7 +293,8 @@ export default defineComponent({
name,
innerHTML,
this.size.width,
this.size.height
this.size.height,
action ?? 'save'
);
this.fyo.telemetry.log(Verb.Printed, this.report!.reportName);
Expand Down

0 comments on commit 2da76f2

Please sign in to comment.