We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Starting in 2019, the Reporting control is no longer included in Essential Studio. If you're experiencing issues with the Syncfusion Reporting Platform, Report Viewer, Report Designer, or Report Writer, we recommend migrating to Bold Reports, our dedicated reporting platform.

Bold Reports offers a comprehensive suite of tools and features for all your reporting needs, and we will help you make a smooth transition from the discontinued control. Our support team at https://support.boldreports.com/ is here to assist you with any questions or difficulties you may encounter during the migration process.

We thank you for choosing Syncfusion and appreciate your understanding.

Syncfusion Report From a Class

Hello ,

Our Software Company is trying to use Syncfusion for our new projects but we are  having a little hard time dealing with the report.
We used to store the data that we will put on the report in a class. is there a way to retrive directly our data from class to reportviewer?
and do you have some tutorials about reporting.

Best Regards,
Lorenz


11 Replies

SM Sundaraj Muthunarayanan Syncfusion Team November 11, 2015 03:41 PM UTC

Hi Lorenz,

Thanks for contacting syncfusion support.

We have prepared a rdlc sample based on your requirement and the same can be downloaded from the following location.

Sample Location:

http://www.syncfusion.com/downloads/support/forum/121107/JS_Sample1327211552.zip

Also, We are having an online ug documentation for Report Viewer and We would like to suggest you to refer the below link for more details.

UG Documentation:

http://help.syncfusion.com/js/reportviewer/overview

Please let us know, If you have any concerns,

Regards,
Sundaraj M


LO Lorenz November 12, 2015 05:59 AM UTC

Thanks for the fast reply but this post is supposed to be in WPF Forum.
We have the data put on a "List" then send to a "class" then we need the data in the class to show in a report?


MJ Mariya Joseph M Syncfusion Team November 12, 2015 07:18 AM UTC

Hi Lorenz,

We have prepared a sample to use business object datasource in WPF ReportViewer and it can be downloaded from the following location.
http://www.syncfusion.com/downloads/support/forum/121107/COMPAN~1778319596.ZIP

Refer to the below online UG documentation for more details about ReportViewer.
http://help.syncfusion.com/wpf/reportviewer/getting-started

Regards,
Mariya joseph M.


SJ SJ November 30, 2015 02:09 PM UTC

Hello, I was looking at this example and it is similar to a project I am working on, with one additional question.

How could this way of using a ViewModel be used with the Report Designer adding the DataSource and DataSet at runtime?

I have found one example that added a DLL at runtime but requires the user to pick the Namespace, class, and method via a popup. This will not work.  
I must be able to set it all at runtime like this example.

Thank you for any help.

Scott. 


SR Soundara Rajan S Syncfusion Team December 4, 2015 12:47 PM UTC

Hi Scott,

Query
Response
Report Designer adding the DataSource and DataSet at runtime?
We have prepared a sample to load data from class model at runtime for RDLC report , it can be downloaded from the below location.
http://www.syncfusion.com/downloads/support/forum/121107/PREVIE~12032816006.ZIP

I have found one example that added a DLL at runtime but requires the user to pick the Namespace, class, and method via a popup
The selection pop up will be displayed to get the details of the business object at first execution of the report in Report Designer and it’s not required once saved.

If above given details are not same as your requirement then please share more details about your requirement.

Regards,
Soundara Rajan S.


SJ SJ December 4, 2015 01:13 PM UTC

Thank you for the sample.  However, it is not exactly what I need. 

2 Questions.

1.  How do I create this part in the code, so the user does not have to pick in the popup?

      <rd:DataSetInfo>
        <rd:DataSetName>Sales Dashboard</rd:DataSetName>
        <rd:ObjectDataSourceSelectMethod>GetData</rd:ObjectDataSourceSelectMethod>
        <rd:ObjectDataSourceSelectMethodSignature>System.Collections.IList GetData()</rd:ObjectDataSourceSelectMethodSignature>
        <rd:ObjectDataSourceType>CompanySalesDemo.AdventureWorks, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</rd:ObjectDataSourceType>
        <rd:TableName>AdventureWorks</rd:TableName>
      </rd:DataSetInfo>

2.  I have looked at the source, but do not see a way to stop the "Data Set Properties" Popup even when the above information is set.  How do I stop the popup from showing at all?
     The popup will confuse my users - I need to eliminate any need for the popup.

Thank you,

Scott.



SR Soundara Rajan S Syncfusion Team December 7, 2015 12:23 PM UTC

Hi Scott,


Query
Response
1.  How do I create this part in the code, so the user does not have to pick in the popup?

      <rd:DataSetInfo>
        <rd:DataSetName>Sales Dashboard</rd:DataSetName>
        <rd:ObjectDataSourceSelectMethod>GetData</rd:ObjectDataSourceSelectMethod>
        <rd:ObjectDataSourceSelectMethodSignature>System.Collections.IList GetData()</rd:ObjectDataSourceSelectMethodSignature>
        <rd:ObjectDataSourceType>CompanySalesDemo.AdventureWorks, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</rd:ObjectDataSourceType>
        <rd:TableName>AdventureWorks</rd:TableName>
      </rd:DataSetInfo>
We can achieve to add/update business object information for DataSet by modifying the ReportDefinition in code behind as shown in below code snippet,

            var reportDef = new Syncfusion.RDL.DOM.ReportDefinition();

            using (FileStream stream = new FileStream(filePath, FileMode.Open))

            {

                reportDef = LoadReport(stream);

            }


            var _assemblies = from t in Assembly.GetExecutingAssembly().GetTypes()

                              where t.Name == "AdventureWorks"

                              select t;

            var _methodInfo = _assemblies.First().GetMethod("GetData", (BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static));


            reportDef.DataSets[0].DataSetInfo = new Syncfusion.RDL.DOM.DataSetInfo();

            reportDef.DataSets[0].DataSetInfo.TableName = "AdventureWorks";

            reportDef.DataSets[0].DataSetInfo.DataSetName = reportDef.DataSets[0].Name;

            reportDef.DataSets[0].DataSetInfo.ObjectDataSourceSelectMethod = _methodInfo.Name;

            reportDef.DataSets[0].DataSetInfo.ObjectDataSourceSelectMethodSignature = _methodInfo.ToString();

            reportDef.DataSets[0].DataSetInfo.ObjectDataSourceType = _assemblies.First().AssemblyQualifiedName;


            this.SaveSerialize(new System.IO.FileInfo(@"../../ReportTemplate/BusinessDataCopy.rdlc").FullName, reportDef);


For your reference, we have prepared a sample based on this and it can be downloaded from below location,
http://www.syncfusion.com/downloads/support/forum/121107/ze/DataSetRDCL-1061236428.zip

By using this, we can avoid to select the DataSet information while run the RDLC Report.
2.  I have looked at the source, but do not see a way to stop the "Data Set Properties" Popup even when the above information is set.  How do I stop the popup from showing at all?
     The popup will confuse my users - I need to eliminate any need for the popup.

Regards,
Soundara Rajan S.


SJ SJ December 7, 2015 12:45 PM UTC

Thank you, however I tried this sample and the popup still popped up and when trying to preview the report it stated "Collection class or datatable Input is needed"

Was this the right sample, that was attached?


MJ Mariya Joseph M Syncfusion Team December 8, 2015 12:53 PM UTC

Hi Scott,

Report Designer RDLC mode used to dynamically change method, class and the namespace of the business object. You can view object collection to Report Viewer in Local processing mode to render your report. Please refer to the below sample for the same.
http://www.syncfusion.com/downloads/support/directtrac/147964/COMPAN~22027826989.ZIP

Regards,
Mariya Jospeh M.


SJ SJ December 10, 2015 07:50 PM UTC

I understand how to stop the popup with the Report Viewer. 

However, I need to stop the popup after dynamically adding the dataset so the user does not have to pick the namespace, class or method when using the PREVIEW in the Report Designer. 
I want to set those in the code and not show the user the popup.

Trying the previous sample, I receive an error when trying to preview the report; it states "Collection class or datatable Input is needed".

I have a license for the source code - is there a way for me to stop the popup by changing the code if there is no other way?  Perhaps, a switch to show it or not in the app.config?

Thank you for any help.


MJ Mariya Joseph M Syncfusion Team December 11, 2015 02:54 PM UTC

Hi Scott,

A support incident to track the status of reported query has been created under your account. Please log on to our support website to check for further updates
https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

Regards,
Mariya joseph M.

Loader.
Live Chat Icon For mobile
Up arrow icon