Crystal Report Viewer - data adapter necessary?

G

Guest

H
I have 1 regular windows form with a datagrid which is populated from an SQL Server with data adapter etc
The 2nd form has a Crystal Report Viewer on it. I've created the report.rpt, set the datasource to the DataSet.xsd in the report with the fields where I want them. However, when I run the app and click the button to open the 2nd form with the report on it, only the labels appear on the report; no data fields
Q. I've already got the data on the first form. Do I need to code another data adapter in the form with the Crystal Report Viewer to get the data? It seems that I should be able to just use the existing Dataset
Thank
 
G

Guest

Actually.... right after posting this... I figured out a way to do this
In the New() of the 2nd form, with the Crystal Report Viewer, I made it such that I could pass the first dataset to it... New(ByVal DataSetX as SuperDataSet) ... for example, SuperDataSet being the Dataset type I built already
Then, in the first form, which opens up the 2nd one, in the button_click event, I've got it opening the 2nd one like this
Dim frmViewer as New SuperViewerForm(me.SuperDataSet
frmViewer.Show(
So... that seemed to allow me to re-use the original dataset without having to re-build it in the 2nd form
Please let me know if there are any problems doing it this way
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top