 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Sherry Guest
|
Posted: Wed Mar 03, 2004 4:18 am Post subject: Switching to Crystal Reports |
|
|
I need to set the sql and insert an image dynamically from Delphi. Can
someone tell me why the last line in this sql statement does not work:
Crpe1.SQL.Clear;
Crpe1.SQL.Query.Add('SELECT RE.`MLS#`, RE.`Area`, RE.`Remarks`,
RE.`ListPrice`');
Crpe1.SQL.Query.Add('FROM`RE` RE ');
Crpe1.SQL.Query.Add('WHERE RE.`MLS#` = ' + chr(34) +
dmData.tblData.FieldByName('MLS#').AsString + chr(34));
// the last line gives me a runtime error when I execute the report - if I
comment it out the top two work fine without the where clause
I also tried:
Crpe1.SQL.Clear;
Crpe1.SQL.Query.Add('SELECT RE.`MLS#`, RE.`Area`, RE.`Remarks`,
RE.`ListPrice`');
Crpe1.SQL.Query.Add('FROM`RE` RE ');
Crpe1.SQL.Query.Add('WHERE RE.`MLS#` = ''1054''');
//this runs okay but I don't get my record - only a blank report
//I copied the sql exactly as it was in the crystal reports designer so I
don't know what else to do
Also, I do not know how to set the image dynamically from file from within
delphi.
Thanks for any insight....
|
|
| Back to top |
|
 |
Brion L. Webster Guest
|
Posted: Wed Mar 03, 2004 7:34 pm Post subject: Re: Switching to Crystal Reports |
|
|
Sherry wrote:
| Quote: | I need to set the sql and insert an image dynamically from
Delphi. Can someone tell me why the last line in this sql
statement does not work:
|
To my knowledge, Crystal does not support dynamic images, neither
from a database nor from a runtime file location. Crystal 10 might
have changed that.
Crystal also does not support altering the From clause.
To get around that, use the TCrpeDS component. Select the data in
whatever TQuery type component you want, set the TCrpeDS to point
to your TQuery, and tell your report to use that data. The help
file was pretty decent last time I looked.
The drawback is you have to design your report to be "Active Data,
Field Definitions Only" against a text field roster file, with tab
delimeters (not spaces). It makes previewing grouping actions a
little tricky. I wrote a routine to auto-generate .ttx files for
you from a TDataset, I usually get the TQuery I want, generate the
..ttx file in one compile, then comment out that line in the code
for the next compile.
http://home.comcast.net/~brionwebster/Crystal.html
has the routine, if you're interested. It's on codecentral too, I
think.
-Brion
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|