Crystal Report Best Practice Question - asp.net

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.

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.

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.

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.

Related

Automate parameter addition to SSRS via asp.net

I am extending an existing app to host SSRS reports with an ASP.Net WebForms ReportViewer control. There are a large number of existing reports. That would not be a problem except that we also need to pass another parameter to each report.
Someone on our team suggested that we might be able to add another parameter and SSRS would pass it along to the stored procedure associated with each report. Not knowing anything about reporting services I looked into it.
I tried the following:
private void AddNewParameter(Report report)
{
var reportParameters = new List<ReportParameter> { new ReportParameter(paramName, "foo", false) };
report.SetParameters(reportParameters);
}
The call Report.SetParameters() complains about the new parameter not existing on the report. The MSDN page for SetParameters() has a note near the bottom that says:
"The parameters specified for the SetParameters method must be defined in the original report definition."
Can anyone confirm the sinking feeling I have that all of our reports must be changed to take the new parameter?
The approach you are attempting is going to be a dead end. Sorry. Sinking feeling is confirmed. However...
If there are a ton of reports then you could probably work out an automated approach to update them all by modifying the underlying Report Definition Language. The link I just posted will take you to the TechNet article that has further links to the actual schema definitions for each version etc.
RDL is really just XML, to quote the TechNet article directly:
RDL is composed of XML elements that match an
XML grammar created for Reporting Services. You can add your own
custom functions for controlling report item values, styles, and
formatting by accessing code assemblies within report definition
files.
Only you could weigh the work of developing this type of solution vs the manual approach.
To get an idea of changes required:
Save copy of one report.
Modify the report with changes
Compare modified rdl to original (BeyondCompare, notepad++, whatever)
If your comfortable with parsing XML, then reproducing the change across remaining reports would be entirely do-able.

SSRS 2008: How to do multiple values report?

Right now I have an application which uses Reporting Services to render reports.
This is working nicely, I call each report with a given value (e.g. a ClientId), and the report gets rendered correctly.
However, what I'd like to do now is being able to send multiple ClientIDs to the report, and would like to get 1 pdf file with count(ClientsIDs) pages, each containing the report, according to the ClienID.
How is that possible? I don't really know how to name what I want to do, so I don't really find answers on the net right now. Maybe someone has a tutorial for me?
Thanks in advance !
I believe what you're looking for are multi-value parameters. You could create a new "main" report that contains a multi-value param to accept your client IDs. Then use a subreport as Martin already mentioned to generate your current report for each client ID.
Here's the MS page on multi-value params: http://msdn.microsoft.com/en-us/library/aa337292.aspx
And I wrote an article about using them with a stored proc: http://blog.hoegaerden.be/2009/11/21/reporting-on-data-from-stored-procedures-part-2/
Even though in your case you may not be using SPs, it should help you to understand how these params work.

What is a typical scenario for and end-user reports design?

I'm wondering what would be the typical scenario for using an end-user report designer.
What I'm thinking of is to have a base report with all the columns that I can have, also with a basic view of the report (formatting, order of columns, etc.) and then let the user to change that format and order, take out or add (from the available columns) data to it, etc.
Is that a common way to address what is called end-user designer for reports or I'm off track?
I know it depends on the user (if it's someone that can handle SQL or not for example), but is it common to have a scenario where the user can build everthing from the sql query to the formatting?
Thanks!
Sebastian
The first thing I would think about is to put them in a very tightly controlled sandbox, both for security and also to prevent monstrous, server-eating queries. Beyond that, I think giving them a "menu" of limited options is a good path. I would not give them direct access to SQL.
First question is do you want users creating SQL that could become a run away query (think Cartesian join gone wild).
Depending upon your tooling you might want to publish your report as Excel. Creating a pivot table or a simple spreadsheet may provide the flexibility you are looking for but in a safe environment. Most users can handle removing columns, formatting, etc, in Excel and there are lots of self-help references that you might not find in a report writer tool.

User defined reports with SSRS

I have an web application which serves SQL reporting services reports via the reportviewer control. Because of the complexity of some of the reports I use rdlc reports attached to business objects.
Now I would like to expand the system and allow some form of user-defined reports. Ideally I would like the users to connect their reports to the same business objects I use to create the rdlc reports.
Is there a control that allows users
to create/edit their own rdlc files?
Can rdl files be attached to
business objects?
Any hints/tips for writing my own
control to edit rdlc files? (I would
think this is a lot of work
and would only attempt if there is
no suitable answer to 1 or 2).
All my development has been done in VS 2005 with SQL 2005 but I could upgrade if new features in 2008 help with the solution.
This isn't much of an answer, but at my company I have put together our own Report Builder.
We have about 30 or so Reporting Service reports that our users can access through the web or desktop application. What we wanted to do was give our users the ability to take any given section within those reports and create their own.
If there is a report we have built for them but they don't want to see the graph, they can create the same report with out it. If they want to combine parts from 4 different reports to make one summary report they can drag those sections around on our custom builder and save it.
The report builder I had to put together pulls down all the different sub-reports they have chosen and reads through the XML adding them to a Report Builder Template XML file I have created. I then have to aggregate all the parameters so as to not ask for them more than once (parameter names do have to be unique across all reports if you don't want them aggregated). This new report XML is deployed to the server and the users can access them when ever they want.
I've also given them the ability to create their own cover pages, headers, and footers by dragging text boxes, images, global variables (date ran, created, ran by, page number, etc... anywhere on a blank canvas. I then convert all the items they've drug around and resized on this canvas in to another report XML file and deploy it as a sub-report that they can add to their custom reports.
Yes, this has taken quite a bit of work, but our users love it. We're in the process now of allowing them to create a report with special groupings so the report can be ran at different levels.
So it is possible, but there is no easy answer. =) I'd be glad to give advice to anyone who asks, but a direct copy of the code is a violation of my contract, but I'll do what I can outside of that.
I think SQL Reporting Services isn't meant for this kind of customization. You can hide and show controls and subreports, but stuff like interactive grouping etc isn't there.
You might look into a third-party reporting framework like Telerik's.

How do you handle attachments in your web application?

Due to a lack of response to my original question, probably due to poor wording on my part. Since then, I have thought about my original question and decided to reword it, hopefully for the better! :)
We create custom business software for our customers, and quite often they want attachments to be added to certain business entities. For example, they want to attach a Word document to a customer, or an image to a job. I'm curious as to how other are handling the following:
How the user attaches documents? Single attachment? Batch attachment?
How you display the attached
documents? Simple list? Detailed list?
And the killer question, how the
user then edits attached documents? Is this even possible in a web environment? Granted the user can just view the attachment.
Is there a good control library to help manage this process?
Our current development environment is ASP.NET and C#, but I don't think this is a pretty agnostic question when it comes to development tools, save for the fact I need to work in a web environment.
It seems we always run into problems with the customer and working with attachments in a web environment so I am looking for some successes that other programmers have had with their user base on how best to interact with attachments.
Start with one file upload control ("Browse button"), and use JavaScript to dynamically add more upload controls if they want to attach multiple files in a single batch.
Display them in a simple list format (Filename, type, size, date), but provide full details somewhere else if they want them.
If they want to edit the files, they have to download them, then re-upload them. Hence, you need a way that they can say "this attachment overrides that old attachment".
I'm not familiar with C# and ASP.NET, so I can't recommend any libraries that will help.
http://developer.yahoo.com/yui/uploader/

Resources