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
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.
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:
Sub SetFormulas(ByVal iReport As Integer, ByVal sFormula As String)
Dim CrystalReport As CRAXDRT.Report
Dim FormFieldDefn As CRAXDRT.FormulaFieldDefinition
Set CrystalReport = GetReportobject(iReport)
For Each FormFieldDefn In CrystalReport.FormulaFields
FormFieldDefn.Text = " " ' or the value of your choice
Next
Set FormFieldDefn = Nothing
Set CrystalReport = Nothing
end sub
I hope this can help !
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:
Sub SetFormulas(ByVal iReport As Integer, ByVal sFormula As String)
Dim CrystalReport As CRAXDRT.Report
Dim FormFieldDefn As CRAXDRT.FormulaFieldDefinition
Set CrystalReport = GetReportobject(iReport)
For Each FormFieldDefn In CrystalReport.FormulaFields
FormFieldDefn.Text = " " ' or the value of your choice
Next
Set FormFieldDefn = Nothing
Set CrystalReport = Nothing
end sub
I hope this can help !
Hi,
Can you provide me information how you connected TTX file to the report??
Thanks,.