views:

97

answers:

3

Hello All;

I have got a task regarding parameter passing to Crystal Report via Crystal Report, I would like to find best way to achieve it.

Imagine that I have got parameterized and non reports-parameterized. I am developing a report manager that will enable users to subscribe to the reports and schedule them with their parameters. I have got a subscription web page with the list of reports. When a user wants to subscribe to a report and schedule it, if there is no parameter in the report, it is fine but if there is any parameter that needs to be passed to the report(which we can find from rpt file), user should be able to enter these parameters values via a panel in the page. and I will save those parameters' values to the database.

Effectively, I need to create a parameter entry panel to get the parameters and save them to the database with their type, value and so on, then I need to use these parameters programmatically for exporting reports to the different file formats.

Basically, I must develop parameter entry panel run time in accordance with the parameter types that the corresponding report has.

Does anyone have any idea what the best way is to achieve it?

Thanks for your help from now on and please ask for further clarification if needed/

Kind Regards.

+2  A: 

You could use BusinessObjects Enterprise, but that will be expensive.

Otherwise, you will need to build your own parameter control. The control would interrogate the report, determine what types of parameters that it contains, then build the control's UI accordingly. It would need to maintain state between post-backs, capture and display the default values and current values collection for each parameter.

I started building such a control a few years back, but never completed it. It's quite a bit of work as you might guess.

Craig
+1  A: 

In a comment on you're question you asked what would be suggested instead of Crystal Reports so I figured I'd offer up SSRS. If you are using SQL Server, I'd recommend that you look into using SQL Server Reporting Services. Though I believe that Crystal Reports are more robust (possibly just because I know them better), I believe that a lot of the subscription, scheduling, and parameter handing is ready to go after the initial configuration.

I'm not an expert on SSRS so maybe someone with more knowledge will edit my answer with more specific details. Hope this helps.

Dusty
+1  A: 

You can open each report as a ReportDocument object, then enumerate through the ParameterFields collection to evaluate the names, types and other info on each. With that info you can generate your parameter entry panel.

CodeByMoonlight