Christian Waldmann wrote: > Hello Jiri > > I am using CR11.5 with Visual Studio, FB & DDEX provider 2.0.1 RC1. > > You can only see real data if you run the reports from an application. > In the preview in CR there are always some random data points generated. > > To get real data in the reports, the report data must be loaded at > runtime. I do it with this code: > > I have a report called "ReportSamples.rpt" and I use the datasource > "ServiceStationWork.xsd" with a table called "Samples". > To view the report, I have a form called FormReportSamples.cs with a > CrystalReportViewer control called "crystalReportViewerSamples" > To fill a dataset for the report, I use the following helper class: > > using System; > using System.Collections.Generic; > using System.Text; > using System.Data; > using FirebirdSql.Data.FirebirdClient; > namespace ServiceStation { > class DataSetConfig { > public static DataSet SamplesDataSet { > get { > ServiceStationWork dataSet = new ServiceStationWork(); > FbConnection connection = new FbConnection( > connectionStringWork ); > FbDataAdapter dataAdapter = new FbDataAdapter( "select * > from \"Samples\" ", connection ); > dataAdapter.Fill( dataSet, "Samples" ); // no quoted > identifiers here, it is a table in .xsd > return dataSet; > } > } > } > } > > In the FormReportSamples Load event, the data set is loaded and assigned > to the crystal report viewer. > > private void FormReportSamples_Load( object sender, EventArgs e ) { > // make an instance of the report > samplesReport = new ReportSamples(); > > // get the filled dataset for the report > DataSet dataSet; > dataSet = DataSetConfig.SamplesDataSet; > > // set the data source in the report > samplesReport.SetDataSource( dataSet ); > > // show the report with the viewer control > crystalReportViewerSamples.ReportSource = samplesReport; > } > > This is my way to get i work. > Christian
Ok, thanks for this. I'll play with this on weekend. I hope for success. ;) -- Jiri {x2} Cincura http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider