How to transfer a microservice from Node to WPF with C#

Posted by: lucas.barbosa on 9 May 2024, 11:47 pm EST

    • Post Options:
    • Link

    Posted 9 May 2024, 11:47 pm EST

    Hey, everybody! I hope things are great with you. I’ll give you some extra details, because I don’t know which part would be important for my question.

    I have a node microservice that has a headless puppeteer that exports a pdf via active reports, and then on my active report function I basically have a .setLicenseKey, .registerFonts, .PageReport, then I load this page report, then I run it and finally export it as a report binary. Then, using express, I use parsers, encoders, and listen on a specific port. I make a post request to an endpoint and call the active report function that I mentioned above.

    The json in the body looks like this:

    {

    id: ‘182asasiexample’,

    definition: {

    Name: ‘test’,

    Page: {

    Columns: 1,

    PageWidth: ‘3.5in’,

    TopMargin: ‘0in’,

    LeftMargin: ‘0in’,

    PageHeight: ‘5.5in’,

    RightMargin: ‘0in’,

    BottomMargin: ‘0in’,

    ColumnSpacing: ‘0.5in’

    },

    Width: ‘3.5in’,

    Author: ‘email@email’,

    Layers: [ [Object] ],

    DataSets: [ [Object] ],

    FixedPage: { Pages: [Array], DataSetName: ‘Customer’ },

    DataSources: [ [Object] ],

    EmbeddedImages: [ [Object] ],

    CustomProperties: [ [Object], [Object], [Object] ]

    },

    displayName: ‘Test’,

    fontsDescriptors:

    }

    So, this pdf is generated based on the json received (and some configuration/custom fields that changes for every client).

    Now the most important part:

    I’m having a lot of trouble transferring this node code to an WPF application, to make it easier to run locally. I’ve researched the documentation but in all of the active report projects in visual studio (active reports asp.net, active reports winforms, etc), there are some things/configurations that are not present in the node/js version, such as a .rdlx file, for example, which I have absolutely no idea what to do with, since I’ll be passing a json via http. Does anybody have a video or an example of making such change?

  • Posted 13 May 2024, 4:17 pm EST

    Hi Lucas,

    Currently what you are working with is ActiveReportsJS. ActiveReportsJS is a reporting solution for visualizing data in front-end applications. It is a JavaScript based reporting tool.

    For .Net applications we offer ActiveReports.Net. It is a reporting solution for designing and delivering reports using report designers and controls for .NET platform. Reports designed with ActiveReports.Net are saved in a XML format with the .RDLX extension.

    It is not possible to use ActiveReportsJS based JSON reports with ActiveReports.Net. I would suggest you to use ActiveReports.Net instead. Or you may create an electron application to support a Node server in a Desktop application.

    Please refer to the following links:

    P.S. For future reference, for Queries related to ActiveReports please post them over the following forums:

    Regards,

    Akshay

  • Posted 22 May 2024, 1:57 am EST

    Thank you very much for clarifying and I’m sorry for posting on the wrong place!

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels