Click here to Skip to main content
15,909,205 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
C#
private void Apply_Filter(ref ReportDocument oRpt)
        {
            string str = "";
            string str2 = "XWV_RPT_REQLIST";
            str = str + " {" + str2 + ".REQNBR}=" + this.ReqNbr.ToString();
            str = str + " And {" + str2 + ".L_Language_Id}=\"" + Conversions.ToString(this.oUser.LANGUAGE_ID) + "\"";
            ReportDocument document = oRpt;
            document.set_RecordSelectionFormula(document.get_RecordSelectionFormula() + str);
            oRpt.Refresh();
        }


Error is coming on the below line

C#
str = str + " And {" + str2 + ".L_Language_Id}=\"" + Conversions.ToString(this.oUser.LANGUAGE_ID) + "\"";


Any inputs? Please
Posted
Comments
ZurdoDev 5-Jan-16 7:35am    
Are you sure that is the line? According to, https://msdn.microsoft.com/en-us/library/microsoft.visualbasic.compilerservices.conversions.tostring(v=vs.80).aspx, Conversions.ToString() has, at least since .Net 2.0, always taken 1 argument.

I'd right click on Conversions and choose "Go To Definition" and see where it takes you. It sounds like you have the wrong version loaded or a custom version perhaps.
Member 9017207 5-Jan-16 7:44am    
You are right. Error is coming in the line after that

document.set_RecordSelectionFormula(document.get_RecordSelectionFormula() + str);
ZurdoDev 5-Jan-16 7:52am    
But this line won't give the .ToString() error because there is no .ToString() in that line, unless you step into set_RecordSelectionFormula. I believe you need to step into that function. Or in the get_RecordSelectionFormula() function. But keep digging to find the exact piece of code causing the issue and then you'll likely see what the problem is.

1 solution

Do you mean
C#
... Convert.ToString(this.oUser.LANGUAGE_ID) ...
instead of
C#
... Conversions.ToString(this.oUser.LANGUAGE_ID) ...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900