Help with ttx 
Author Message
 Help with ttx

HI everyone :-)

I have a problem using VB6SP5 with a report created in CR 8.5 dev.

The report's fields definitions are in a ttx file, and in CR everything
works fine (if I try the preview, I can see the sample data that I wrote
into the ttx file). But if I try to pass a recordset to the report from VB,
I don't see anything!

Here is the code I use:

     rs.Open "SELECT * FROM r001", cn, adOpenForwardOnly, adLockReadOnly

     With frmReport.CRViewer1

          Set rpt = rdApp.OpenReport(repPath & FastQuery(cn, "SELECT
NomeFile FROM _sys_Reports WHERE Codice=1"))
          rpt.Database.Tables(1).SetDataSource rs
          rpt.ParameterFields(1).AddCurrentValue 7

          .ReportSource = rpt

          .ViewReport
     End With

     frmReport.Show
     rs.Close

Can anyone help me? Thanks!



Mon, 29 Aug 2005 20:03:12 GMT  
 Help with ttx


Quote:
> HI everyone :-)

> I have a problem using VB6SP5 with a report created in CR 8.5 dev.

> The report's fields definitions are in a ttx file, and in CR everything
> works fine (if I try the preview, I can see the sample data that I wrote
> into the ttx file). But if I try to pass a recordset to the report from
VB,
> I don't see anything!

> Here is the code I use:

>      rs.Open "SELECT * FROM r001", cn, adOpenForwardOnly, adLockReadOnly

>      With frmReport.CRViewer1

>           Set rpt = rdApp.OpenReport(repPath & FastQuery(cn, "SELECT
> NomeFile FROM _sys_Reports WHERE Codice=1"))
>           rpt.Database.Tables(1).SetDataSource rs
>           rpt.ParameterFields(1).AddCurrentValue 7

>           .ReportSource = rpt

>           .ViewReport
>      End With

>      frmReport.Show
>      rs.Close

> Can anyone help me? Thanks!

I use ttx reports like this.

Gregor.

    Set CR = New RInvoice1 'this is your instance of the *.drs file

    Set RST= New ADODB.Recordset
    RST.CursorType = adOpenStatic
    RST.LockType = adLockReadOnly
    RST.Open sqlTotals, Conn                 'create your recordset

    With CR
        .Database.SetDataSource RST, , 1
        .ParameterFields(1).AddCurrentValue 7
                '------on screen:--------------------------------------
        Load FReport             'load your form that contains the report
viewer component
        FReport.WindowState = vbMaximized
        FReport.CRViewer.ReportSource = CR
        FReport.CRViewer.ViewReport
        FReport.CRViewer.Zoom (1) '2= Page Width, 1 = Whole Page, other =
zoom level (int)
        Screen.MousePointer = 0
        FReport.Show vbModal
        Unload FReport
    End With

    'Closing all the recordset and classes:
    RST.Close
    Set RST = Nothing
    Set CR = Nothing



Tue, 30 Aug 2005 04:05:25 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. HELP, TTX file and using a ADO Rs

2. Help! TTX File - Physical Database Not Found - CR8

3. Change TTX location at Run-Time - Please Help....

4. Crystal Report - CHange TTX location in code

5. Obtain TTX from .rpt

6. Ttx to ASP

7. TTX file not picking up all lines in Crystal.NET

8. Converting TTX reports to Direct access DB reports

9. TTX Files required at runtime

10. Crystal sub-reports problem using TTX file and data tables

11. How to refresh ttx?

12. printing a register each time in the ttx

 

 
Powered by phpBB® Forum Software