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

Report in vfp

Status
Not open for further replies.

keepfoxing

Programmer
Dec 9, 2015
37
PH
greetings!
can anybody help me to display this on a report:
Code:
name: John Doe
1st Year
Semester: 1
|subject|grade|yr|
------------------
|English|95   |1 |

Semester: 2
|subject|grade|yr|
------------------
|Math   |85   |1 |

2nd Year
Semester: 1
|subject  |grade|yr|
------------------
|English 1|94   |2 |

Semester: 2
|subject|grade|yr|
------------------
|Math 1 |84   |2 |
i use this code but it displays all..
Code:
REPORT FORM report PREVIEW FOR id = thisform.text2.Value

thanks in advance..
 
It's not at all clear from your question what the problem is. Are you saying that the FOR clause is not working? That the report is showing all the records in the cursor, when you only want to show those with a certain ID value?

If so, are you sure the textbox contains the correct value? Have you checked the setting of EXACT? Are there trailing spaces in the textbox? For that matter, what is the data type of the text box?

Some more imformation about the nature of the problem would be helpful.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
If your report uses a private datasession, does FOR have any influence at all? It's actually a filter of the current workarea and assumed you use that as report driving data with a report without a private dataenvironment.

Bye, Olaf.
 

i can now display the first table with this..
Code:
	REPORT FORM c:\system\reports\curriculum.frx PREVIEW FOR id_no = tor_table.id_no AND tor_table.sem="1" AND tor_table.yr="1"

but how to code the other table to show in one report..
 
For report, always run it from a cursor, not from a table. And when you have the cursor, you can do all kinds of magic with it before you run the actual report.
 
Sory, I must be having a slow day. I still don't get what the problem is.

You talk about the "first table" and the "other table". You show the code for two different reports, with completely different FOR clauses. And somehow we are supposed to understand what you are trying to do and what is going wrong.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
If tor_table is the table you are reporting the condition id_no = tor_table.id_no is self referential and does nothing.

You have to see what's driving the report in the report designer, so please go into c:\system\reports\curriculum.frx via MODIFY REPORT c:\system\reports\curriculum.frx and take a look at the report properties. What is configured in the Data Environment tab? Is the Checkbox "Report uses a private data session" checked? Then your for clause either has no effect or is applied to the initial selected alias.

I do as Tore (tbleken) and let a cursor drive my reports, that gives me full control to query data I want to print previous to doing the report and to feed it with that cursor. The checkbox about private datasession is unchecked for that matter, so the report driving data is the current workarea of the current datasession. That's making lots of things easier, eg just reporting the part of the data you want to print.

Anyway, before you alter the report just tell us how it's set up.

Bye, Olaf.
 
Based on the data shown in your original post
name: John Doe
1st Year
Semester: 1
|subject|grade|yr|
------------------
|English|95 |1 |

It looks as though your single Report Cursor (Not Table 1, Table 2, etc.) should have the various fields
Name, Year, Semester, Subject, Grade, Yr

And your Report Form should have Groups set up for:
* Name
* Year
* Semester
the rest of the fields would be general Detail.

You might want to look at the on-line (or downloadable) tutorial videos at:
While VFP9 has some more advanced Report Form features, you might get the basics understood with Basic Reporting - Parts 1 & 2

Good Luck,
JRB-Bldr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top