I wanted to edit a crystal report that has been made using VS.Net 2003 and SQL Server 2000.
Under the Database Fields in Field Explorer, the developer used dataset that
was returned from stored procedure in SQL Server. The code of the stored
procedure is shown below.
CREATE PROCEDURE spP902A
SELECT Store,ProgramType, COUNT(CustomerControlID) As TotalCustomer
WHERE Status = 'A'
GROUP BY Store,ProgramType
ORDER By Store,ProgramType;
CREATE PROCEDURE spP902B
SELECT Store,ProgramType,MONTH(AdminDT) as Month, COUNT(CustomerControlID)
WHERE YEAR(AdminDT) = YEAR(GetDate())
GROUP BY Store,ProgramType,MONTH(AdminDT)
ORDER By Store,ProgramType,MONTH(AdminDT);
CREATE PROCEDURE spP902C
SELECT Store,ProgramType,MONTH(DischargeDT) as Month,
COUNT(CustomerControlID) As TotalDischarges
WHERE YEAR(DischargeDT) = YEAR(GetDate())
GROUP BY Store,ProgramType,MONTH(DischargeDT)
ORDER By Store,ProgramType,MONTH(DischargeDT);
The report is made so that it shows the # of customer for each program type,
each month. Eg. ProgramType A will have (spP902A-spP902B+spP902C) customers
I have looked at the Crystal Report itself and under the Database Fields, it
has P902(dataset), which expands out to Store, Jan_A, Jan_B, Feb_A, Feb_B,
etc... (A, B are the ProgramType)
I have looked at dsP902.xsd(Dataset&XML), dsP902.xsx, dsP902.vb
, but I didn't see any query made to create Jan_A, or
If we have a new ProgramType C, and I wanted to include it in the report,
how do I add a new dataset (Jan_C)???
If I made a new stored procedure, and I wanted to make a dataset something
like the example I give above, how do I do that?
Thank you for your time. I am so sorry because of my poor English. If
possible, can you give a few screenshots please? I have bought a few books
about vs.net 2003, crystal reports, and have read a little about ADO.NET,
but I still don't understand. So please help me. Thank you very much in
advance. Hope to hear from you soon.