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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Reports - SQL - HTML

Status
Not open for further replies.

BBousman

Programmer
May 10, 2004
57
US
I'm having trouble with running a Crytal Report from an HTML file. The HTML file acts as a filter so you can specify which records you want from the database. The SQL statement I'm sending in is right but instead of getting say the one record I want, it always brings back all records. Here's the SQL statement that it's running:

SELECT Delivery.Promised_Date, Job.Order_Date, Job.Description, Job.Part_Number, Job.Customer_PO, Job.Order_Quantity, Address.Line1, Address.Line2, User_Values.Numeric1, User_Values.Amount1, Job.Quote, Job.Unit_Price, User_Values.Amount2, User_Values.Text5, Customer.Name, (Job.Customer + '-' + Job.Job + User_Values.Text2), (Address.City + ', ' + Address.State + ' ' + Address.Zip), Job.Ext_Description
FROM (((PRODUCTION.dbo.Job Job LEFT OUTER JOIN PRODUCTION.dbo.Delivery Delivery ON Job.Job=Delivery.Job) LEFT OUTER JOIN PRODUCTION.dbo.Address Address ON Job.Ship_To=Address.Address) LEFT OUTER JOIN PRODUCTION.dbo.User_Values User_Values ON Job.User_Values=User_Values.User_Values) LEFT OUTER JOIN PRODUCTION.dbo.Customer Customer ON Job.Customer=Customer.Customer WHERE Job.Job = '30825-01'

That's what the HTML file is supposed to do but whenever the report runs it acts like the WHERE clause isn't even on there and just retrieves them all. Anyone have any ideas why this is happening?
 
Try posting technical information:

Crystal version
Database/connectivity
How was this HTML generated, and what is its' method for calling the report?

Show the code being used, your SQl statement obviously contains a where clause, but you aren't showing HOW this HTML file is doing anything other than displaying a SQL statement.

-k

 
I'm using Crystal Reports v11.0.0.895
The connection is using and ODBC(RDO) connection to the database.
The HTML was wrote by someone else so I'm not too familiar with it, I just made it work....sort of. There's 2 .htm files I'm using Shop_Order.htm & Shop_Order_Rpt.htm. In Shop_Order.htm, there are 2 text fields where you can enter the customer number and the job number. Once you hit the Enter button, it takes you to Shop_Order_Rpt.htm and brings along the customer and job numbers. Shop_Order_Rpt.htm is the file that actually calls the Crystal Report. Function LoadReport() is where the sql command and open statements are located which is ran in the OnLoad event of the Body.

Hope that helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top