0

Code funktioniert plötzlich nicht mehr

Ich habe aus einer Tabelle Daten zu exportieren und in eine PDF zu schreiben die als Einsatzreport dann ausgedruckt wird. Dazu hatte ich eine Routine geschrieben die dezidiert einen bestimmten Zeitbereich (immer vom 21 des vorherigen Monats bis 20 des aktuellen Monats, Startperiode und Endperiode haben das Datum), abbildet und in einer Tabelle in die PDF schreibt. Hat bisher wunderbar funktioiert. Plötzlich funktioniert das nicht mehr und ich kann nicht herausfinden woran das liegt:

hier der Code

let heute := today();
let start := date(if month(heute) = 1 then year(heute) - 1 else year(heute) end, if month(heute) = 1 then 12 else month(heute) - 1 end, 21);
let ende := date(year(heute), month(heute), 20);
this.(Startperiode := start);
this.(Endperiode := ende);
alert("Zeitraum gesetzt und Report erzeugt: " + format(this.Startperiode, "DD.MM.YYYY") +
" bis " +
format(this.Endperiode, "DD.MM.YYYY"));
let myFileName := ClientNameFull + "_Report_" + "_for_" + 'For the Month of' + "_issued_" +
    format(if 'issued date' then 'issued date' else today() end, "YYYY-MM-DD") +
    "_" +
    ".pdf";
importFile(this, printAndSaveRecord(this, "Report"), myFileName);
CreportPDF := myFileName;
BerechnetBis := today();
printRecord(this, "CreportPDF") 

Hat jemand eine Ahnung? Wenn es noch mehr Info braucht, einfach fragen. Ich wäre sehr glücklich über eine Lösung

3 Antworten

null
    • Ninox Partner
    • RoSoft_Steven_Rooryck
    • gestern
    • Gemeldet - anzeigen

    Does your filename have special characters? Ninox is having issues with accents or other characters in filenames...

      • geschäftsführer
      • Talent_Solution_mk
      • vor 15 Stunden
      • Gemeldet - anzeigen

       there is no special characters at all, i wrot the Code new and sudently it works again. Here is the new Code:

      let dt := today();
      let m := month(dt);
      let y := year(dt);
      let start := date(if m = 1 then y - 1 else y end, if m = 1 then 12 else m - 1 end, 21);
      let ende := date(y, m, 20);
      let einsaetze := (select Shiftlist where 'Date-of-Shift' >= start and 'Date-of-Shift' <= ende);
      alert("Report für den aktuellen Kunden erstellt: " + einsaetze);
      let pdf := printAndSaveRecord(this, "Report", einsaetze);
      let myFileName := ClientNameFull + "_Report_" + format(dt, "YYYY-MM-DD") + ".pdf";
      importFile(this, pdf, myFileName);
      ReportPDF := myFileName;
      BerechnetBis := dt

      but i cant write the Report into a textfield again.

    • Ninox Partner
    • RoSoft_Steven_Rooryck
    • vor 10 Stunden
    • Gemeldet - anzeigen
     said:
    but i cant write the Report into a textfield again.

     Your code saves the pdf in the attachments tab? You can use a formula field to show this pdf: last(files(this))

    You can write a pdf in an image-field, not in a textfield.

Content aside

  • vor 10 StundenZuletzt aktiv
  • 3Antworten
  • 30Ansichten
  • 2 Folge bereits