binding devexpress xtrareport EFdatasource at runtime - asp.net

I'm trying to bind a xtraReport-EFdatasource to a list, i have done this in designer mode quickly using the wizard, but i cant bind its datasource at runtime.
DataSource = Services.CoursesList();
I tryed this code in the report constructor, also in the XtraReport1_DataSourceDemanded event with no luck. the devexpress website show an example using bindingsource, but im using EFdatasource. Can you help me with a code sample please?

I suggest you refer this - How to use Entity Framework with Xtrareports
The best way to accomplish your task is to place your Report class and
Entity objects into a separate class library. In this case, you will
be able to bind the Report to a custom object at design time and
provide data at run time.
To pass data to your Report instance, handle the
XtraReport.DataSourceDemanded event, create your Entity objects,
and pass them to the XtraReport.DataSource property.
More References:
How to use the XtraReport with the Entity Framework

Related

Data binding between SWT and Xtext

I am building a plugin for eclipse that provides a graphical editor.
In this editor, I want to bind some data between an XText model and the SWT widgets. How can I do this while updating the XTextDocument automatically?
Are there existing tools that help with this, or do code generation for this?
By now, I have created with window builder plugin JFace Automatic Databinding with controller class.
it seem that whenever I change the text field which the xtext data model (JString) is bind to, the binding put null/new instance of JString into the JString instance.
so the document isn't familiar with the new JString instance and it is not updated with the new data.
I extended AbstractObservableValue to work with simple xtext models as string boolean and numbers. which help me to bind between swt model and my xtext model.
Dana, FYI I've done some work on this front in https://github.com/vorburger/xtext-sandbox/tree/master/XtextDocumentBinding (demo video on http://www.youtube.com/watch?v=7RThXRyo3ik).. basically working, except for lists - patches & pull requests most welcome! ;-)

Getting Dataset, Dataadapter etc. in asp.net like we can get in vb.net

I wonder if there is any way of getting datasets, dataadapters etc. in asp.net like we can get in vb.net, just by adding a binding source, giving it DataSource and then data member.
It gives you a statement like
Me.taGetKey.Fill(Me.DsGetKey.tblLicense)
In the Form_load event of your form.
I want to avoid all the code that we need otherwise to get this.
I added a biding source to my asp.net application but it did not work the way we can do it vb.net.
Please advise
Thanks
Not exactly but you may find DataControls (GridView, DataList etc) and DataSource controls (SqlDataSource, ObjectDataSource etc) in ASP.NET which provide facility to bind the DataSet or other datasources to the complex and simple controls.

Visual Studio 2010 Report Viewer

I have been trying to use report viewer for a couple of days now and got no where. I have an ASP.Net WEB APLICATION, not a WEB SITE. Which every tutorial relates to.
I used the report viewer last week in another project and it worked perfectly.
What im trying to achive is to create a new report using business objects. NOT a SQL connection. Previously when i used the report viewer when adding new DataSet to the Report Data window all of my namespaces in my objects library (a seperate assembly) were listed and I was able to select my busines object and drag the fields to the report.
Now every time I go into the add dataset wizard there is nothing in the datasource list. If I add the report to the objects library and create an object datasource then they appear in here fine. Obviously i dont want reports in the objects library, they go in the website.
Does anyone know why the add new datasource option is disabled for Web applications? (Accessed from Data > Add new datasource)
Can anyone tell me how I can use the object datasource in the designer in the report?
my classes i want to report on have both a parameterless constructor, they return a list for the get methods. and they are all serializable.
I have found a solution for this by creating a reporting class library.
if anyone is interested I added it to my blog for future reference.
http://wraithnath.blogspot.com/2011/02/visual-studio-2010-report-viewer-object.html

crystal report datasource to business layer object colletion

In my project I want to use data source for a crystal report as collection of business layer object.
How do I do this? I have 3 projects together in my solution one of them is business object layer.
In grid and comboboxes or other controls I am able to bind these objects to the collection directly.
I know how to bind crystal report to the object collection when class is in the same project but not to the class which is in different project of current solution.
Thank you
May be its too late for you, but I'll post an answer, in the case that it helps others.
I had the same problem - where you cannot see the classes from other projects in .NET objects section of Crystal Report, but still you can add them.
Steps to add class as data source from other project:
Go to Database Expert
Click on Create new connection
Make new Connection form ADO.NET (XML)
In popup window add a full class name in the editable drop down
Click finish
Thats it ...

XtraReports Null Reference Exception

Anyone who used the XtraReports, i have created a databinding on one of my LINQ to SQL objects and dragged some properties over the report, but when i set the datasource to an object i get NullReferenceException in ShowPreview() method. If i don't set the DataSource i see the preview correctly (basically only the picturebox i set as background). Could this happen because some values are null? even i don't use them? if so is true, this is so pity.
The Exception does not help more.
Yes, you can utilize LINQ to SQL API to bind an XtraReport document to data.
Check out the sample project located in this issue:
http://www.devexpress.com/Support/Center/p/S30767.aspx
If you need more help, drop by the DevExpress support center:
http://www.devexpress.com/Support/Center/CreateIssue.aspx?issuetype=Question

Resources