6 Replies - 9918 Views - Last Post: 26 May 2009 - 06:53 PM Rate Topic: -----

#1 mjfara  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 24-May 09

Making Reports with C#/MySQL

Posted 24 May 2009 - 07:57 AM

Hello everyone,

I am currently working on an application in C# which requires me to create reports based on a MySQL database. I have been searching for quite some time, and the only way it seems possible is with crystal reports, which I have never used before. The application is quite complex and this is just the reporting aspect of it, I had anticipated that MySQL would have easily done this by using aggregate functions like Group By. Unfortunately it does not, and I am at a road block in my program. These are the kind of reports I would like to create:

Posted Image


This report was done in access.

Does anyone have any suggestions on how I can make a report using C# and MySQL?
Any help is greatly appreciated, thank you.

Matt

Is This A Good Question/Topic? 0
  • +

Replies To: Making Reports with C#/MySQL

#2 newProgram  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 160
  • Joined: 28-October 08

Re: Making Reports with C#/MySQL

Posted 24 May 2009 - 07:04 PM

View Postmjfara, on 24 May, 2009 - 06:57 AM, said:

Hello everyone,

I am currently working on an application in C# which requires me to create reports based on a MySQL database. I have been searching for quite some time, and the only way it seems possible is with crystal reports, which I have never used before. The application is quite complex and this is just the reporting aspect of it, I had anticipated that MySQL would have easily done this by using aggregate functions like Group By. Unfortunately it does not, and I am at a road block in my program. These are the kind of reports I would like to create:

Posted Image


This report was done in access.

Does anyone have any suggestions on how I can make a report using C# and MySQL?
Any help is greatly appreciated, thank you.

Matt

Quote

You can generate this kind of report in Crystal Report which is included in VS 2005.

Was This Post Helpful? 0
  • +
  • -

#3 fixo  Icon User is offline

  • D.I.C Regular

Reputation: 85
  • View blog
  • Posts: 335
  • Joined: 10-May 09

Re: Making Reports with C#/MySQL

Posted 24 May 2009 - 11:44 PM

View PostnewProgram, on 24 May, 2009 - 06:04 PM, said:

Does anyone have any suggestions on how I can make a report using C# and MySQL?
Any help is greatly appreciated, thank you.

Matt



Here is the nice place to start with Crystal Report:

http://csharp.net-in...-stepbystep.htm

~'J'~
Was This Post Helpful? 0
  • +
  • -

#4 mjfara  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 24-May 09

Re: Making Reports with C#/MySQL

Posted 25 May 2009 - 08:19 AM

Hey thanks for the reply guys.

I have looked at that site for quite some time and it seems like I finally got them to work with basic reports. What I need is to create a report like the one shown above. I can not seem to understand how I can make the same kind of report, because each subreport is dependent on the main reports customer. So lets say I have these two tables for simplicity purposes:

CUSTOMER
CustID
CompanyName

and

ORDERS
OrderID
CustID
Price
Quantity



Lets say I want the customers name and every order under them, how would i query this in a dataset? Would i select all from both tables? Is crystal reports able to report on condition? Like having a subreport where CustID is = to the the CustID of the main reports Customer? Or will I have to create a dataset for each customer with a query like ( SELECT * FROM ORDERS WHERE CustID = 1...2....3...etc...)

Also, how do I get it to display the company name only once, and then the subreport under it, like in the above screenshot. I can't seem to figure this out either. Development has been going smooth up until now.

I just can't seem to understand these crystal reports, any help is greatly appreciated, thank you.
Was This Post Helpful? 0
  • +
  • -

#5 newProgram  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 160
  • Joined: 28-October 08

Re: Making Reports with C#/MySQL

Posted 25 May 2009 - 07:33 PM

View Postmjfara, on 25 May, 2009 - 07:19 AM, said:

Hey thanks for the reply guys.

I have looked at that site for quite some time and it seems like I finally got them to work with basic reports. What I need is to create a report like the one shown above. I can not seem to understand how I can make the same kind of report, because each subreport is dependent on the main reports customer. So lets say I have these two tables for simplicity purposes:

CUSTOMER
CustID
CompanyName

and

ORDERS
OrderID
CustID
Price
Quantity



Lets say I want the customers name and every order under them, how would i query this in a dataset? Would i select all from both tables? Is crystal reports able to report on condition? Like having a subreport where CustID is = to the the CustID of the main reports Customer? Or will I have to create a dataset for each customer with a query like ( SELECT * FROM ORDERS WHERE CustID = 1...2....3...etc...)

Also, how do I get it to display the company name only once, and then the subreport under it, like in the above screenshot. I can't seem to figure this out either. Development has been going smooth up until now.

I just can't seem to understand these crystal reports, any help is greatly appreciated, thank you.

In Crystal Report there is a Group Name Field function which you can use to display the company name only once. right click on Group Name Field >> select Insert Group >> choose the field that you will group by on the combo box.
Was This Post Helpful? 1

#6 mjfara  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 24-May 09

Re: Making Reports with C#/MySQL

Posted 25 May 2009 - 10:47 PM

Hey thanks alot!
That really helped, I finally got it going how I wanted it, on with the project!
Was This Post Helpful? 0
  • +
  • -

#7 newProgram  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 160
  • Joined: 28-October 08

Re: Making Reports with C#/MySQL

Posted 26 May 2009 - 06:53 PM

View Postmjfara, on 25 May, 2009 - 09:47 PM, said:

Hey thanks alot!
That really helped, I finally got it going how I wanted it, on with the project!

Your welcome. :-)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1