How can I use the Flxemonster control to connect to a MS SQL database from an angular app

Answered
Nilesh Wagle asked on December 6, 2018

I am trying to embed the Flexmonster control in an angular 6.1 app. I was able to follow the steps provided in library article for "Integration with Angular" successfully to connect to an OLAP cube on my Microsoft Analysis Server. Now I want to use a SQL database as a source for the same but I cannot figure out how to. In the library article "Connecting to DB with .NET" the following code snippet is provided. I am not sure what I should be using for filename. Can someone please help?

var pivot = new Flexmonster({
	container: "pivotContainer",
	toolbar: true,
	report: {
		dataSource: {
			dataSourceType: "ocsv",
			/* URL to the Data Compressor .NET */
			filename: "http://localhost:55772/api/flexmonster/get"
		}
	},
	licenseKey: "XXXX-XXXX-XXXX-XXXX-XXXX"
});

Another question is do I need the Accelerator service to connect to a SQL DB or is it only for connecting to an Analysis Server (OLAP cube)?
 
Thanks.

8 answers

Public
Iryna Kulchytska Iryna Kulchytska Flexmonster December 6, 2018

Hi Nilesh,
 
Thank you for posting your question on our forum.
 
We are glad that the article “Integration with Angular” was helpful with embedding Flexmonster in your angular 6.1 app.
 
Regarding your questions, the Accelerator service is only to connect to an Analysis Server (OLAP cube). To connect to an SQL DB you can use Flexmonster Data Compressor. Here is the article that explains what Flexmonster Data Compressor is https://www.flexmonster.com/doc/connecting-to-relational-database/. Flexmonster Data Compressor is available for .NET, Java, PHP, and Node.js. The article “Connecting to DB with .NET” https://www.flexmonster.com/doc/connecting-to-relational-database-with-net/ describes how to use the Data Compressor in the .NET back-end to connect to an SQL DB and how to provide this connection to the front-end Flexmonster control. Answering your direct question, for filename from the code snippet you need to use the URL to your back-end script that uses the Data Compressor to connect to an SQL DB and returns a streaming response.
 
Please let me know if you have any questions.
 
Kind regards,
Iryna

Public
Nilesh Wagle May 19, 2022

Hello,
We used to use the Flexmonster compressor to connect to SQL server database and it has been working perfectly but now we are moving to Blazor and found out that the compressor has been deprecated. The suggestion is to use the Flexmonster Data Server, but I am not really sure how this will work for us. We have a product that gets deployed at client locations. The steps that you have for using Flexmonster Data Server seem like are for local use only. For example I have to download the flexmonster cli and install it locally and install the data server locally and set it up. We can't expect clients to do this. Is there a way to use the Flexmonster Data Server in such a way that it is seamless for clients? 
Thanks.
Nilesh 

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster May 20, 2022

Hello, Nilesh!
 
Thank you for contacting us.
 
We can suggest you two possible solutions for your case:

  1. Sending responses from the server as CSV/JSON files. 
    This approach is easy to implement and will save the performance the same as with Compressor.
  2. Using Flexmonster Data Server as DLL. 
    This approach is more complex and also more efficient for big data. You can include the DLL file in your project instead of using FDS as a standalone application. Please find more details about this approach in our guide: https://www.flexmonster.com/doc/getting-started-with-data-server-dll/.

 
Hope it helps. Feel free to ask if any further questions arise.
 
Regards,
Solomiia

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster June 2, 2022

Hello, Nilesh!

Hope you are having a great week.

Our team is wondering if you had some time to check out the suggested approaches. Could you please let us know if everything seems clear to you? Feel free to ask if you need any clarifications.

Looking forward to hearing from you.

Regards,
Solomiia

Public
Nilesh Wagle June 2, 2022

Hello Solomiia!!
It is a great coincidence that you messaged me about this when I was just trying to set this up and figure out how to configure the dataserver settings. From the examples that you have on your site it seems like the Flexmonster dataserver settings have to be configured at startup of the Blazor web service thru the app config. 
We want our Blazor service to connect to multiple databases depending on what the user chooses in the client application. So, I am not really sure how that will work. 
Do you have any suggestions?
Thanks.

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster June 3, 2022

Hello, Nilesh!
 
Thank you for your swift response. That's really a great coincidence.
 
Kindly note that Flexmonster Data Server, by design, was made for a predefined set of data sources. The feature of generating new indexes in the runtime is not supported out of the box, so we don't recommend using FDS this way.
 
We kindly suggest trying another approach mentioned in our previous answer and dynamically generating JSON/CSV files. This approach seems to us more suitable for your use case.
 
Looking forward to hearing from you.
 
Regards,
Solomiia

Public
Nilesh Wagle June 3, 2022

Thanks Solomiia,
I have tried using the CSV approach and that has worked. So I think we are okay for now.
 

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster June 6, 2022

Hello, Nilesh!

Thank you for your quick response.

We are glad to hear that our solution works for you.

You are welcome to contact us in case of any other questions.

Regards,
Solomiia

Please login or Register to Submit Answer