This is a migrated thread and some comments may be shown as answers.

Report with a dynamic (runtime) object datasource

4 Answers 1370 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chris Trina
Top achievements
Rank 1
Chris Trina asked on 08 Jul 2014, 08:17 PM
I'm trying to create a report where the data only exists at runtime.  Currently our system calculates this data and returns it as a datatable.  From what I have read, it seems like I can, at runtime assign this table as the datasouce for a report with a a datasource of ObjectDataSource.

Unfortunately I'm striking out.   Here is my code for a simple test

​ 'perform the projections - this calls a routine that returns the desired table in odt2
oUtilities.PerformSingleProjection(CInt(SSG.Common.WebUtil.GetQueryStringValue("courseID")), CInt(SSG.Common.WebUtil.GetQueryStringValue("scheduleID")), odt, odt2, bOngoingUnitsExist, bSuccessfulProjections)

' Creating and configuring the ObjectDataSource component:
Dim objectDataSource As New Telerik.Reporting.ObjectDataSource()
Dim report As New BYOC.ReportLib.ProjectionDetails_KCG
objectDataSource.DataSource = odt2
report.DataSource = objectDataSource
instanceReportSource.ReportDocument = report

​ReportViewer1.ReportSource = instanceReportSource
ReportViewer1.RefreshReport()

On the report my only logic is that the Datasource property is set to ObjectDataSource1 (with no configurations on the objectdatasource) and I have one text field set to =Fields.DisplayText which is a column in the odt2 table.

Unfortunately the report runs but is blank and I can tell that odt2 has 13 rows in it.

What am I missing??

Thanks

Chris

4 Answers, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 11 Jul 2014, 12:40 PM
Hello Chris,

Please verify if you are using the ObjectDataSource component with one of the supported object types listed here.
In case the DataSource is a business object, the DataMember property specifies the name of the method which should be invoked to retrieve the data. If the DataMember property is not specified, as in your case, the constructor of the type will be invoked.

We have also created a sample project demonstrating some of the possible approaches to dynamically set the report's data source. Please find the sample in the attached file.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Chris Trina
Top achievements
Rank 1
answered on 11 Jul 2014, 08:44 PM
I finally figured this out, I can make it work with session set to InProc, but it doesn't work with session set to StateServer.  I know this is the issue as I can just change this and make it work or not work.  Can it work with a StateServer?  If so, what else do I need to change to make it work.  If not, WHY NOT??

Chris
0
Chris Trina
Top achievements
Rank 1
answered on 12 Jul 2014, 03:23 AM
Nasko

I have a very simple, self contained example that I can send you, but I cannot connect a zip file to this message.

Basically, the following code works fine if session state is InProc but not if it is StateServer.  

         Dim goUnitDataTable As System.Data.DataTable

        Projector_Create_DataTable(goUnitDataTable)

        Dim instanceReportSource As New Telerik.Reporting.InstanceReportSource()
        ' Creating and configuring the ObjectDataSource component:
        Dim objectDataSource As New Telerik.Reporting.ObjectDataSource()
        Dim report As New SSG.BYOC.ReportLib.ProjectionDetails_KCG
        objectDataSource.DataSource = goUnitDataTable
        report.DataSource = objectDataSource
        instanceReportSource.ReportDocument = report


        ReportViewer1.ReportSource = instanceReportSource
        ReportViewer1.RefreshReport()

I understand many of your limitations related to state, but this is really getting to be a pain.  Please advise as to if/how this logic can work with state = stateserver.

Thanks

Chris

0
Nasko
Telerik team
answered on 16 Jul 2014, 01:49 PM
Hello Chris,

We cannot tell if the requirements described in the Design Considerations for Out-proc Session State help article are met only by looking at the provided code. Please go through the above article and make sure your reporting project follows the suggestions there.
In case the issue persists, please open a new support ticket for this issue and attach the mentioned example to the ticket in the form of a zip file.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
Chris Trina
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Chris Trina
Top achievements
Rank 1
Share this question
or