1
votes

I am new to this tool, so I do not know how I can get the data of a class and show in a report.

I don't have a database, my info is stored inside variables inside classes. Like this (Folder Objetos): The top class is NFe

My program does: Read a XML, validate with XSD, serialize in this classes. What I want: Take that information and show in a report.

It is possible to put my data from variables in a Crystal report? Where I start?

1

1 Answers

4
votes

well crystal report can take many things as " DataSource" ranging from object, datatable, dataset etc etc. without looking at the code it is hard to figure out where you are having issue.

basic syntax for crystalreport load datasource is

CrystalDecisions.CrystalReports.Engine.ReportDocument reportDoc = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
        reportDoc.Load("your RPT file");

reportDoc.SetDataSource(object)

here instead of object you can use dataset, datatable etc.\

Is this what you were looking for ?

Added

reportDoc.SetDataSource(ds.Tables["YourTableName"])

Also one more thing to note is if you report requires lets say 20 fields they all must be preset in the datatable. or else it will not work. if it has any extra fields in dataset it will just ignore those