Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printing dynamic SELECT statement result with report dsg
Message
 
 
To
09/01/2002 19:07:49
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00602769
Message ID:
00602798
Views:
26
Take a look at 'CREATE REPORT – Quick Report Command'
 lcTempTable = < Some Temp File Name >
SELECT last,first from myTable1 where last='CHAMP' ;
INTO table ( lcTempTable )
CREATE REPORT FileName1 FROM ( lcTempTable )
REPORT FORM FileName1 ...
>I have a report designed with headings, etc. The report prints result of SQL SELECT statement, but the SELECT statement is dynamic: it changes according to what user sets.
>
>Example:
>SELECT last,first from myTable1 where last='CHAMP'
>
>and another time it would be:
>SELECT last,dob from myTable2 ORDER by last
>etc.
>
>I have it set right now where in the report designer, there is only 1 long row (as can fit in a page) as exp1. Then the program passes exp1 to the report, to have it printed. exp1=the SQL SELECT statement. The problem is, exp1 must be a long character string. I have to convert all the fields to a string which makes the SELECT statement too long & when it gets too long, I get an error message. For example:
>exp1='SELECT last+space(4)+str(idnumber,5) FROM myTable'
>This can be very long & complicated with ORDER BY & WHERE clause, etc.
>
>How can I best print a dynamic SQL SELECT result into a report?
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform