Results 1 to 4 of 4

Thread: Accessing remote report with TTX fails when empty

  1. #1

    Thread Starter
    New Member nuria's Avatar
    Join Date
    Apr 2005
    Posts
    6

    Resolved Accessing remote report with TTX fails when empty

    Hi,
    I have a report designed with TTX (field file definitions database). When I try to open it from a REMOTE machine (the rpt and the ttx is in my machine), it gives me an error when there is no data.
    In VB code, I set the Database.SetDataSource property to an ADODB Recordset and when it has data everything goes well, but when the recordset is empty, the report looks for the TTX and it does not find it (it looks for it on the remote machine and it is in my machine) and shows nothing in the CRViewer.
    How can I do to show an empty Report without fail ?
    Thanks
    Last edited by nuria; Apr 18th, 2005 at 07:20 AM. Reason: [Resolved]

  2. #2

    Thread Starter
    New Member nuria's Avatar
    Join Date
    Apr 2005
    Posts
    6

    Re: Accessing remote report with TTX fails when empty

    I forgot to say than the rpt works fine if it has no formula but fails with formula fields.

  3. #3

    Thread Starter
    New Member nuria's Avatar
    Join Date
    Apr 2005
    Posts
    6

    Lightbulb Re: Accessing remote report with TTX fails when empty

    Hi all !
    I have found the solution ! I have to pass to the rpt a sql that brings empty fields (you know, SELECT ' ' FROM X) and get the formulas from the report and set them to a value.
    This is the thing:
    VB Code:
    1. Sub SetFormulas(ByVal iReport As Integer, ByVal sFormula As String)
    2.     Dim CrystalReport As CRAXDRT.Report
    3.     Dim FormFieldDefn As CRAXDRT.FormulaFieldDefinition
    4.  
    5.     Set CrystalReport = GetReportobject(iReport)
    6.     For Each FormFieldDefn In CrystalReport.FormulaFields
    7.             FormFieldDefn.Text = " "  ' or the value of your choice
    8.     Next
    9.     Set FormFieldDefn = Nothing
    10.     Set CrystalReport = Nothing
    11. end sub
    I hope this can help !
    Last edited by nuria; Apr 18th, 2005 at 07:21 AM. Reason: adding [vbcode]

  4. #4
    New Member
    Join Date
    Oct 2005
    Posts
    15

    Re: Accessing remote report with TTX fails when empty

    Quote Originally Posted by nuria
    Hi all !
    I have found the solution ! I have to pass to the rpt a sql that brings empty fields (you know, SELECT ' ' FROM X) and get the formulas from the report and set them to a value.
    This is the thing:
    VB Code:
    1. Sub SetFormulas(ByVal iReport As Integer, ByVal sFormula As String)
    2.     Dim CrystalReport As CRAXDRT.Report
    3.     Dim FormFieldDefn As CRAXDRT.FormulaFieldDefinition
    4.  
    5.     Set CrystalReport = GetReportobject(iReport)
    6.     For Each FormFieldDefn In CrystalReport.FormulaFields
    7.             FormFieldDefn.Text = " "  ' or the value of your choice
    8.     Next
    9.     Set FormFieldDefn = Nothing
    10.     Set CrystalReport = Nothing
    11. end sub
    I hope this can help !
    Hi,

    Can you provide me information how you connected TTX file to the report??

    Thanks,.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width