changing XML datasources with code

Stimulsoft Dashboards.WIN discussion
Post Reply
joris.wils
Posts: 11
Joined: Tue May 26, 2020 1:56 pm

changing XML datasources with code

Post by joris.wils »

Hi.
So I have webservice with 2 methods..
http://URL/ServerData.asmx/GetCPU
and
http://URL/ServerData.asmx/GetCPU2 (that takes a parameter)

I used the first one to create a stimulsoft dashboard.
In a C# app, I want to change the XML datasource to use the second method so that I can specify an extra filter.
I use the following code to change existing xml datasources so that I can add an adittional parameter to get data from a webservice

Code: Select all

            Stimulsoft.Report.StiReport report = new Stimulsoft.Report.StiReport();
            report.Load(@"Dashboard.mrt");
            report.RefreshTime = 30;

            Stimulsoft.Report.Dictionary.StiXmlDatabase test;
            foreach (StiDataTableSource table in report.Dictionary.DataSources)
            {
                string name = table.Name;
                test = (StiXmlDatabase)report.Dictionary.Databases[name];
                test.PathData = "http://URL/ServerData.asmx/" + name + "?loginID=" + sessionID;
                test.PathSchema = "http://URL/ServerData.asmx/" + name + "?loginID=" + sessionID;

            }
            report.RegReportDataSources();
            report.Render();

            stiDashboardViewerControl1.Report = report;
the XMLdata property gets updated just fine. I can also navigate to that URL directly with a browser and get data.
In the dashboard designer, I can click "view data" and can see the data just fine.
Exept the gauges that I use on the dashboard don't show any data. They show "no result".

Am I missing something? How can I get the gauges to update?
Lech Kulikowski
Posts: 6163
Joined: Tue Mar 20, 2018 5:34 am

Re: changing XML datasources with code

Post by Lech Kulikowski »

Hello,

Please send us your reprot with test data for analysis.

Thank you.
joris.wils
Posts: 11
Joined: Tue May 26, 2020 1:56 pm

Re: changing XML datasources with code

Post by joris.wils »

I'm sorry, it was a typo. Working now ;-)
Lech Kulikowski
Posts: 6163
Joined: Tue Mar 20, 2018 5:34 am

Re: changing XML datasources with code

Post by Lech Kulikowski »

Hello

Ok.
Please let us know if you need any additional help.

Thank you.
Post Reply