没有重载函数的实例 Microsoft::reporting::winforms::localreport::render


你好,我有一个小应用程序 VS2015 Visual C++,WindowsForms。 我尝试将 RDLC 报告直接打印到打印机。 为此,当我尝试提交报告时,我受到了打击。
任何善意的建议都将有助于完成任务。
谢谢

public: static System::Void Export(LocalReport^ report, bool print = true){
		PaperSize^ paperSize = m_pageSettings->PaperSize;
		Margins^ margins = m_pageSettings->Margins;

		String^ deviceInfo = String::Format(CultureInfo::InvariantCulture,
			"<DeviceInfo>" +
			"<OutputFormat>EMF</OutputFormat>" +
			"<PageWidth>{5}</PageWidth>" +
			"<PageHeight>{4}</PageHeight>" +
			"<MarginTop>{0}</MarginTop>" +
			"<MarginLeft>{1}</MarginLeft>" +
			"<MarginRight>{2}</MarginRight>" +
			"<MarginBottom>{3}</MarginBottom>" +
			"</DeviceInfo>",
			ToInches(margins->Top),
			ToInches(margins->Left),
			ToInches(margins->Right),
			ToInches(margins->Bottom),
			ToInches(paperSize->Height),
			ToInches(paperSize->Width));
		//Microsoft::Reporting::WinForms::Warning^ warnings;
		System::Collections::Generic::IList<Warning^>^ warnings;
		m_streams = gcnew List<Stream^>();

                //I get error messages at the below report->Render lines.

		report->Render("Image", deviceInfo, CreateStream, warnings);  ??????????????????????????????????



		for each(Stream^ stream in m_streams) {
			stream->Position = 0;
		}
		if (print==true){
			Print();
		}
	}

错误信息 :

No Instance of Overloaded function MIcrosoft::Reporting::Winforms::LocalReport::Render matches the arguement types are (const char[6], String^, Stream^(String^ name, String^ fileNameExtension, System::Text::Encoding^ encoding, String^ mimetype, bool willseek), System::Collections::Generic::IList<Microsoft::Reporting::WinForms::Warning^>^) object type is Microsoft::Reporting::WinForms::LocalReport^  

再次感谢

我尝试过的:

我尝试直接将 RDLC 报告打印到打印机

解决方案1

コメント

タイトルとURLをコピーしました