PDA

Click to See Complete Forum and Search --> : Accessing remote report with TTX fails when empty


nuria
Apr 18th, 2005, 05:45 AM
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

nuria
Apr 18th, 2005, 06:13 AM
I forgot to say than the rpt works fine if it has no formula but fails with formula fields.

nuria
Apr 18th, 2005, 07:17 AM
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:

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 !

tansarbh
Oct 24th, 2005, 04:28 PM
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:

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,.