distribute .rpt file using VB control and OLEDB 
Author Message
 distribute .rpt file using VB control and OLEDB

Does anyone know how to distribute a report with an application?  I am using
VB6 with an OLEDB connection to SQL Server 7.  I need to have the .rpt file
separate and use the vb control to load the data into the report.  With
OLEDB if I make a report(.rpt file) on my network how can I send it to a new
network and have it work correctly there?  Why does it verify the old
datasource before it will connect to a new one?  That makes no sense to me.
Any answers would make my life much easier.
Thanks,
Brock




Wed, 06 Mar 2002 03:00:00 GMT  
 distribute .rpt file using VB control and OLEDB
if you ever find the answer to that, please let me know, I am having the
same problem.


Thu, 07 Mar 2002 03:00:00 GMT  
 distribute .rpt file using VB control and OLEDB
I am assuming you are using CR 7.0. Look in the start-menu folder where
CR installed itself and look for the "Runtime file requirements"
helpfile. In this helpfile you can look up what files you have to
distribute with the various types of reports CR makes.

Also, when you use the VB Package and Deployment wizard, It
automatically adds ( almost ) all necessary files you need to run the
report. I say alomost, because there are one or two files it forgets,
and you will have to add them manually ( SSTREE32.DLL or PCTREE32.DLL
one of them is called )

About connecting, I too had trouble connecting a .RPT to an OLE-DB
datasource. It turned out that you have to supply the Connect metohd of
the OCX an ODBC-style connectstring, not an ADO-style one.

Hope this helps,

Michel Berger



Quote:
> Does anyone know how to distribute a report with an application?  I
am using
> VB6 with an OLEDB connection to SQL Server 7.  I need to have
the .rpt file
> separate and use the vb control to load the data into the report.
With
> OLEDB if I make a report(.rpt file) on my network how can I send it
to a new
> network and have it work correctly there?  Why does it verify the old
> datasource before it will connect to a new one?  That makes no sense
to me.
> Any answers would make my life much easier.
> Thanks,
> Brock



Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


Mon, 11 Mar 2002 03:00:00 GMT  
 distribute .rpt file using VB control and OLEDB
I am using the ODBC style connect string.
    .connect = dsn=server;uid=username;pwd=password;
It still will not overwrite the saved properties at runtime like it should
unless the saved information is already valid for their network.  I can't
require all my clients to purchase CR so they can set their report
datasource.  Isn't that why we set them in the control?  This is the worst
logic I have ever seen.  Anyone doing this some way that works?  Another
driver maybe, native SQL Server maybe?
Thanks,
Brock

]
Quote:

>I am assuming you are using CR 7.0. Look in the start-menu folder where
>CR installed itself and look for the "Runtime file requirements"
>helpfile. In this helpfile you can look up what files you have to
>distribute with the various types of reports CR makes.

>Also, when you use the VB Package and Deployment wizard, It
>automatically adds ( almost ) all necessary files you need to run the
>report. I say alomost, because there are one or two files it forgets,
>and you will have to add them manually ( SSTREE32.DLL or PCTREE32.DLL
>one of them is called )

>About connecting, I too had trouble connecting a .RPT to an OLE-DB
>datasource. It turned out that you have to supply the Connect metohd of
>the OCX an ODBC-style connectstring, not an ADO-style one.

>Hope this helps,

>Michel Berger



>> Does anyone know how to distribute a report with an application?  I
>am using
>> VB6 with an OLEDB connection to SQL Server 7.  I need to have
>the .rpt file
>> separate and use the vb control to load the data into the report.
>With
>> OLEDB if I make a report(.rpt file) on my network how can I send it
>to a new
>> network and have it work correctly there?  Why does it verify the old
>> datasource before it will connect to a new one?  That makes no sense
>to me.
>> Any answers would make my life much easier.
>> Thanks,
>> Brock


>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.



Mon, 11 Mar 2002 03:00:00 GMT  
 distribute .rpt file using VB control and OLEDB
what you need to do is open your .rpt file as a Report object using the
CRAXDT.Application object, then set the location of each
table/query/view individually using the Report object heirarchy. Then
attach it to the smart viewer.

here's a code snippet that sets the table locations:
GetReport is a Report object
m_objApp is an Application object

   Set GetReport = m_objApp.OpenReport(strFilename,
crOpenReportByTempCopy)

    'set table locations to current database
    For i = 1 To GetReport.Database.Tables.Count
        GetReport.Database.Tables.Item(i).Location = strDatabase
    Next

    'sets locations to all tables in the subreport
    For Each objSect In GetReport.Sections
        For Each obj In objSect.ReportObjects
            If TypeOf obj Is SubreportObject Then
                With obj.OpenSubreport
                    For i = 1 To .Database.Tables.Count
                        .Database.Tables.Item(i).Location = strDatabase
                    Next
                End With
            End If
        Next
    Next

I hope this helps.
Ben



Quote:
> I am using the ODBC style connect string.
>     .connect = dsn=server;uid=username;pwd=password;
> It still will not overwrite the saved properties at runtime like it
should
> unless the saved information is already valid for their network.  I
can't
> require all my clients to purchase CR so they can set their report
> datasource.  Isn't that why we set them in the control?  This is the
worst
> logic I have ever seen.  Anyone doing this some way that works?
Another
> driver maybe, native SQL Server maybe?
> Thanks,
> Brock

> ]



- Show quoted text -

Quote:
> >I am assuming you are using CR 7.0. Look in the start-menu folder
where
> >CR installed itself and look for the "Runtime file requirements"
> >helpfile. In this helpfile you can look up what files you have to
> >distribute with the various types of reports CR makes.

> >Also, when you use the VB Package and Deployment wizard, It
> >automatically adds ( almost ) all necessary files you need to run the
> >report. I say alomost, because there are one or two files it forgets,
> >and you will have to add them manually ( SSTREE32.DLL or PCTREE32.DLL
> >one of them is called )

> >About connecting, I too had trouble connecting a .RPT to an OLE-DB
> >datasource. It turned out that you have to supply the Connect metohd
of
> >the OCX an ODBC-style connectstring, not an ADO-style one.

> >Hope this helps,

> >Michel Berger



> >> Does anyone know how to distribute a report with an application?  I
> >am using
> >> VB6 with an OLEDB connection to SQL Server 7.  I need to have
> >the .rpt file
> >> separate and use the vb control to load the data into the report.
> >With
> >> OLEDB if I make a report(.rpt file) on my network how can I send it
> >to a new
> >> network and have it work correctly there?  Why does it verify the
old
> >> datasource before it will connect to a new one?  That makes no
sense
> >to me.
> >> Any answers would make my life much easier.
> >> Thanks,
> >> Brock


> >Sent via Deja.com http://www.deja.com/
> >Share what you know. Learn what you don't.

Sent via Deja.com http://www.deja.com/
Before you buy.


Tue, 12 Mar 2002 03:00:00 GMT  
 distribute .rpt file using VB control and OLEDB
What a pain.  Shouldn't the OCX control if it was worth anything be able to
do this?  I can change servers, databases and tables with the OCX control as
long as it is running on my network.  As soon as I send it to another
network it fails.  If you change the default to a location on the new
network then you can change all the parameters to anything on that network
at runtime.  The report needs to verify the saved information before you can
set a new location.  It is lame but that's how it is.  It should be able to
set the new location at runtime regardless of the saved locations if they
aren't being used anyway.
Brock

Quote:

>what you need to do is open your .rpt file as a Report object using the
>CRAXDT.Application object, then set the location of each
>table/query/view individually using the Report object heirarchy. Then
>attach it to the smart viewer.

>here's a code snippet that sets the table locations:
>GetReport is a Report object
>m_objApp is an Application object

>   Set GetReport = m_objApp.OpenReport(strFilename,
>crOpenReportByTempCopy)

>    'set table locations to current database
>    For i = 1 To GetReport.Database.Tables.Count
>        GetReport.Database.Tables.Item(i).Location = strDatabase
>    Next

>    'sets locations to all tables in the subreport
>    For Each objSect In GetReport.Sections
>        For Each obj In objSect.ReportObjects
>            If TypeOf obj Is SubreportObject Then
>                With obj.OpenSubreport
>                    For i = 1 To .Database.Tables.Count
>                        .Database.Tables.Item(i).Location = strDatabase
>                    Next
>                End With
>            End If
>        Next
>    Next

>I hope this helps.
>Ben



>> I am using the ODBC style connect string.
>>     .connect = dsn=server;uid=username;pwd=password;
>> It still will not overwrite the saved properties at runtime like it
>should
>> unless the saved information is already valid for their network.  I
>can't
>> require all my clients to purchase CR so they can set their report
>> datasource.  Isn't that why we set them in the control?  This is the
>worst
>> logic I have ever seen.  Anyone doing this some way that works?
>Another
>> driver maybe, native SQL Server maybe?
>> Thanks,
>> Brock

>> ]


>> >I am assuming you are using CR 7.0. Look in the start-menu folder
>where
>> >CR installed itself and look for the "Runtime file requirements"
>> >helpfile. In this helpfile you can look up what files you have to
>> >distribute with the various types of reports CR makes.

>> >Also, when you use the VB Package and Deployment wizard, It
>> >automatically adds ( almost ) all necessary files you need to run the
>> >report. I say alomost, because there are one or two files it forgets,
>> >and you will have to add them manually ( SSTREE32.DLL or PCTREE32.DLL
>> >one of them is called )

>> >About connecting, I too had trouble connecting a .RPT to an OLE-DB
>> >datasource. It turned out that you have to supply the Connect metohd
>of
>> >the OCX an ODBC-style connectstring, not an ADO-style one.

>> >Hope this helps,

>> >Michel Berger



>> >> Does anyone know how to distribute a report with an application?  I
>> >am using
>> >> VB6 with an OLEDB connection to SQL Server 7.  I need to have
>> >the .rpt file
>> >> separate and use the vb control to load the data into the report.
>> >With
>> >> OLEDB if I make a report(.rpt file) on my network how can I send it
>> >to a new
>> >> network and have it work correctly there?  Why does it verify the
>old
>> >> datasource before it will connect to a new one?  That makes no
>sense
>> >to me.
>> >> Any answers would make my life much easier.
>> >> Thanks,
>> >> Brock


>> >Sent via Deja.com http://www.deja.com/
>> >Share what you know. Learn what you don't.

>Sent via Deja.com http://www.deja.com/
>Before you buy.



Tue, 12 Mar 2002 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Help: Different result in distributed rpt using Crystal Reports6 with ActiveX)

2. Help: Different result in distributed rpt using Crystal Reports6 with ActiveX)

3. Not distributing .rpt files

4. Crystal Reports 7.0 - Modify RPT File and generate RPT file at runtime

5. Specifiying a Workgroup File When Using ADO to Open an Access .mdb file (OLEDB)

6. How do I distribute saved Rpt reports?

7. Using different .rpt Files?

8. Disabled print button in preview of .rpt file called using print engine

9. How to create Viewer for rpt files using RDC

10. using CRViewer and .rpt files

11. Viewwing rpt files using the browser

12. .rpt File size very large when using crystal dictionary

 

 
Powered by phpBB® Forum Software