Need a special offer?Find out if your project fits.
+

Trying to connect to a FDS from Blazor sample project

Answered
Nick Chernick asked on October 31, 2023

Hello,
I am currently evaluating flexmonster, using the sample blazor project provided. I have the project up and runnnnig, and I also have a Flex Data Server running (locally) with an index defined and pointed to an MS Sql Server database. I have not been able to successfully connect to the FDS from within the Blazor project. I have attempted to create a Report Object and set properties, but that has not seemed to work yet. Could you please point me in the right direction? Thank you.
Kind Regards,
Nick

3 answers

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster November 1, 2023

Hello Nick,

Thank you for contacting us.

Firstly, we recommend checking if the Data Server is accessible by opening the URL http://localhost:9500 in the browser. Are there any issues in the browser developer console or directly on the page? 
If the Data Server is accessible in the browser, kindly check the following guide to see how to configure the data source in the Flexmonster component: https://www.flexmonster.com/doc/getting-started-with-data-server/#step-2-configure-the-report.

Please let us know if it works for you. Looking forward to hearing from you.

Kind regards,
Nadia

Public
Nick Chernick November 1, 2023

Hello,
Thank you for the response. I have verified the Data Server is running and accessible. The issue I am having is specific to a Blazor integration. I have not been able to successfullly define/configure a report that utilizes the FDS as its data source.
Kind Regards,
Nick

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster November 2, 2023

Hello Nick,

Thank you for the response.

We are glad to hear that the Data Server is accessible. To initialize the report in the Blazor integration you can use, for example, the following code:

<FlexmonsterComponent Report=@report
                      Toolbar=true
                      Width="100%"
                      Height=600>
</FlexmonsterComponent>

@code {
    Report report = new Report();

    protected override void OnInitialized()
    {
        report.DataSource = new DataSource()
        {
            Type = "api",
            Url = "http://localhost:9500",
            Index = "sample-index"
        };

        base.OnInitialized();
    }
}

Please let us know if it works for you. Looking forward to hearing your feedback.

Kind regards,
Nadia

Please login or Register to Submit Answer