Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #1361 > unrolled thread

Vo2Ado & Report Pro

Started byRob van Erk <erk.v@hotmail.com>
First post2011-06-12 10:03 -0700
Last post2011-06-14 09:52 -0700
Articles 13 — 4 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  Vo2Ado & Report Pro Rob van Erk <erk.v@hotmail.com> - 2011-06-12 10:03 -0700
    Re: Vo2Ado & Report Pro E®!k \\/!$$E® <nospam@nospam.url> - 2011-06-12 20:04 +0200
    Re: Vo2Ado & Report Pro "Geoff Schaller" <geoffx@softwarexobjectives.com.au> - 2011-06-12 23:43 +0000
      Re: Vo2Ado & Report Pro Rob van Erk <erk.v@hotmail.com> - 2011-06-13 00:08 -0700
    Re: Vo2Ado & Report Pro "Willie Moore" <williem@wmconsulting.com> - 2011-06-13 08:04 -0500
      Re: Vo2Ado & Report Pro Rob van Erk <erk.v@hotmail.com> - 2011-06-13 07:25 -0700
        Re: Vo2Ado & Report Pro E®!k \\/!$$E® <nospam@nospam.url> - 2011-06-13 17:34 +0200
          Re: Vo2Ado & Report Pro "Willie Moore" <williem@wmconsulting.com> - 2011-06-13 10:56 -0500
            Re: Vo2Ado & Report Pro Rob van Erk <erk.v@hotmail.com> - 2011-06-13 10:13 -0700
              Re: Vo2Ado & Report Pro Rob van Erk <erk.v@hotmail.com> - 2011-06-13 12:28 -0700
                Re: Vo2Ado & Report Pro E®!k \\/!$$E® <nospam@nospam.url> - 2011-06-13 21:57 +0200
                  Re: Vo2Ado & Report Pro E®!k \\/!$$E® <nospam@nospam.url> - 2011-06-13 21:59 +0200
                    Re: Vo2Ado & Report Pro Rob van Erk <erk.v@hotmail.com> - 2011-06-14 09:52 -0700

#1361 — Vo2Ado & Report Pro

FromRob van Erk <erk.v@hotmail.com>
Date2011-06-12 10:03 -0700
SubjectVo2Ado & Report Pro
Message-ID<651ec04c-5b62-4668-b010-d4c6cb2bea34@n11g2000yqf.googlegroups.com>
Hello all,

Two questions:

1) Are there any examples available on how to export SQL Data (VO2.8
using Vo2Ado) to another format like Excel? I have some examples
showing SQL data in bBrowser cells but no idea how I can export data
to Excel format.

2) I am using Report Pro 3.9 but do not understand how I can open a
SQL database in Report Pro. In this forum I read something about using
RDD but not sure what is exactly meant. By default I think I need to
use some ODBC connection method in Report Pro but preferably I use Ado
directly from within ReportPro (if possible).

It has been a long time since I have been working with VO so any help
to support me to start up using VO again would be helpful.

Thks,

[toc] | [next] | [standalone]


#1362

FromE®!k \\/!$$E® <nospam@nospam.url>
Date2011-06-12 20:04 +0200
Message-ID<95kdcoFddlU1@mid.individual.net>
In reply to#1361
Hi Rob,

1) there are several ways to do this.
a) use automation, open a Excel worksheet and pass and array with your data 
to a Excel range.
b) use the AdoRecordSet:Getstring() method to create a CSV file.

2) have you studied the VO2ADO  report pro samples?

regards,

Erik



"Rob van Erk"  schreef in bericht 
news:651ec04c-5b62-4668-b010-d4c6cb2bea34@n11g2000yqf.googlegroups.com...

Hello all,

Two questions:

1) Are there any examples available on how to export SQL Data (VO2.8
using Vo2Ado) to another format like Excel? I have some examples
showing SQL data in bBrowser cells but no idea how I can export data
to Excel format.

2) I am using Report Pro 3.9 but do not understand how I can open a
SQL database in Report Pro. In this forum I read something about using
RDD but not sure what is exactly meant. By default I think I need to
use some ODBC connection method in Report Pro but preferably I use Ado
directly from within ReportPro (if possible).

It has been a long time since I have been working with VO so any help
to support me to start up using VO again would be helpful.

Thks, 

[toc] | [prev] | [next] | [standalone]


#1366

From"Geoff Schaller" <geoffx@softwarexobjectives.com.au>
Date2011-06-12 23:43 +0000
Message-ID<4df54f3a$0$34824$c30e37c6@exi-reader.telstra.net>
In reply to#1361
Rob,

Exporting data isn't really a function of VO2Ado. As Erik implies, this 
is really an OLE automation issue. You should open your Excel 
spreadsheet and populate the classes accordingly. bBrowser doesn't show 
'sql' data at all. It shows data that is supplied in the form of a 
DataServer class. That data is held either in arrays or connected tables 
(which is represented internally by arrays of course). You need OLE 
examples showing you how to use Excel via automation.

Geoff



"Rob van Erk" <erk.v@hotmail.com> wrote in message 
news:651ec04c-5b62-4668-b010-d4c6cb2bea34@n11g2000yqf.googlegroups.com:

> Hello all,
>
> Two questions:
>
> 1) Are there any examples available on how to export SQL Data (VO2.8
> using Vo2Ado) to another format like Excel? I have some examples
> showing SQL data in bBrowser cells but no idea how I can export data
> to Excel format.
>
> 2) I am using Report Pro 3.9 but do not understand how I can open a
> SQL database in Report Pro. In this forum I read something about using
> RDD but not sure what is exactly meant. By default I think I need to
> use some ODBC connection method in Report Pro but preferably I use Ado
> directly from within ReportPro (if possible).
>
> It has been a long time since I have been working with VO so any help
> to support me to start up using VO again would be helpful.
>
> Thks,

[toc] | [prev] | [next] | [standalone]


#1370

FromRob van Erk <erk.v@hotmail.com>
Date2011-06-13 00:08 -0700
Message-ID<b80b5a20-7f36-430a-9339-3a57edc11913@b1g2000yql.googlegroups.com>
In reply to#1366
Erik, Geoff,

Thanks for the feedback. I will have a more close look to the examples
but initially could not find something that will meet my requirements.
I will also have a look at the AdoRecordSet:Getstring(), that one
seems an interesting one as well.

I think it has been 1.5 to 2 years since I have been working with VO
so need to find my way again :-)

Greetings,
Rob

[toc] | [prev] | [next] | [standalone]


#1375

From"Willie Moore" <williem@wmconsulting.com>
Date2011-06-13 08:04 -0500
Message-ID<it51tl$j1d$1@speranza.aioe.org>
In reply to#1361
Rob,

When I use ReportPro with my SQL datasource, I create an ODBC entry for it 
and call it from the report. I have a function at the start of my program 
which will generate the ODBC entry for me if it doesn’t exist on the 
machine. I tried using the RDD with ReportPro but the ODBC ended up working 
much better. I would be happy to send you the code I use to create the entry 
if you need it. Robert helped me with it when I first started using VO2ADO a 
long time ago.

Regards,
Willie

"Rob van Erk"  wrote in message 
news:651ec04c-5b62-4668-b010-d4c6cb2bea34@n11g2000yqf.googlegroups.com...

Hello all,

Two questions:

1) Are there any examples available on how to export SQL Data (VO2.8
using Vo2Ado) to another format like Excel? I have some examples
showing SQL data in bBrowser cells but no idea how I can export data
to Excel format.

2) I am using Report Pro 3.9 but do not understand how I can open a
SQL database in Report Pro. In this forum I read something about using
RDD but not sure what is exactly meant. By default I think I need to
use some ODBC connection method in Report Pro but preferably I use Ado
directly from within ReportPro (if possible).

It has been a long time since I have been working with VO so any help
to support me to start up using VO again would be helpful.

Thks, 

[toc] | [prev] | [next] | [standalone]


#1376

FromRob van Erk <erk.v@hotmail.com>
Date2011-06-13 07:25 -0700
Message-ID<313c38cc-c3b1-47d1-ac1a-d32d59f3eae5@b1g2000yql.googlegroups.com>
In reply to#1375
Hello Willie,

Would be great if you can forward me some example file. Today I'am
building up some VO knowledge again but it is clear that I have not
worked with VO for a long time.... I'am able now to connect to my MS
SQL database, edit/delete/add records but still some difficulties to
get the AdoRecordSet:Getstring() functionality working. Think I have
to setup some loop to get all the records out of the database. If you
can help met with some code for ReportPro than this will be a great
step forward for me.

I think you can retrieve my email account but I will send you a
separate message within short.

Thanks for your support !

Brgds,
Rob

[toc] | [prev] | [next] | [standalone]


#1377

FromE®!k \\/!$$E® <nospam@nospam.url>
Date2011-06-13 17:34 +0200
Message-ID<95movpFbmuU1@mid.individual.net>
In reply to#1376
Rob,

> I'am building up some VO knowledge again but it is clear that I have
> not worked with VO for a long time....

Programming VO is like riding a bike.
You'll get up speed quickly.

Here is some code that uses RecordSet:GetString()

METHOD EXPORT2file( wExportType ) CLASS Explorer_Verhuur
LOCAL cFile AS STRING
LOCAL ors AS AdoRecordSet
LOCAL cResult AS STRING
LOCAL otb AS TextBox
cFile := GetFileName( wExportType )
cResult := ''
IF !Empty( cFile )
    ors := AdoRecordset{}
    ors:Open( SELF:cPreviousQuery, AdoGetConnection(), adOpenStatic, 
adLockReadOnly, adCmdText )

    IF wExportType = EXPORT_AS_CSV
        cResult := ors:GetString( adClipString, NIL,";",CRLF, "")
    ELSEIF wExportType= EXPORT_AS_TXT
        cResult += ors:GetString( adClipString, NIL,NIL,CRLF, "")
    ELSEIF wExportType=EXPORT_AS_XML
        ors:Save( cFile, adPersistXML )
    ENDIF
    IF !Empty( cResult )
        IF MemoWrit( cFile, cResult )
            otb:=TextBox{,"File successfully created", cFile}
            otb:type:= BUTTONOKAY
            otb:Show()
        ENDIF
    ENDIF

ENDIF
RETURN  NIL

hth

Erik



"Rob van Erk"  schreef in bericht 
news:313c38cc-c3b1-47d1-ac1a-d32d59f3eae5@b1g2000yql.googlegroups.com...

Hello Willie,

Would be great if you can forward me some example file. Today I'am
building up some VO knowledge again but it is clear that I have not
worked with VO for a long time.... I'am able now to connect to my MS
SQL database, edit/delete/add records but still some difficulties to
get the AdoRecordSet:Getstring() functionality working. Think I have
to setup some loop to get all the records out of the database. If you
can help met with some code for ReportPro than this will be a great
step forward for me.

I think you can retrieve my email account but I will send you a
separate message within short.

Thanks for your support !

Brgds,
Rob 

[toc] | [prev] | [next] | [standalone]


#1379

From"Willie Moore" <williem@wmconsulting.com>
Date2011-06-13 10:56 -0500
Message-ID<it5bvq$epb$1@speranza.aioe.org>
In reply to#1377
Erik,

Thanks for the sample.

Regards,
Willie

"E®!k \/!$$E®"  wrote in message news:95movpFbmuU1@mid.individual.net...

Rob,

> I'am building up some VO knowledge again but it is clear that I have
> not worked with VO for a long time....

Programming VO is like riding a bike.
You'll get up speed quickly.

Here is some code that uses RecordSet:GetString()

METHOD EXPORT2file( wExportType ) CLASS Explorer_Verhuur
LOCAL cFile AS STRING
LOCAL ors AS AdoRecordSet
LOCAL cResult AS STRING
LOCAL otb AS TextBox
cFile := GetFileName( wExportType )
cResult := ''
IF !Empty( cFile )
    ors := AdoRecordset{}
    ors:Open( SELF:cPreviousQuery, AdoGetConnection(), adOpenStatic,
adLockReadOnly, adCmdText )

    IF wExportType = EXPORT_AS_CSV
        cResult := ors:GetString( adClipString, NIL,";",CRLF, "")
    ELSEIF wExportType= EXPORT_AS_TXT
        cResult += ors:GetString( adClipString, NIL,NIL,CRLF, "")
    ELSEIF wExportType=EXPORT_AS_XML
        ors:Save( cFile, adPersistXML )
    ENDIF
    IF !Empty( cResult )
        IF MemoWrit( cFile, cResult )
            otb:=TextBox{,"File successfully created", cFile}
            otb:type:= BUTTONOKAY
            otb:Show()
        ENDIF
    ENDIF

ENDIF
RETURN  NIL

hth

Erik



"Rob van Erk"  schreef in bericht
news:313c38cc-c3b1-47d1-ac1a-d32d59f3eae5@b1g2000yql.googlegroups.com...

Hello Willie,

Would be great if you can forward me some example file. Today I'am
building up some VO knowledge again but it is clear that I have not
worked with VO for a long time.... I'am able now to connect to my MS
SQL database, edit/delete/add records but still some difficulties to
get the AdoRecordSet:Getstring() functionality working. Think I have
to setup some loop to get all the records out of the database. If you
can help met with some code for ReportPro than this will be a great
step forward for me.

I think you can retrieve my email account but I will send you a
separate message within short.

Thanks for your support !

Brgds,
Rob 

[toc] | [prev] | [next] | [standalone]


#1381

FromRob van Erk <erk.v@hotmail.com>
Date2011-06-13 10:13 -0700
Message-ID<9f79fe77-3e07-470d-ad8f-50d10f73056e@n11g2000yqf.googlegroups.com>
In reply to#1379
Thanks to all! I should be able to make some progress now :-)

[toc] | [prev] | [next] | [standalone]


#1382

FromRob van Erk <erk.v@hotmail.com>
Date2011-06-13 12:28 -0700
Message-ID<174987e1-4fcf-40d6-a1c6-c8fec5c2dabc@r20g2000yqd.googlegroups.com>
In reply to#1381
Erik,

One question about your code. I created a Datawindow and added a
bBrowser using an ADO Server. All works fine. But, using a "Export to
CSV" button I would like to export the currently shown data of the
datawindow using your EXPORT2file method. However, in the method a new
AdoRecordSet is defined and it is using SELF:cPreviousQuery as first
parameter to open the database. How can I just use the EXPORT2File
method to export the data that is shown in bBrowser without a need to
include a new query statement as first parameter in the method? So,
basically I like to use a kind of "use current open AdoRecordset" to
simply export the data to CSV without running a SQL statement in the
EXPORT2File method.

Hope you can help me.

Thks,
Rob

[toc] | [prev] | [next] | [standalone]


#1383

FromE®!k \\/!$$E® <nospam@nospam.url>
Date2011-06-13 21:57 +0200
Message-ID<95n8d4F5eoU1@mid.individual.net>
In reply to#1382
Did not try, but AdoServer:Recordset should do the job.
Note that if you change the column order in bBrowser, this will not be seen 
in the Recordset.

Erik



Erik

"Rob van Erk"  schreef in bericht 
news:174987e1-4fcf-40d6-a1c6-c8fec5c2dabc@r20g2000yqd.googlegroups.com...

Erik,

One question about your code. I created a Datawindow and added a
bBrowser using an ADO Server. All works fine. But, using a "Export to
CSV" button I would like to export the currently shown data of the
datawindow using your EXPORT2file method. However, in the method a new
AdoRecordSet is defined and it is using SELF:cPreviousQuery as first
parameter to open the database. How can I just use the EXPORT2File
method to export the data that is shown in bBrowser without a need to
include a new query statement as first parameter in the method? So,
basically I like to use a kind of "use current open AdoRecordset" to
simply export the data to CSV without running a SQL statement in the
EXPORT2File method.

Hope you can help me.

Thks,
Rob 

[toc] | [prev] | [next] | [standalone]


#1384

FromE®!k \\/!$$E® <nospam@nospam.url>
Date2011-06-13 21:59 +0200
Message-ID<95n8gtF6b0U1@mid.individual.net>
In reply to#1383
Grazy suggestion, I know: perhaps you should have a look at the docs, for a 
start just to see what is in there?

Erik


"E®!k \/!$$E®"  schreef in bericht news:95n8d4F5eoU1@mid.individual.net...

Did not try, but AdoServer:Recordset should do the job.
Note that if you change the column order in bBrowser, this will not be seen
in the Recordset.

Erik



Erik

"Rob van Erk"  schreef in bericht
news:174987e1-4fcf-40d6-a1c6-c8fec5c2dabc@r20g2000yqd.googlegroups.com...

Erik,

One question about your code. I created a Datawindow and added a
bBrowser using an ADO Server. All works fine. But, using a "Export to
CSV" button I would like to export the currently shown data of the
datawindow using your EXPORT2file method. However, in the method a new
AdoRecordSet is defined and it is using SELF:cPreviousQuery as first
parameter to open the database. How can I just use the EXPORT2File
method to export the data that is shown in bBrowser without a need to
include a new query statement as first parameter in the method? So,
basically I like to use a kind of "use current open AdoRecordset" to
simply export the data to CSV without running a SQL statement in the
EXPORT2File method.

Hope you can help me.

Thks,
Rob 

[toc] | [prev] | [next] | [standalone]


#1405

FromRob van Erk <erk.v@hotmail.com>
Date2011-06-14 09:52 -0700
Message-ID<f701d9cb-e0bb-4515-ba8f-3ea52aaf0eaa@c41g2000yqm.googlegroups.com>
In reply to#1384
Hi Erik,

Thanks for the info. Already looked at the documentation but
apparently I missed something.

Will check again.

Brgds,
Rob

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web