a few questions/comments about reports extension



    1. Can you use folders?

    The documentation says:

    { "options": { "reports": { "save": true, "blobName": "myfilename" } }

    Are paths supported??? i.e.

    { "options": { "reports": { "save": true, "blobName": "folder1/folder2/myfilename" } }

    where jsreport will create the folder hierarchy as needed - it seems otherwise everything is in the same folder, which might get to be a mess with tens or hundreds of thousands of files.

    1. Relatedly, is this scalable - are there people actually storing/serving a lot of files using this method?

    2. I have a bunch of legacy PDFs that were created by the system we used before jsreport, but i will still need to have somewhere and serve up for a period. Could i import them in using the odata api maybe or do i just copy the files over into the storage folder and jsreport will automatically pick them up - the documentation is kinda thin on this?

    3. In addition or in lieu of the current config file cleanup mechanism, it might be nice to come at it from the other way via the api, i.e.:

    { "options": { "reports": { "save": true, "blobName": "myfilename", "keepFor": "2 months" } } or something like that



  • Can you use folders?

    Yes, you can, with "allowLocalFilesAccess:true" in the config. It will create the full path you specify.

    Relatedly, is this scalable - are there people actually storing/serving a lot of files using this method?

    It should be, let us know if you experience problems.
    However, you should consider using a full database instead of the file system for such data volume
    https://jsreport.net/learn/template-stores

    I have a bunch of legacy PDFs that were created by the system we used before jsreport, but i will still need to have somewhere and serve up for a period. Could i import them in using the odata api maybe or do i just copy the files over into the storage folder and jsreport will automatically pick them up - the documentation is kinda thin on this?

    The report consists of Report entity and blob. You can create a Report entity using OData POST and create the respective file representing the blob.

    This is how the Report entity looks like

    {
          "name": "main",
          "creationDate": "2021-10-16T15:34:48.360Z",
          "modificationDate": "2021-10-16T15:34:48.377Z",
          "shortid": "ZAXTmgE",
          "_id": "mzwMGlnxAFwlICPv",
          "recipe": "docx",
          "fileExtension": "docx",
          "templateShortid": "I2t_EIx7A",
          "contentType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
          "public": false,
          "blobName": "folder1/folder2/myfilename.docx",
          "state": "success"
        }
    

    You could POST such json to OData to create Reports, and then create files in blobName path representing the blobs,

    In addition or in lieu of the current config file cleanup mechanism, it might be nice to come at it from the other way via the API

    Thank you for the idea. I submitted the request to the backlog, you can subscribe here
    https://github.com/jsreport/jsreport/issues/825


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.