Please try pasting this into your rdl and see if it works.

```
="SELECT T1.Calc_CustName as ARDtls_Calc_CustName,
T2.Calc_LegalNumber,
T1.Calc_MulChildren as ARDtls_Calc_MulChildren,
T1.Calc_ParentCustID as ARDtls_Calc_ParentCustID,
T1.Calc_RptTitle2,
T1.Calc_Summary,
T2.InvoiceDate,
T2.InvoiceNum,
T2.PONum,
T2.Calc_AgeBaseAll,
T2.Calc_AgeCurAll,
T2.Calc_AgeInvAmt1,
T2.Calc_AgeInvAmt2,
T2.Calc_AgeInvAmt3,
T2.Calc_AgeInvAmt4,
T2.Calc_AgeInvAmt5,
T2.Calc_AgeInvAmt6,
T2.Calc_AgeLbl1,
T2.Calc_AgeLbl2,
T2.Calc_AgeLbl3,
T2.Calc_AgeLbl4,
T2.Calc_AgeLbl5,
T2.Calc_AgeLbl6,
T2.Calc_BlockedFinChrg,
T2.Calc_BlockedRemLetters,
T2.Calc_Company,
T2.Calc_ContPer,
T2.Calc_ContPh,
T2.Calc_crMemo,
T2.Calc_curDesc,
T2.Calc_CurDueDate,
T2.Calc_CurrCode,
T2.Calc_CustID,
T2.Calc_CustName as Calc_CustName,
CAST( T2.Calc_Index as nvarchar ) as Calc_Index,
CAST( T2.Calc_MulChildren as nvarchar ) as Calc_MulChildren,
T2.Calc_ParentCustID as Calc_ParentCustID,
T2.Calc_PoDNNbr,
T2.Calc_RptARAcctID,
T2.Calc_RptUserID,
T2.Calc_TierLevelNum,
T2.Calc_TopCustID,
CAST( T2.Calc_BasCurrency as nvarchar ) as Calc_BasCurrency,
T3.TierLevelNum,
T3.Calc_ARTotal1,
T3.Calc_ARTotal2,
T3.Calc_ARTotal3,
T3.Calc_ARTotal4,
T3.Calc_ARTotal5,
T3.Calc_ARTotal6,
T3.Calc_LevelCustID,
T3.Calc_LevelDesc,
T4.Calc_DecimalsGeneral,
T5.InvoiceLine,
T5.ProdCode,
T5.ProjectID,
T8.RetAmt
FROM ARPrnt_" +Parameters!TableGuid.Value + " T1
join Company_" +Parameters!TableGuid.Value + " T4
on T1.Calc_Company=T4.Company
LEFT OUTER JOIN RlsHead_" +Parameters!TableGuid.Value + " T3
ON T1.Calc_Company = T3.Calc_Company AND T1.Calc_CustID = T3.Calc_CustID
LEFT OUTER JOIN ARDtls_" +Parameters!TableGuid.Value + " T2
ON T1.Calc_Company = T2.Calc_Company AND T1.Calc_ParentCustID = T2.Calc_ParentCustID AND T1.Calc_CustID = T2.Calc_CustID and T1.Calc_RptARAcctID = T2.Calc_RptARAcctID
LEFT OUTER JOIN (SELECT T4.Company, T4.InvoiceNum, T4.ProdCode, T4.InvoiceLine, T4.ProjectID FROM InvcDtl_" +Parameters!TableGuid.Value + " T4
WHERE (T4.InvoiceLine = (SELECT MIN(T6.InvoiceLine) FROM InvcDtl_" +Parameters!TableGuid.Value + " T6
WHERE T6.Company = T4.Company AND T6.InvoiceNum = T4.InvoiceNum))) T5
ON T5.Company = T2.Company AND T5.InvoiceNum = T2.InvoiceNum
LEFT OUTER JOIN (SELECT T7.Company, T7.InvoiceNum, SUM(T7.DocMiscAmt) AS RetAmt FROM InvcMisc_" +Parameters!TableGuid.Value + " T7 GROUP BY T7.Company, T7.InvoiceNum) T8
ON T8.Company = T2.Company AND T8.InvoiceNum = T2.InvoiceNum"
```