Hello,
I have problem to put variables to reportviewer.
First I put variables to parametrs and then to reportviewer.
Code looks like that:
jodb baza_win = new jodb(.....data.....to.....connection......SQL);
List<DaneRaportu> lista = baza_win.pobierz_rap_view(......query......SQL)
reportViewer1.ProcessingMode = ProcessingMode.Local;
LocalReport localReport = reportViewer1.LocalReport;
reportViewer1.LocalReport.DataSources.Clear();
reportViewer1.LocalReport.ReportEmbeddedResource = "Raporting.Report_Promo.rdlc";
Microsoft.Reporting.WinForms.ReportDataSource dataset = new Microsoft.Reporting.WinForms.ReportDataSource("DataSet1", lista);
reportViewer1.LocalReport.DataSources.Add(dataset);
dataset.Value = lista;
string data_rap = "Dataprobna";
ReportParameter nowydataod = new ReportParameter("dataodview", data_rap);
this.reportViewer1.LocalReport.SetParameters(nowydataod);
Next in report I put parameter to textbox. Expression looks like that: Parameters!dataodview.Value
When I start program I get this communication:
An error occurred during local report processing
In details:
Microsoft.Reporting.WinForms.LocalProcessingException: An error occurred during local report processing. ---> Microsoft.Reporting.DefinitionInvalidException: The definition of the report '' is invalid. ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: An unexpected error occurred in Report Processing. ---> System.UnauthorizedAccessException: Access to the path 'C:\Users\User\AppData\Local\Temp\expression_host_1f2d7bdeb7b24b8a9d99ff74d15a1b60.dll' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
The strange thing is that when I start program in Start Debugging everything is ok but when I start program in Start Without Debugging I have bug.
Maybe someone knows what happened?