Saturday, February 25, 2012

Designing a Report without Dataset

Hello

We are trying to create an app where we pass dynamically a dataset (from our form in C#) to our {report}.rdl file.

We are having doubts about something.

How can we design the actual report if we don't have the datasource until runtime? The reason to do this is due to our complex calculations of data which becomes almost impossible to achieve in a T-SQL environment.

I know with a lot of patience and time (we don't have both) we can achieve it, but even though, we would need to process some data in the client side.

So, the question is... is it possible to design a report without a Dataset? I know we can drag the controls on the layout window, but we won't be able to test it. IS there any workaroung about this?

Thank you

Assuming that you use the ReportViewer control in local mode and you have the dataset schema, you can lay out the report from the schema, e.g. from a typed dataset. You may find the following article helpful.|||

Ok, let's get more detailed about this.

We have our SQL Server. let's call it SQL. We have our clients using our software. In our software we have a winform with a ReportViewer object.

Ok. We want that winform to load dynamically the reports stored in our SQL Server. We want to pass a parameter to the winform, which is the report name, then according to that parameter we are going to load a report. OK. Then, Once we know what report we want to load, we want to be able to pass a "runtime dataset" (a dataset created at runtime) Why? because of the complexity of our calculations we prefer to retrieve the data raw from the SQL, then process it in our client software and then pass it to our report (which we have already selected and it's waiting to be shown in the Report Viewer).

We thought the steps were something like create an instance of a LocalReport, then get the Definition from the report (stored in the SQL Server) and pass it to this LocalReport, then create a ReportDataset instance and pass the data the way we want it, then pass that ReportDataset to the LocalReport and then tell the ReportViewer to show that instance of the LocalReport.

That's in detail what we want. So far we haven't been able to achieve it, but we keep on trying. Any suggestion is welcome.

By the way, does anyone can address me to this new feature of SQL2005 for writing code in C#. Maybe that's a solution for our "Processin Stage".

Regards

|||

We want that winform to load dynamically the reports stored in our SQL Server.

I interpret this as you keep the report definitions in a SQL Server database. You don't have/need a Report Server, correct? You need to:

1. Save the report definition to a local file.

2. Generate the dataset.

3. Configure the report viewer in local mode and bind the dataset to it.

No comments:

Post a Comment