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.

Report From a Class

Hi,
i use Syncfusion for my new projects but i m  having a little hard time dealing with the report.
i used to store the data that we will put on the report in a class.

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>

    

when i used the PREVIEW in the Report Designer. 
I receive an error when trying to preview the report; it states "Collection class or datatable Input is needed".

thank

5 Replies

VS Vinoth Srinivasan Syncfusion Team May 5, 2017 02:00 PM UTC

Hi Gregory, 
 
Thanks for contacting Syncfusion Support. 

The pop up is used to get details of the Dataset object at first execution of the report in Report Designer. If the saved report definition has dataset info, then the selected items are shown in the pop up, by default. Report Designer supports dynamically change method, class, and the namespace of the business object, so the pop up shows up with all default selection items. Once the report has been saved with dataset info then the dataset info code will be generated in the report definition. Please refer to the below attached screenshot for the saved dataset information.
 
 
 
However, you can edit the report definition of the report in code behind and you can insert the above highlighted code. Please refer the following KB for editing the report in code behind. 
 
Also, we have prepared a sample for your reference and it can be downloaded from the following location. 
 
Regards, 
Vinoth S. 



GT Gregory Tissier May 10, 2017 06:41 AM UTC

hi,thanks for help my report works if i used ReportViewer.but in reportdesigner preview i receive an error when trying to preview the report; it states "Collection class or datatable Input is needed".i have get same error message in sample i found on this forum.


AS Anandakumar S Syncfusion Team May 11, 2017 11:45 AM UTC

Hi Gregory, 

In ReportDesigner preview i receive an error when trying to preview the report; it states "Collection class or datatable Input is needed 
The mentioned message shows when the data collection not returned for the DatasetInfo configuration provided in the report, it can be due to the classes not added to the sample or namespace changes. Add the class to report designer sample with same namespace, which is created in report viewer application to run the report, also you need to add the executing assembly in “Assemblies” collection as shown in below code. 
ReportDesignerControl.Assemblies.Add(Assembly.GetExecutingAssembly()); 

If you still face the problem then share your runnable sample with us to validate and provide the solution.  
i have get same error message in sample i found on this forum 
The shared application in this forum renders the report without any errors, refer to the below link for output snap. 

Can you update the Syncfusion.ReportDesigner.WPF.dll assembly version used in your application? 
 
Regards, 
Anandakumar S 



GT Gregory Tissier May 16, 2017 05:50 AM UTC

hi,
I join sample " error when trying to preview the report; it states "Collection class or datatable Input is needed".
thank for help


Attachment: Test_Design_a27de700.zip


VS Vinoth Srinivasan Syncfusion Team May 22, 2017 11:56 AM UTC

Hi Gregory, 
 
We have validated the provided sample and you have to used property instead of methods to return values to report. We have modified the “GetData” method instead of “Data” to retrieve the data for the report, also while accessing the data using “GetData” method, it returns null value instead of data. We have modified your sample based on this and it can be downloaded from the following location. 
 
Regards, 
Vinoth S. 


Loader.
Live Chat Icon For mobile
Up arrow icon