Multiple records print with button
Hi,
Is there a way to print multiple pages (records) in a button ?
For one page, it already works with this :
let myPdf := printRecord(this, "name");
Actually, I can already do it with the print button in ninox and then select the "all" function but I would like to do it in a button.
Thanks a lot.
Lorenz
33 replies
-
Please find an example of printing in the attached database. See the ViewEvent table.
Lots of news on this page:
- The customer list is retrieved from the 'Customer list' field. This means that the print button takes into account the filter and the order of the list.
- The download button asks for the name of the file before downloading it.
- and, of course, the print button allows you to print multiple records on the same report.
-
,
I've found a solution to make the printAndSaveMutiRecord function work again:"---------------------------- printAndSaveMutiRecord -----------------------------"; function printAndSaveMutiRecord(strNids : text,reportName : text) do var n := split(replace(strNids, " ", ""), ","); #{:text:callback var config = { nid: n[0], nids: n, reportName: reportName, printAllAndClose: !0 }; var old = database.printRich; database.printRich = (e, t) => { old.call(database, e, (err, result) => { callback(database.loadFileURL(result.id, e.name, "application/pdf", !0)); }) database.printRich = old } schemas.schemas.envConfig.openDesigner(database, config); }#; end;
-
Hello,
I notice a bug when exporting with the printAndSaveMutiRecord() function. There is a shift in the content that I can't explain.
The code I entered in the button :
let filterStart := 'Début du filtre'; let filterEnd := 'Fin du filtre'; let nameDoc := "Factures.pdf"; let filter := (select Transactions where date('Date de facturation') >= filterStart and date('Date de facturation') <= filterEnd); var urlFile := printAndSaveMutiRecord(concat(filter.string(ID)), "facture_local"); downloadURL(urlFile, nameDoc); importFile(this, urlFile, nameDoc); removeFile(this, nameDoc)
A screenshot of the first page :
A screenshot of the 6th page :
We can clearly see that a blank space is created as I scroll through the pages of the generated PDF.
I guess the problem comes from the printAndSaveMutiRecord() function because when I do the same export with importFile(this, printAndSaveRecord(this, "facture_local"), nomFacture)) there is no offset.
Any idea?
Content aside
- 10 days agoLast active
- 33Replies
- 3176Views
-
5
Following