Monday, February 20, 2012

New Crystal Reporter

Hi everyone. I've been developing an application which needs to create a couple of reports. I was going to use microsoft Graph for the Charts but it turns out that that's not recommendable.

So I decided to get into Crystal Reports. The point is that the help I've found is somewhat generic and I need something a little more specific.

What I need to do is to show a chart with the completed and not completed sales in a specific month. And show another form with the percentages of this sales.

I'm using VB6 and an Access database for my project.

If anybody knows where can I find some help... please let me know

Thanx in advance :wave:Create a query in access that summarizes your sales data by month, giving a field for Year & Month, and fields for Complete and Incomplete.
Use the Report Expert to connect to the Access Database, once connected you should see your query exposed as a Stored Procedure.
Select the query, and select field you wish to show, and then group by month.

When done, you should be able to right-click on the Group Header and select ChangeGroup. If you have a properly formated date CR will auto-recognise and type the field as date, and you should see a dropdown combo with caption "The section will be printed".
Select "for each month" from the combo.

When designing the Chart, select Advanced in the Data tab, and in the "Place Chart" combo, you should be able to select the group name, if you want to print the chart for each month, or select once per report option. Later you will put the Chart in the Group Footer if you selected the option to print each change of date (which in this case means each month, cos that's the group selection formula you selected), or put it in the report footer if you selected the "Once per Report" option.
Then select the summary fields that your SQL statement created from the list named "Available Fields" and put them in the "ShowValue(s)" list.
Oh, and don't forget to select an option for the combo above the "Show Values" one.

That just about ought to get you close......

Dave|||Create a query in access that summarizes your sales data by month, giving a field for Year & Month, and fields for Complete and Incomplete.
Use the Report Expert to connect to the Access Database, once connected you should see your query exposed as a Stored Procedure.
Select the query, and select field you wish to show, and then group by month.

When done, you should be able to right-click on the Group Header and select ChangeGroup. If you have a properly formated date CR will auto-recognise and type the field as date, and you should see a dropdown combo with caption "The section will be printed".
Select "for each month" from the combo.

When designing the Chart, select Advanced in the Data tab, and in the "Place Chart" combo, you should be able to select the group name, if you want to print the chart for each month, or select once per report option. Later you will put the Chart in the Group Footer if you selected the option to print each change of date (which in this case means each month, cos that's the group selection formula you selected), or put it in the report footer if you selected the "Once per Report" option.
Then select the summary fields that your SQL statement created from the list named "Available Fields" and put them in the "ShowValue(s)" list.
Oh, and don't forget to select an option for the combo above the "Show Values" one.

That just about ought to get you close......

Dave

Thanx Dave... I know this maybe a little abusive but, do you have some code so I have another reference?

Anyway... thanx for your reply, I'll try to get it running :wave:|||Do you mean the SQL, or code for the report?
Need to work out what you do and don't know......
Only real code in this is SQL, aprt from a formula you'd need to sum the values of Completed and Not Completed, so something like:

SELECT Id, Date, Completed, Value from Sales WHERE (Sales.Date > DateAdd("d", -14, Date()) AND Sales.Date <= Date())

would give you last 14 days of data.
I'd make Completed field a boolean so you can use it in the report to apply logic to an aggregation.

I've attached a zip file with a small table layout in Excel format. You can import it into Access and then open the report.
You may have to reset the Location to ensure that the ODBC connection on your box works Ok - see Database menu, Set Location... option.

Don't forget, if you find what I've given you useful, remember to rate the post and finalise the thread.

Dave|||I mean the CR Code. That's what I'm new at. The query is not that big of a deal (kind of hehe) but the problem is that I don't know how to import those results to a .rpt

I am checkin the zip you attached and hope to find out a way to create my graph. I'll rate the thread anyway.

Thanx a lot springsoft

No comments:

Post a Comment