i am using vs.net 2003 thats comes with crystal report, i create the report look, now i wan tot set some sql statement on there, is there and where i can create in crystal report and not from vb.net programming code? i saw there is a sql expression field but there is not those, select, update, delete command for me to choose. can you all guide me how?When you add fields to the report, and create groups, Crystal is building its own SQL statement, which you see in the SQL Statement.
So once you have defined a connection to the database, and then selected tables and defined their links, the FROM part of an SQL statement has been created by crystal.
Then when you add fields, they will appear in the SELECT portion of the statement.
When you create a group, this should appear in the GROUP BY clause.
And so on.
If you have some conditions that you wish to apply (like a date range or similar), use the "Edit Selection Formula" under the Rport heading to define what will appear in your WHERE statement.
Having said that, once Crystal has built up this SQL statement, it is possible to do some editing on it to further define your fields. Say you want to add a calculated field as part of your SQL output, in the SELECT statement you might add something like this:
,
(BoxesMade * NumberInBox) as TotalProduction
and Crystal should make that Field available to add to the report (because its data calculated from data already available in the linked tables).
Hope this helps you understand what's going on behind the scenes
Dave
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment