Intergrate Stimulsoft with Silverlight WCF solution

Stimulsoft Reports.Silverlight discussion
Locked
thabotharshan
Posts: 1
Joined: Tue Jun 28, 2016 1:04 pm

Intergrate Stimulsoft with Silverlight WCF solution

Post by thabotharshan »

Hi

I am evaluating stimulsoft reports with our silverlight solution.I am using trial version of Stimulsoft-Reports-Silverlight-2015.3. I cannot see that documentation itself is much useful in terms of silverlight. I have implemented the solution according to the WCF sample given here

https://www.stimulsoft.com/en/news/wcf- ... ew-version

Following are the flow of the my report designer

1) Reading a dummy template from server via wcf and return it as byte array
2) Trying to preview the data in the preview button.I am trying to achieve it via WCFService_WCFRenderReport event . I am using following helper method given in the sample to set the report xml with data set .

Code: Select all

    public static string RenderReport(string xml, DataSet previewDataSet)
        {
            string result = null;
            if (!string.IsNullOrEmpty(xml))
            {
                var report = new StiReport();
                report.LoadFromString(StiSLEncodingHelper.DecodeString(xml));

                if (previewDataSet != null)
                    report.RegData(previewDataSet.DataSetName, previewDataSet);

                if (!report.IsRendered)
                {
                    try
                    {
                        report.Compile();
                    }
                    catch
                    {
                    }

                    if (report.CompilerResults.Errors.Count > 0)
                        return StiSLRenderingReportHelper.GetErrorListXml(report);
                }

                bool error = false;
                try
                {
                    report.Render(false);
                }
                catch
                {
                    error = true;
                }

                if (!error)
                    result = StiSLRenderingReportHelper.CheckReportOnInteractions(report, true);
            }

            return result;
        }
Problem is ,it is not rendering relevant data .I guess it is because i haven't registered the data dictionary properly (when i load the template of the report).

1) How i can i register data dictionary to show it as a data source in the designer.? If i am able to do that ,then i can design the template according to the dictionary structure.
2) How can i register a Jason object as a data dictionary in code? and how can i populate the relevant data ? Can is use above helper class implementation to populate the data for the report which is created based on the Jason data dictionary ?

Regards
Thabo
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Intergrate Stimulsoft with Silverlight WCF solution

Post by HighAley »

Hello, Thabo.

1. Please, look at the SaveWindow.xaml.cs file in WCF_SLDesigner project.

You should either register the business object on constructor with RegBusinessObject() method or if there is structure of the business object on the server, you could load the method, which will retrieve the report from server. There you will populate it with data (json, businessObject, datasource) and you will see the structure in the Designer.

2. What do you mean under Jason? If it's JSON, then use the way with the server that is described above.

Also if you use data on the server you should connect it before report rendering.
We have a simple sample how to use XML data. You could based on it and add support of your data source.

Please, look at the next method:
public string RenderingInteractions(string xml)

It calls InvokePreviewDataSet(); to get data.

Thank you.
Locked