Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Pointing a Crystal textobject at a dataset field
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00694184
Message ID:
00695016
Vues:
20
This message has been marked as the solution to the initial question of the thread.
Hi Evan,

I think the best solution for you is to create a new DataSet via the Project,Add New Item,DataSet. Name the Dataset the same as what you will dynamically create. Then in the designer, create a dataset schema that will represent the same as your dynamically created dataset. After that, create your Crystal report, using the newly created DataSet schema.

When your report runs, CR.NET will see the same dataset name with the same schema, thinking it was the one used originally in creating the report.

This just makes me wonder... are people not designing n-tier .NET apps. All of the examples show how to report off of SQL Server tables, or ADO.NET datasets, that read directly off of SQL tables. Trying to report off of a biz object that return an XML string seems like it should be a very standard requirement.

>>Evan,
>>I built my viewer forms with ado.net off the following sample I got on Crystal's site:
>>http://support.crystaldecisions.com/communityCS/FilesAndUpdates/vbnet_win_adodotnet.exe.asp
>
>That doesn't work either. The fundamental difference is that I am creating my dataset programmatically, so it doesn't or can't (I could be wrong) exist at design time to create the report from.
>
>Here is how I create my dataset..
>
>
>// create instance of report
>public test oReport = new test();
>// create staff object
>string lcStaffXML;
>Staff oStaff = new Staff();
>DataSet dsStaff = new DataSet();
>// get records from biz object
>lcStaffXML = oStaff.GetRecords(".T.");
>// convert xml string to stream, then into XMLTextReader so that dataset can use it (sigh!)
>StringReader loStream = new StringReader(lcStaffXML);
>XmlTextReader loXmlTextReader = new XmlTextReader(loStream);
>dsStaff.ReadXml(loXmlTextReader,XmlReadMode.ReadSchema);
>// attached the dataset to the report and the report to the report viewer
>oReport.SetDataSource(dsStaff);
>crvMain.ReportSource = oReport;
>
>
>My thought was to then go into the report then attach each field in the dataset to each unbound field object in the report. I can't figure out how to do this.
>
>Is there another way? Is there a way to make the dataset above available at design time so that I can build the report with it?
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform