c# csv datasource -dynamic fielname
Printed From: Crystal Reports Book — Forum Name: Technical Questions
Posted By: WiglWagl — 25 Aug 2016 at 11:34pm
Hi, is it possible to create a Crytal Report with a dynamic CSV-Datasoruce? Example: I created a simple Report bound to a CSV Datasource named "test.csv". Now we print out of our software and the proble is, we have to create CSV-Files with different names like "test.47.csv, test.55.csv". How can i add this files to my report during runtime? Thanks a lot Rene
Posted By: kevlray — 26 Aug 2016 at 5:07am
I have a similar issue using a ETL process. Unfortunately the only solution I could come up with is a batch file that changed the name of the source file to a standard name that I could count on being there.
Posted By: hilfy — 26 Aug 2016 at 5:46am
Not from within Crystal itself. However, if you use the .NET or Java SDK to run the report, you can dynamically set the data source at runtime.
-Dell
Posted By: WiglWagl — 29 Aug 2016 at 1:26am
Hi, after many hours of searching, i found the solution! The main problem ist to bind the DataSet in a correct way to the report. DataSet myDataSet = new DataSet(); myDataApater.Fill(myDataSet); foreach(DataTable item in myDataSet.Tables) { var t = myReport.Database.Tables(item.TableName); t.SetDataSource(item); } Thanks all Rene
|