Crystal Reports?
-
I need to make a new crystal report at runtime! So I make new instance of crystal report wich has only title and datetime fileds. So I need to add columns and datasource to it. But how I do not know! is there any way how to add datafields to report? there is only a method for setting datasource. Can anyone help me out? thanx a lot
-
I need to make a new crystal report at runtime! So I make new instance of crystal report wich has only title and datetime fileds. So I need to add columns and datasource to it. But how I do not know! is there any way how to add datafields to report? there is only a method for setting datasource. Can anyone help me out? thanx a lot
You'll want to start by creating a data schema for your data source and adding this too your project. You can do this by either using datasource.WriteXmlSchema() or by hand. Once you have the schema in your project go into you report and right click anywhere on it and select Database->Add/Remove Database. You should see your dataset under Project data-> ADO .NET datasets. Now all of the tables and fields from that dataset should be added to the Field explorer in the report, go ahead and drag them on too the report. Once you have laid out your report you can use the following code to assign the dataset too it: MyReport oRpt = New MyReport oRpt.SetDataSource(mydataset) CrystalReportViewer1.DisplayGroupTree = False CrystalReportViewer1.ShowGroupTreeButton = False CrystalReportViewer1.ReportSource = oRpt
-
You'll want to start by creating a data schema for your data source and adding this too your project. You can do this by either using datasource.WriteXmlSchema() or by hand. Once you have the schema in your project go into you report and right click anywhere on it and select Database->Add/Remove Database. You should see your dataset under Project data-> ADO .NET datasets. Now all of the tables and fields from that dataset should be added to the Field explorer in the report, go ahead and drag them on too the report. Once you have laid out your report you can use the following code to assign the dataset too it: MyReport oRpt = New MyReport oRpt.SetDataSource(mydataset) CrystalReportViewer1.DisplayGroupTree = False CrystalReportViewer1.ShowGroupTreeButton = False CrystalReportViewer1.ReportSource = oRpt
oops...forgot I was in the C# forum. The above code is in vb .net, if you need any help converting it, let me know.
-
You'll want to start by creating a data schema for your data source and adding this too your project. You can do this by either using datasource.WriteXmlSchema() or by hand. Once you have the schema in your project go into you report and right click anywhere on it and select Database->Add/Remove Database. You should see your dataset under Project data-> ADO .NET datasets. Now all of the tables and fields from that dataset should be added to the Field explorer in the report, go ahead and drag them on too the report. Once you have laid out your report you can use the following code to assign the dataset too it: MyReport oRpt = New MyReport oRpt.SetDataSource(mydataset) CrystalReportViewer1.DisplayGroupTree = False CrystalReportViewer1.ShowGroupTreeButton = False CrystalReportViewer1.ReportSource = oRpt
No, the thing is that I do not know what kind of table I will use in advance. What I need is application that gets a dataset with one table that need to reported! So I do not know how to build a report from a scratch. I know how to set a datasource for report but how to add columns (fields) to it I do not know! Of course if it is possible at all.