You will need to:
- create a new InfoPath form from a Data Connection (Design a form | New
from Data Connection
- specify a data source structure. Pull in all three tables from the
database. InfoPath will automatically determine the relationship between
them; if you want to tweak the query, use the "Edit SQL..." button.
- create two views in your form template: "TripList" for the list of
trips, "TripDetail" one for trip details.
- In TripList, create a repeating table and bind it to the list of
trips. Show high-level info about each trip. Also, in this repeating
table, add a button to repeating row that would
- set the SelectedTripID node (you will need to add a node to
your Data Source) to TripId of the current row
- switch the view to TripDetail
- In TripDetail, put controls that would should details for a particular
trip. You will need to show the details for a particular trip that the
user specified in SelectedTripID - use filtering.
This should get your basic functionality covered.
If you are looking for more performance, use dynamic queries on click of
the "see details" button in TripList; this dynamic query would generate
SQL on the fly and perform a DB lookup to get the details about a
particular trip, not all trips.
Good luck!
-Alex @ Microsoft
-----Original Message-----
From: kfrost [mailto:kfrost@discussions.microsoft.com]
Posted At: Wednesday, May 04, 2005 8:21 AM
Posted To: microsoft.public.infopath
Conversation: InfoPath Toolkit for VS and Master/Detail view with SQL
Subject: InfoPath Toolkit for VS and Master/Detail view with SQL
Hello,
I'm trying to create a form called triplog. I have a SQL db that has 3
tables. Trips, Fuel, Mileage.
Trips has a primary Key Trip ID that is linked to all the other fields.
My main view I have a secondary list datasource that populates a table
with
high trip info. I also have a button to the left of each item when
clicked I
would like to bring up a Trip Detail view for all the detailed
information
about the trip. I need the info pulled from all 3 sql tables with the
option
to also format the data as well.
I've searched and searched for documentation or example on how to do
this.
All I can find is an example in the SDK which is using a xml file. THen
you
have the DataInterop example however, it's created using script plus you
can't see the info in a lot of the views because I suppose the xsl files
were
manually coded and it's difficult to sort through with the poor
documentation
associated with it.
My question is does anybody have a simple code example of what I'm
trying to
do? Or are there any good books or examples out there of using building
and
programming Infopath projects in Visual Studio?
Any help would be greatly appreciated!