Thursday, March 8, 2012

Crystal Report based on SQL Query!

Hi all,

I'm working on Crystal Reports in C#. (Ofcourse ... this section of Forums is on VB... But still... i may geta solution for my prob!!)

I need to generate a report based on data retrieved from an SQL Query. Every time I need to pass this Query dynamically to the report, I mean, my SQL Query is not constant but changes depending on certain criteria.

How can I let the Report know this changing Query??
I could generate a report based on a fixed SQL Query. But How to send this dynamically changing Query to the report??

Pls help me out.

Thank you all.

Bye.i dunno about C# but, u can do it in VB.Net by setting the dataset as report source.

may be it can be done in C# too.

Already answered how to do it in VB.net, in this forum.|||Mr. Addidas

Hope the field names and number of fields are same eventhough query is changing.

Why don't you go for procedure with parameters. You can pass parameter dynamically to procedure. In VB the crystal report control provide this facility by ".StoredProcParam(0)" property. obviously you can give any number of parameter.

Second method is you can pass total query as string parameter to procedure.

No comments:

Post a Comment