Package: reportingprint

PDF rendering and printing API for reports.

Examples

The following example creates a merged report as pdf.

workflow ActionDownloadConcatenatedReports;

function main(argument1 as int) as navigation {
    var result as navigation;
    result = this->reports(argument1);

    return result;
}

function atomic reports(argument1 as int) as navigation {
    var result as navigation;
    var arg as printkeyvalue;
    var listarg as list of printkeyvalue;
    var table = FETCH table (name) FILTER AND (key == ${argument1}) LIMIT 1 **;
    arg.key = "argument1";
    arg.value = argument1;
    listarg[] = arg;
    var xxa = reportingprint->createPdfWithArgsFromUUID("e5cb19be-9610-4021-bb29-c7137b29d0fc", "PDF", listarg, "Raport XXA.pdf");
    var xxb = reportingprint->createPdfWithArgsFromUUID("79dc04ec-3803-4b91-9cf9-dd90593cd865", "PDF", listarg, "Raport XXB.pdf");
    var xxc = reportingprint->createPdfWithArgsFromUUID("4cf078ec-2d5f-4767-8a90-04deb9e4619f", "PDF", listarg, "Raport XXC.pdf");
    var xxd = reportingprint->createPdfWithArgsFromUUID("67bc21fe-6156-499d-aee5-a1b29cd79a78", "PDF", listarg, "Raport XXD.pdf");

    var xxaPDF = pdf->open(xxa);
    var xxbPDF = pdf->open(xxb);
    var xxcPDF = pdf->open(xxc);
    var xxdPDF = pdf->open(xxd);
    var newPDF = pdf->merge(xxaPDF, xxbPDF);
    newPDF = pdf->merge(newPDF, xxcPDF);
    newPDF = pdf->merge(newPDF, xxdPDF);
    newPDF.fileName = "Concatinated reports - " + plan.denumire + ".pdf";
    var newPDFKey = pdf->save(newPDF);

    // delete generated files
    storage->delete(xxa);
    storage->delete(xxb);
    storage->delete(xxc);
    storage->delete(xxd);
    result.storageFileKey = newPDFKey;
    result.storageFileDownload = true;

    return result;
}

Methods

createPdfWithArgsFromKey

function createPdfWithArgsFromKey(reportKey as int, fileType as string, arguments as list of printkeyvalue, fileName as string) as int

Creates a new pdf from a report object, by using the keys of the report.

createPdfWithArgsFromUUID

function createPdfWithArgsFromUUID(reportUUID as int, fileType as string, arguments as list of printkeyvalue, fileName as string) as int

Creates a new pdf from a report object, by using the UUID of the report.

Types

printkeyvalue

type printkeyvalue {
    var key as string;
    var value as string;
}