Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can i add table in the data environment of report.
Message
From
02/10/2001 04:03:01
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
01/10/2001 16:06:38
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00562575
Message ID:
00562894
Views:
31
>Hi Cetin
>
>Could you please explain why not to add tables in data environment,and what is the best practice to generate a report with more than one tables !!
>
>Thanks

Akhan,
When a report is called from a routine (unless wrapped in a private datasession) it can access to any table, cursor, variable (including locals), object that the routine itself can access.
When you have multiple tables it's not easy to set them up right in a dataenvironment. For example in its simpliest form think of customer-orders. You set the relation but if you fail to set skip then you'd end up 1 order per customer. Much more complex samples are possible.
Instead if I executed this :
select * from customer c ;
  join orders o on c.cust_id=o.cust_id into cursor crsReport
report form CustOrders preview
I could follow this with a report form to get what I want. I could extend it with a where clause. Up till now no superiority to a report with DE tables. Think for a moment you needed the same exact report but using totally different tables even with different field names (but report would be same and using say fields cust_id, company, order_id,order_date). I have this exact situation in real world app where there are too many reports with mostly only tables are changing (and criteria). In final product I have many cursor preparing routines but few frxes.
select myId as cust_id, ;
 myComp as Company, ;
 myOId as Order_id, ;
 myDate as order_date ;
 from myClients c join myInvoices i on c.myId = i.compid ;
 into cursor crsAnother
report form CustOrders preview
IOW we strip data source from report definition. Using SQLs for report is a nice flexible way. But it doesn't matter if you wanted to use tables with relations only. If they're in form.de already just select the main (parent) and run report. If not you could set up new tables relations and fire report. Even temporarily you could start a new private datasession in a routine, set up tables, report and end session. All these flexibility is rendered useless if table is in report.DE. Wish VFP never supported it but I think it's a matter of backward compatibility to fox2x.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform