Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I populate a report from a dataset thats from a datagrid

Status
Not open for further replies.

sk8er1

Programmer
Jan 2, 2005
229
US
Can I create a report from the dataset that is used for a datagrid. I have the grid fill out on a form, I want to use the existing dataset to populate a report. Can this be done? And how can it be done? Thanks
 
Yes you can is the simple answer.

With your CrystalReport you pass the dataset into it:

MyReport.SetDataSource(myDataSetObject)

Then pass your report into the appropriate viewer control web or Windows UI.

Be careful with large amounts of data as this makes a copy of the entire dataset, but of course has the advantage of no DB round trip.

You will have to create a dataset .xsd file within the .NET project for the crystal designer to work from as it will never be directly connected to any real database.

Each DataTable in the DataSet will need a sub-report to process the data, if you have any.

If you get issues with no data in the sub-reports then set the datasource for each.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top