Hi,
here the problem:
I create a Report and i test it by a winfrom it work fine. If i modify this report adding some code getting data form my DataLayer and i compile it all still run fine, but the design of my win form (in design time) show me an error
1- I create 2 class in report library
2- I create a Table Report (with WIzard)
the datasource is lstCubeDistrXday collection.
3-I create a report by wizard
-As datasource type i set the ObjectDataSource one.
-I bind it to my DataLayer Library and i set a method as datamemeber (let say...getMyItemsFromDB) My DL library is referncede in Reprto Library
-The wizard let me choice the fields to put in table report.
-Finally i have A table report with all my filed
4- I write some code to populate the collection (i want tesst it wit a hardcoded collection first, so i dont yet get data from DL):
4-I add a winForm project to my solution to debug the report the report
on the form i add a reportViewer then a ReportBook i ad my report to Rport book and finally i set hte property report to report81 (it is my report)
ALL WORK FINE and i See my data in my report
Now i try to binf me DataLayer, just a little change:
}
I compile the report Library and i launch the winForm project to see the report.
ALL WORK FINE. i can see my Data.
But i have a problem: at design time the WINFORM can't display and shows me the following message:
here the problem:
I create a Report and i test it by a winfrom it work fine. If i modify this report adding some code getting data form my DataLayer and i compile it all still run fine, but the design of my win form (in design time) show me an error
1- I create 2 class in report library
public class mCubeDistrXday { public int cont { get; set; } public string cardType{ get; set; } public string Country{ get; set; } public string na { get; set; } public DateTime ? date { get; set; } }public class lstCubeDistrXday : List<mCubeDistrXday> { }2- I create a Table Report (with WIzard)
the datasource is lstCubeDistrXday collection.
3-I create a report by wizard
-As datasource type i set the ObjectDataSource one.
-I bind it to my DataLayer Library and i set a method as datamemeber (let say...getMyItemsFromDB) My DL library is referncede in Reprto Library
-The wizard let me choice the fields to put in table report.
-Finally i have A table report with all my filed
4- I write some code to populate the collection (i want tesst it wit a hardcoded collection first, so i dont yet get data from DL):
private List<Model.mCubeDistrXday> myItemList = new List<mCubeDistrXday>(); public Report8() { InitializeComponent(); mCubeDistrXday i = new mCubeDistrXday(); i.cont=10; i.data=new DateTime(2011,02,02); i.na=""; i.cardType="OPE"; i.country= "ITA"; myItemList.Add(i); i = new mCubeDistrXday(); i.cont = 10; i.data = new DateTime(2011, 02, 02); i.na = ""; i.cardType= "OPE"; i.country= "EXT"; myItemList.Add(i); var selectqry = from t in myItemList
where t.nazione != null && t.tipoTessera != null && t.data != null select new { nazione = t.nazione, tipoTessera = t.tipoTessera, cont = t.cont, data = t.data, na = t.nazione == "ITA" ? "ITA" : "EXT" };
this.objectDataSource1.DataSource = selectqry; } 4-I add a winForm project to my solution to debug the report the report
on the form i add a reportViewer then a ReportBook i ad my report to Rport book and finally i set hte property report to report81 (it is my report)
ALL WORK FINE and i See my data in my report
Now i try to binf me DataLayer, just a little change:
public partial class Report8 : Telerik.Reporting.Report { private DataObjectsSE.IDbStat.IDbStatDao daoDbStat = DataObjectsSE.DataAccess.dbStatDao; public Report7() { // // Required for telerik Reporting designer support // InitializeComponent();
var selectqry = from t in daoDbStat.getCubeTipoTesseraDataNazione("MyParam") where t.nazione != null && t.tipoTessera != null && t.data != null select new { nazione = t.nazione, tipoTessera = t.tipoTessera, cont = t.cont, data = t.data, na = t.nazione == "ITA" ? "ITA" : "EXT" }; this.objectDataSource1.DataSource = selectqry;I compile the report Library and i launch the winForm project to see the report.
ALL WORK FINE. i can see my Data.
But i have a problem: at design time the WINFORM can't display and shows me the following message:
The variable 'report71' is either undeclared or was never assigned.
|