C2664 error fix in SetParameters for Local Report

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • FrankCheung
    New Member
    • Mar 2008
    • 2

    C2664 error fix in SetParameters for Local Report

    I am using VS 2005 c++ ReportViewer to generate a dynamic report with a date filter.

    The following is the code contained in the form.h:

    public: void SetReportParame ters()
    {
    ReportParameter ^ DatePara = gcnew ReportParameter ("ShowDate",thi s->datepick->Value.ToString ());

    this->reportViewer 1->LocalReport->SetParameter s( gcnew array<ReportPar ameter^>{DatePa ra});

    }

    The last statement above leads to Error C2664, which complains that .. cannot convert parameter1 from 'cli::array<Tpe >^' to 'System::Collec tions::Generic: :IEnumerable<T> ^'...

    Is this related to some bug in my version of Visual Studio 2005? This seems related to Feedback
    C++/CLI incorrectly requires safe_cast to assign CLI array to IEnumerable<T>, opened in 11/05/2006

    If the VS 2005 contains Service Pack 1, the problem described in C2664 shouldn't happen? Anyone can help me to answer this problem? Thanks.

    Franklin
Working...