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.
Unfortunately, activation email could not send to your email. Please try again.

Report From a Class

Thread ID:

Created:

Updated:

Platform:

Replies:

130281 May 4,2017 02:33 AM May 22,2017 07:56 AM WPF 5
loading
Tags: ReportDesigner
Gregory Tissier
Asked On May 4, 2017 02:33 AM

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

Vinoth Srinivasan [Syncfusion]
Replied On May 5, 2017 10:00 AM

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. 


Gregory Tissier
Replied On May 10, 2017 02:41 AM

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.

Anandakumar S [Syncfusion]
Replied On May 11, 2017 07:45 AM

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 


Gregory Tissier
Replied On May 16, 2017 01:50 AM

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

Vinoth Srinivasan [Syncfusion]
Replied On May 22, 2017 07:56 AM

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. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;