cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
monikaprakash_1
Frequent Visitor

Pdf generate using htmltext control and collection

HI

 

I have a collection contain 100 rows. I want to generate pdf file for each row with corresponding data.

 

I am able to create 100 pdf using forall operations. but  I cant filter the pdf data.. means. I added my collection as a items of a gallery and in htmltext control I used the gallery.allitems but I am not getting the correct rows.. 100 row is repeating in each time..

And also I tried collecting each row in a new collection and use that collection in html text but again correct rows is not generating 1 row is repeating all time.

I want to create  pdf for each row and pdf  data need generate based on each row.

 

I have only 1 button click for all actions.

 

My button click

 

 

Set(
CurrentBrandBriefIdForSPC,
ThisItem.BrandBriefId
);
Set(
CurrentScenarioIdForSPC,
ThisItem.ScenarioId
);
ClearCollect(
pdfDataloop,
Filter(
view_Generate_Price_Communication,
BrandBriefId = CurrentBrandBriefIdForSPC && ScenarioId = CurrentScenarioIdForSPC
)
);

ForAll(
pdfDataloop,
RemoveIf(
pdfimage,
true
);
RemoveIf(
pdfData,
true
);
Collect(
pdfData,
{
BrandBriefId: pdfDataloop[@BrandBriefId],
System_Effective: pdfDataloop[@System_Effective],
Material_Code: pdfDataloop[@Material_Code]
}
);
If(
SourceCompany = "AE17",
Collect(
pdfimage,
{image: varImage17}
),
SourceCompany = "AE18",
Collect(
pdfimage,
{image: varImage18}
),
Collect(
pdfimage,
{image: varImage10}
)
);
'pdfGenerateSave-2'.Run(
VPCPdf.HtmlText,
"Report" & Now(),
"****",
"****"
);

);

 

 

 

my htmltext

 

 

"<!doctype html>
<html>
<head>
<meta charset=UTF-8>
<meta name=viewport content=width=device-width, initial-scale=1.0>
</head>
<body style='padding: 0; margin: 0;'>

<table align=center style='font-family: Arial, Helvetica, sans-serif; font-size:13px; width: 100%; max-width:800px;'>
<tr align=center>
<td style='padding: 0;'><img src="& varImage &" alt=header width=400 height=130></td>
</tr>
<tr>
<td style='padding-top: 30px;' align=left valign=top>
<table cellspacing=0 cellpading=0 width=100%>
<tr>
<td width=30 align=left valign=top style='padding-right:30px;'>To:</td>
<td align=left valign=top style='line-height: 22px;'>
Naico<br>
</td>
<td width=30 align=left valign=top style='padding-right:30px;'>CC:</td>
<td align=left valign=top style='line-height: 22px;'>
Naico2<br>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style='padding-top: 30px;' align=left valign=top>
<table cellspacing=0 cellpading=0 width=100%>
<tr>
<td width=100 align=left valign=top style='padding-right:20px;'>OUR REF:</td>
<td align=left valign=top width=60% style='line-height: 22px;'>"
& OurRef &
"</td>
<td width=50 align=left valign=top style='padding-right:30px;'>Date:</td>
<td align=left valign=top style='line-height: 22px;'>"
& Today() &
"</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style='padding:30px 0 0 0;'>Please note the price of the below material/s for your reference.</td>
</tr>
<tr>
<td style='padding: 30px 0;'>
<table cellspacing=0 cellpading=0 width=97% style='margin-left:10px; border: 1px solid #000; border-bottom:0;'>
<tr>

<td align=left valign=top style='padding: 5px; border-bottom:1px solid #000; border-right:1px solid #000;'>System Effective Date (dd/mmyy)</td>
<td align=left valign=top style='padding: 5px; border-bottom:1px solid #000; border-right:1px solid #000;'>Material Code</td>
</tr>
" & Concat(
pdfData,
"<tr>
<td style='padding: 5px; border-bottom:1px solid #000; border-right:1px solid #000;'>" & System_Effective & " </td>
<td style='padding: 5px; border-bottom:1px solid #000; border-right:1px solid #000;'>" & Material_Code & " </td>
</tr>"
) & "
</table>
</td>
</tr>
</table>
</body>
</html>"

 

 

 

and also my pdf not generating the bottom border also.. 

 

How can I generate the correct data in each pdf and how can I solve the bottom border issue?

 

 

 

 

 

0 REPLIES 0

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Users online (3,216)