Print PDF: Only Certain Conditions

Hi,

I have a Job table (1)

One of the Jobs is Site Inspection (2)

(2) is referenced to (1) through a Job ID

I created a print PDF function for (1), whereby all the related Site Inspections are printed in a table.

My question:

Usually, all of the Site Inspections are being printed. Say these inspections have 2 status: (a) Accessible and (b) Not Accessible: How can I only include Non Accessible ones only in the PDF? 

Thank you.

0 4 143
4 REPLIES 4

In the template for your PDF file, you probably have a START expression that includes the list of Site Inspections to include. Maybe it's simply [Related Site Inspections]. Modify that expression to return the reduced list of Site Inspections. For example:

SELECT(Site Inspections[Site Inspection ID], AND([Job ID] = [_THISROW].[Job ID], [Status] = "Not Accessible"))

Thank you dbaum.

How can I utilise this for the user to be able to Select what to print in the PDF?

Like, the user select Not Accessible at the UX or something, then press Print, and it produces the desired PDF.

Instead of me putting a fixed a formula in thr PDF format.

It's common to include columns in a Users table for the purpose of capturing values currently selected by each individual user for purposes like filtering a dashboard view, a slice, or a report. If you don't have that already, your starting point is probably @MultiTech's Current User System. Another option would be to use a User Setting. Once you have the value captured somewhere, substitute "Not Accessible" in the expression I drafted with a function that returns the captured value.

A third idea that I use to impletent a lot is a table that a children of the main table where you have your report and serves just as a way to filter some stuff before generating the report.

This would be called like SendJob and have similar columns as your Job one but you can even add an email, cc, bcc, subject, etc on this one.
Then the automation is done listening to adds on this new table where your user would be able to select criteria that will be on the report before it's generated.


For example, let's say you have an Expenses table where there are these columns:
[Employee], [Date] and [Amount].

So you have a detail view for a particular employee where you can see on an inline view all of his expenses. But let's say you want to generate a report with just some expenses on it based on a minimum amount or a date range, then I'd do it by having another table called SendExpense or ExpenseReport with the following:
[Employee], [MinDate], [MaxDate], [MinAmount] and [MaxAmount].

A row is added using a Linktoform() action (on the Employee table/view) so that you don't show an inline view for this table as is not really needed in most cases.
Then you can select the date range or min/max amount and then just save the row, and your automation would be based on this new table.
Also, I'd add a List column (virtual) with a FILTER() expression doing all the filtering and this will serve two purposes:
Your users will be able to see the data that's going to be included inside the report since an inline view will be shown inside the form and.
You can just reference this list column on your Start: expression, the filtering was already done in the app.

Btw, if you don't need the inline on form stuff, you could just ignore it and go with an EnumList basetype Ref (real column) and you will be able to generate the report with the same convenience but with better performance because you won't need a virtual column filtering stuff on each sync.

Hope you get the idea

Top Labels in this Space