How Can I Create Reports in a Custom C# Windows Appliation? - General Question

Assume i have a custom Windows application written in C#. This application has only the following functionalists, add, edit, delete and view. For example, a user can add a sale, change sales record, delete a sale record or view the whole sales record.

I need to add some reporting functionalists e.g. i want a user to print the sales of a certain customer from 2008 to 2009 into pdf, what all products a certain customer has purchased from us and so on. I will only include the basic common report requests that are usually needed in the office.

Any other kind of reports that are requested inconsistently, i would do it manually from my side at the back end and send the results manually to the requester.

What i would do is:

If a user wants more info of a certain customer, a special window box appears for that customer. This window box will have different controls that allows user to request more info such as, print customer purchases from ..... to ..... (user chooses the dates) and user will view results in pdf or so. Of course, at the back scene i will write an appropriate SQL Query with parameters that meets a certain function.

Is this how it should be done? I have heard about SQL Reporting, i don't know anything about it yet. I will check it out. Anyhow, your suggestions won't harm. I hope my question is clear enough.

Thank you.
LVL 1
F-J-KAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dirk HaestProject managerCommented:
What do you want to use ? Sql reporting or crystal reports ?
Some tutorials about printing:

Printing Reports in .NET
http://www.developerfusion.com/article/4585/printing-reports-in-net/

Printing Reports Programmatically Using C# and SQL Server 2000 Reporting Services and C#
http://www.csharphelp.com/2007/04/printing-reports-programmatically-using-c-and-sql-server-2000-reporting-services-and-c/

Generating PDF reports programmatically using SQL Server Reporting Services 2005, in C#
http://www.codeproject.com/KB/reporting-services/PDFUsingSQLRepServices.aspx

Building Reports in SQL Server 2005
http://en.csharp-online.net/Building_Reports_in_SQL_Server_2005

Introductions to Crystal Reports in .NET
http://www.c-sharpcorner.com/uploadfile/mahesh/crystalreportsintroduction11082005014959am/crystalreportsintroduction.aspx

Using Crystal Reports with c#
http://www.programmersheaven.com/download/44243/download.aspx

Creating Crystal Reports using C# with Datasets
http://www.codeproject.com/KB/cs/CreatingCrystalReports.aspx
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Death259Commented:
What i tend to do, is i will have a single crystal report that will pull information from a dataset, and then whatver information i want in the report i will filter before i put it in the dataset. It's just easier for me this way.

In order to do this i will create a windows form with a CrystalReportsViewer and on that form i will have my method to load the report. Within the visual studio project i will also create the dataset that the report will then pull from. Here's an example of one of my load method's with 3 report parameters:
public void loadReport(string sql, string reportName, string preparedBy, string approvedBy)
{
      SqlDataAdapter sqlDA = new SqlDataAdapter(sql, sqlConnection);
      dataSet1 ds = new dataSet1();
      sqlDA.Fill(ds);
      SomeReport someReport1 = new SomeReport();
      someReport1.SetDataSource(ds.Tables[ds.Tables.Count - 1]);
      crystalReportViewer1.ReportSource = operationsReport;
      someReport1.SetParameterValue("Report Name", reportName);
      someReport1.SetParameterValue("Prepared By", preparedBy);
      someReport1.SetParameterValue("Approved By", approvedBy);
      crystalReportViewer1.Refresh();
}

Open in new window

0
Death259Commented:
Sorry, there was a mistake in my code:

public void loadReport(string sql, string reportName, string preparedBy, string approvedBy)
{
      SqlDataAdapter sqlDA = new SqlDataAdapter(sql, sqlConnection);
      dataSet1 ds = new dataSet1();
      sqlDA.Fill(ds);
      SomeReport someReport1 = new SomeReport();
      someReport1.SetDataSource(ds.Tables[ds.Tables.Count - 1]);
      crystalReportViewer1.ReportSource = someReport1;
      someReport1.SetParameterValue("Report Name", reportName);
      someReport1.SetParameterValue("Prepared By", preparedBy);
      someReport1.SetParameterValue("Approved By", approvedBy);
      crystalReportViewer1.Refresh();
}

Open in new window

0
radha01Commented:
I personally believe that the following is the best tutorial for the SSRS.
http://www.c-sharpcorner.com/UploadFile/robo60/StandaloneRDLCReports11142007183516PM/StandaloneRDLCReports.aspx

so please go to this and follow it
it will guide you to your goal
0
mlmccCommented:
This question has been classified as abandoned and is being closed as part of the Cleanup Program.  See my comment at the end of the question for more details.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.