Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal XI line chart - fake data plus db data

Status
Not open for further replies.

APB1981

Technical User
Jul 10, 2005
83
NO
Hello,

I want to create a chart in CR XI. database is MSSQL 2000.
I have some manual/hard coded figures I need to display and also some database summaries I need to display. The reason for this is we do not have data before 2007.

so I want a line chart which groups per year:
Except the years (2003-2006) are not stored anywhere - these will need to be hard coded somewhere.

2003 = 10
2004 = 11
2005 = 13
2006 = 15

2007 = 18
2008 = 22

The data in 2007 and 2008 will be coming from the database. The figures is not one single field but rather a calculation. Total number of field A / Total number of field B. So I will need to use a formula or perhaps running total.

Any ideas how I can merge this data in one chart??

This will merit some stars!

Thanks.

AB

APB
 
If all else fails, you may want to evaluate our CRChart add-in for Crystal Reports ( It has some macros for inserting manual data values that you might find useful.

DISCLAIMER: This product costs money. I work for the company that makes this product.

Dan Weingart
OEM Technical Manager
Three D Graphics, Inc.
 
Hi Dan,

Yes I know who you are. It is Adam here. I am still waiting to hear if we can print the charts to pdf before I purchase your software:)

Thanks for your help.

AB

APB
 
Modify your SQL to be a union query. Depending upon how you've written your report, you may need to copy your report's SQL into a SQL Command.

For example, if your current sql is:

Select transacationYear, tranValue, something, somethingElse
From someTable

Assuming 3rd and 4th col are strings. change to:

Select transacationYear, tranValue, something, somethingElse
From someTable
UNION
Select 2003,10,'',''
UNION
Select 2004,11,'',''

etc etc

May need to add some functions to convert the years to proper dates, but pretty straightforward for such a small history.
If you need to go beyond a dozen or so, you'll need to create a table on your DB containing the history and UNION on that.

Andrew Baines
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top