The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

esDataSource with RDLC / ReportViewer

Last post 11-12-2008, 3:05 PM by curtis. 9 replies.
Sort Posts: Previous Next
  •  08-09-2007, 5:08 AM 4444

    esDataSource with RDLC / ReportViewer

    Is it possible to use esDataSource with RDLC / ReportViewer?
    Is there a demo/tutorial?

     Thanks,
    Zoltan

  •  08-09-2007, 5:15 AM 4445 in reply to 4444

    Re: esDataSource with RDLC / ReportViewer

    I'm not even sure what that is? We don't have the bandwidth to do these investigations, the best thing for you do it to just try it. My guess is an ObjectDataSource isn't what it's looking for but you might just bind directly to the collection, however, give both ways a try.  Go to our Blog and click on the "esDataSource" category for info on it.
  •  08-09-2007, 5:46 AM 4446 in reply to 4445

    Re: esDataSource with RDLC / ReportViewer

    This is the ASP.NET default report creator tool. It is simple but usefull (web viewer, export: pdf, xls). Works with typed datasets. Just, now I am migrating my ASP.NET application from typed datasets to EntitySpaces objects, and the reports is the last missing step.

  •  09-13-2007, 11:30 AM 5089 in reply to 4444

    Re: esDataSource with RDLC / ReportViewer

    korbai:

    Is it possible to use esDataSource with RDLC / ReportViewer?
    Is there a demo/tutorial?

     Thanks,
    Zoltan

     

    Zoltan, have you figured out how to do this?  if so, i would be interested in seeing a sample.....thanx...Jim

     

  •  09-14-2007, 2:14 AM 5094 in reply to 5089

    Re: esDataSource with RDLC / ReportViewer

    Sorry, I havn't yet.
  •  06-04-2008, 1:04 PM 9632 in reply to 5094

    Re: esDataSource with RDLC / ReportViewer

    Not sure if anyone is even looking at this anymore, but I do have some code that will let you set a ReportViewer objects datasource dynamically with ES (not using an esDataSource though) if anyone is interested.
  •  11-12-2008, 8:35 AM 12408 in reply to 9632

    Re: esDataSource with RDLC / ReportViewer

    Yes Sir, I would like to see that.
  •  11-12-2008, 11:37 AM 12418 in reply to 12408

    Re: esDataSource with RDLC / ReportViewer

    I've gotten ES to work with Crystal Reports, though I suspect the same method will work for Microsofts product.  The trick is to create a separate class dll containing the esobjects.  You can then use that as a database object source for the report.

     

    curtis

  •  11-12-2008, 12:56 PM 12421 in reply to 12418

    Re: esDataSource with RDLC / ReportViewer

    I do have my es business objects in a separate class library compiled to a DLL.  Can you give me a nudge in the right direction on turning that into a "database object source"?
  •  11-12-2008, 3:05 PM 12430 in reply to 12421

    Re: esDataSource with RDLC / ReportViewer

    I'm sure I have the terminology wrong, but here's what I did...

    1) I created a view in the database containing the fields needed

    2) I then created a dataset in .Net to use as the database source for the report

    This game me a design time connection to the data for drop/drag, etc..

     

    After designing, the code behind the report page is:  (Notice PopulateData that returns a datatable from the ES Query. 

    (this is what happens when you take an old cobol programmer and force him to code in .NET with out proper training :) )

    Code:
    Imports System
    Imports System.Data
    Imports CrystalDecisions.CrystalReports.Engine
    Imports CrystalDecisions.Shared
    Imports cwr
    Partial Class CWReport1
        Inherits System.Web.UI.Page
        Private RptData As DataTable
        Protected Sub CrystalReportViewer1_Navigate(ByVal source As Object, ByVal e As CrystalDecisions.Web.NavigateEventArgs) Handles CrystalReportViewer1.Navigate
    
            Dim rep As New ReportDocument
    
            rep.Load(Server.MapPath("CWReport1.rpt"))
    
            
            rep.SetDataSource(PopulateData())
    
            Me.CrystalReportViewer1.ReportSource = rep
    
    
        End Sub
        Private Function PopulateData() As DataTable
            Dim Vrep As CWR.VREPORTQuery = New CWR.VREPORTQuery
            Dim VrepColl As CWR.VREPORTCollection = New CWR.VREPORTCollection
            Dim FromDate As String
            Dim ThruDate As String
            FromDate = Session.Item("Report_FromDate")
            ThruDate = Session.Item("Report_ThruDate")
    
            Vrep.Select()
            If FromDate > "" And ThruDate > "" Then
                Vrep.Where(Vrep.BEGMONDAY.LessThan(CDate(ThruDate)))
                Vrep.Where(Vrep.ENDSUNDAY.GreaterThan(CDate(FromDate)))
            End If
            VrepColl.Load(Vrep)
    
            Dim Dtx As DataTable = New DataTable
            Dtx = VrepColl.Query.LoadDataTable
            Return Dtx
    
    
        End Function
    
        Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
            CrystalReportViewer1_Navigate(Nothing, Nothing)
    
        End Sub
    
    
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    
        End Sub
    End Class
    

View as RSS news feed in XML