Thanks, it really WAS fun.
After I failed to be able to use the selected TableName as a
variable, I almost gave up. Then I realized I could place the actual
name in a text file, then run it.
This must be what Vantage does with its export. Yesterday I
remembered people saying they found remnants of export code after
cancelling the Vantage export.
Good luck
After I failed to be able to use the selected TableName as a
variable, I almost gave up. Then I realized I could place the actual
name in a text file, then run it.
This must be what Vantage does with its export. Yesterday I
remembered people saying they found remnants of export code after
cancelling the Vantage export.
Good luck
--- In vantage@y..., "Mark Dupuis" <dupuism@r...> wrote:
> Hello Lonnie,
> You knew where I was heading with all my questions and you
basically
> created the program I was working on. This little jewel you've
created
> answers a lot of my questions. I really like the external table2.p
file.
> Very clever! I never would of thought to simply create another .p
file from
> within my program. If I did I would not of known how to do it.
You have
> furthered my education and opened up a hole new realm of
possibilities,
> THANK YOU :)
> Mark
>
>
> -----Original Message-----
> From: lonniedrew [mailto:lonniedrew@c...]
> Sent: Saturday, August 10, 2002 11:36 AM
> To: vantage@y...
> Subject: [Vantage] Re: exporting to csv
>
>
> I hate it when you guys pose an interesting programming problem.
>
> I had to see if I could do it; so far it cost me 4+ hours of study
> and design. But it was fun.
>
> The source code I just uploaded lets the user select a table, then
> select fields for export. Run from an icon.
>
>
> --- In vantage@y..., William Colls <william@p...> wrote:
> > Mea Culpa.
> >
> > try the following, and see notes below.
> >
> > > define variable done-first as logical.
> > > output to mytest.txt.
> > > find _file no-lock
> > > where _file._file-name EQ "part".
> > > for each _field no-lock of _file by _order:
> > > if not done-first
> > > then done-first = true.
> > > else put ",".
> > > if _field._label EQ ?
> > > then put unformatted '"' _field._field-name '"'.
> > > else put unformatted '"' _field._label '"'.
> > > end.
> > > put skip.
> > >
> > > /* now put the data records into the file */
> > >
> > > For each part:
> > > export delimiter ',' part.
> > > end.
> > > output close.
> > >
> > Mark Dupuis wrote:
> >
> > <snip>
> >
> > >
> > > This is what I think I know?
> > > 1) _file is a table of all the database table names i.e.
> customer, jobmtl,
> > > part, etc.
> >
> > Correct.
> >
> > >
> > > 2) _file-name is the field which has the table names
> >
> > Correct
> >
> > >
> > > 3) this goes through the fields in _file
> > > 4-9) put a delimiter before each field except the first.
> >
> > Correct. Also don't put a comma after the last field.
> >
> > >
> > > 10) part is the name of a buffer which holds one record from
the
> part
> > > table?
> >
> > correct.
> >
> > >
> > > 11) output the record using "," as the delimiter.
> >
> > Correct. You can substitute any character as the delimiter.
> >
> > >
> > > Problem A: The csv file created has column headings and data but
> they do not
> > > match. For example the first column is labeled "Avg. Burden"
but
> the data
> > > is company name.
> >
> > My error, and I should know better. We need to sort the fields
> using the _order field, so they are in the same sequence as the
dump.
> >
> > >
> > >
> > > Problem B: I also have tried to replace the table name "Part"
> with a
> > > variable, something like tablein, this creates real problems
with
> lines
> > > 10-12. How to I reference the buffer using a variable value?
> >
> > Before dynamic queries in version 9, you can't. There are
> techniques to get around this limitation, and if you need to do this
> let me know, and I will post the procedures.
> > Not difficult, but require a little bit of "fiddling".
> >
> > >
> > >
> > > Am I making any sense? I would be grateful for any help I can
> get.
> > > TIA
> >
> > Eminent good sense, and I apologize for making life more difficult
> than necessary.
> >
> > >
> > > Mark
> > >
> > >
> > > Useful links for the Yahoo!Groups Vantage Board are: ( Note:
You
> must have already linked your email address to a yahoo id to enable
> access. )
> > > (1) To access the Files Section of our Yahoo!Group for Report
> Builder and Crystal Reports and other 'goodies', please goto:
> http://groups.yahoo.com/group/vantage/files/.
> > > (2) To search through old msg's goto:
> http://groups.yahoo.com/group/vantage/messages
> > > (3) To view links to Vendors that provide Vantage services goto:
> http://groups.yahoo.com/group/vantage/links
> > >
> > > Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
> >
> > --
> > /*
> ================================================================= */
> >
> > Sailors, with their inbuilt sense of order and good discipline,
> should
> > really be running the world.
> >
> > William E. Colls Tel 613 591
> 0079
> > PROComputer Systems Fax 613 591
> 3924
> > 67 Willow Glen Drive
> www.procomsys.com
> > Kanata Ontario Canada K2M 1T1 PEG
> 1988051404
>
>
>
> Useful links for the Yahoo!Groups Vantage Board are: ( Note: You
must have
> already linked your email address to a yahoo id to enable access. )
> (1) To access the Files Section of our Yahoo!Group for Report
Builder and
> Crystal Reports and other 'goodies', please goto:
> http://groups.yahoo.com/group/vantage/files/.
> (2) To search through old msg's goto:
> http://groups.yahoo.com/group/vantage/messages
> (3) To view links to Vendors that provide Vantage services goto:
> http://groups.yahoo.com/group/vantage/links
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/