rcook 7 Newbie Poster

I have a GridView on a web page with a select button on each row. I have a SelectedIndexChanged method which nicely gets called when one of the select buttons is clicked.

I have a Crystal Report in a control on another web page. I would like to use a value from the selected row to get a large number of fields and fill in this Crystal Report and redirect to it.

I don't know how to do this. I keep looking through tutorials and such, but all I see are examples of how to do something slightly different.

I know I can set a SQL statement in the report, but I don't know how to pass a parameter to it. I've tried creating a ReportDocument and calling its setParameterValue method, passing in the name of the database field and the value of the index I got from the selected record, but it tells me "Invalid index."

It just seems like I should construct a data source (or something) that will take my key and get my fields, and then feed the field values (somehow) to this Crystal Report page so my nice users can view it and so forth.

Can someone point me to the right place? I don't need code written for me, but how about the names of the thingies I would use and roughly where I would put them.

May I take a moment to comment on the current standards of teaching? Instructional sites and books seem to think it adequate to give examples of things. Examples are useful, examples have their place, but they do not explain principles and are prone to leave ambiguous which things are illustration of principle and which things are specific to the example. I've seen examples of how to do things that are similar to this, but can't figure out how it works in this case.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.