As we know, our world is constantly evolving, and new technologies emerge almost every day. Nowadays, it is no longer necessary to set up the entire infrastructure in one's office, hire personnel to monitor equipment, and deal with issues that arise with this equipment and other difficulties.
Nowadays, more and more services offer business cloud solutions, for example, FastReport Cloud. Our service saves the development team from unnecessary work; you no longer need to think about how to deploy the project, where it would be best and most profitable to rent or buy servers, and what technologies to use for deployment. We have already settled all this, and all you need to do is take advantage of it.
How to use FastReport Cloud?
In this article, we will look at how to create reports in FastReport Cloud using SDK and export them to any convenient format.
First, let's create a project and add the FastReport.Cloud.SDK.Web nuget package to it. Thanks to this package, we will conveniently communicate with FastReport Cloud without an API.
We will also need a report template. This example will use Box.frx from our Demo:
After creating the project and adding all the necessary dependencies to it, you can move on to analyzing the example.
At the very beginning, you need to create an API key in the FastReport Cloud workspace; to do this, follow the link https://fastreport.cloud.
Click on the tab with API keys and create a new one. If the key already exists, then you can copy it by right-clicking on it and selecting an action from the drop-down list.
After receiving the API key, we return to our application. We write the key into a separate variable as in the example below:
Next, we need to create the main objects that we will use in the program:
After this, we move on to the stage of creating a report for the cloud. You can do it like this:
In the example above, we already have a report in byte format. If you have a file in frx format, then you can use this example:
We upload the TemplateCreateVM object along with the report into our FastReport.Cloud workspace:
Now we export the report to the format we need. First, you need to decide on the format and name of the future file.
We export to PDF format:
We finished the main part of the work with the report. We received a pdf file from our report:
If you want to download the file manually, then go to your workspace and download it as in the following example:
You can also download the file with the SDK using this example:
Now you know how to create, export, and download files in FastReport Cloud using the SDK. You can find the example from this article at this link: https://github.com/FastReports/FastReport-Cloud.