Ошибка при локальной обработке отчета reportviewer

Студворк — интернет-сервис помощи студентам

периодически пытаюсь решить эту проблему и уже порядком задолбался, знаю что эта тема здесь крайне не популярна, 90% вопросов заданных остались без ответа, но попробую. Имеется отчет в проекте Report.rdlc, в нем одна таблица, при выводе постоянно получаю ошибку «Ошибка при локальной обработке отчета. Ссылка на объект не указывает на экземпляр объекта»
вот код которым пытаюсь прикрутить отчет к вьюверу:

C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
this.reportViewer1.LocalReport.DataSources.Clear();
            reportViewer1.Reset();
            reportViewer1.LocalReport.ReportEmbeddedResource = "Report.rdlc";
            SqlConnection con = new SqlConnection();
            con.ConnectionString = "SERVER=" + server + ";" + "DATABASE=" + database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";";
            con.Open();
            SqlCommand cmd = new SqlCommand();
            cmd.Connection = con;
            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "select ... from akttableCLS";
            DataTable akttableCLS = new DataTable();
            akttableCLS.Load(cmd.ExecuteReader());
            con.Close();
            ReportDataSource rprtDTSource = new ReportDataSource();
            rprtDTSource.Name = "DataSet1";
            rprtDTSource.Value = akttableCLS;
            this.reportViewer1.LocalReport.DataSources.Add(rprtDTSource);
            this.reportViewer1.RefreshReport();

вот часть кода Report.rdlc

XML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
  <AutoRefresh>0</AutoRefresh>
  <DataSources>
    <DataSource Name="bbbDataSet">
      <ConnectionProperties>
        <DataProvider>System.Data.DataSet</DataProvider>
        <ConnectString>/* Local Connection */</ConnectString>
      </ConnectionProperties>
      <rd:DataSourceID>ab30b7d9-7917-440f-b697-ecedb23cd657</rd:DataSourceID>
    </DataSource>
    <DataSource Name="bbbiDataSet1">
      <ConnectionProperties>
        <DataProvider>System.Data.DataSet</DataProvider>
        <ConnectString>/* Local Connection */</ConnectString>
      </ConnectionProperties>
      <rd:DataSourceID>1b87092b-150a-4d68-94c8-7b62029a51fe</rd:DataSourceID>
    </DataSource>
  </DataSources>
  <DataSets>
    <DataSet Name="DataSet1">
      <Query>
        <DataSourceName>bbbiDataSet</DataSourceName>
        <CommandText>/* Local Query */</CommandText>

Добавлено через 5 часов 20 минут
может хотя бы кто подскажет что значит сия ошибка: «Метод не найден: SystemString Microsoft.ReportingSevices.DateTimeUtil.ParseDateToAdditionalSettingFormat(Sysye m.String.System.Gobalization.CultureInfo)??? она вылезла в окне report vyewer, мой код теперь выглядит так:

C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
reportViewer1.ProcessingMode = ProcessingMode.Local;
 
            reportViewer1.LocalReport.ReportPath = "Report1.rdlc";
 
            ReportDataSource rdS = new ReportDataSource("DataSet1", GetData());
 
            reportViewer1.LocalReport.DataSources.Add(rdS);
            this.reportViewer1.RefreshReport();
            DataTable GetData()
 
            {
 
                SqlDataAdapter dta = new SqlDataAdapter();
 
                SqlConnection con = new SqlConnection("SERVER=" + server + ";" + "DATABASE=" + database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";");
            
                DataSet ds = new DataSet();
 
                dta.SelectCommand = new SqlCommand("select from akttableCLS", con);
                
                dta.Fill(ds, "akttableCLS");
 
                return ds.Tables[0];
 
            }

  • Remove From My Forums
  • Question

  • I keep getting the error :

    An unhandled exception of type ‘Microsoft.Reporting.WinForms.LocalProcessingException’ occurred in Microsoft.ReportViewer.WinForms.dll

    Additional information: An error occurred during local report processing.

    This occurs on the line:

    report.Render(«Image», deviceInfo, AddressOf CreateStream, warnings)

    I’m trying to use some code posted here to print without using the report viewer’s print preview and no matter what I try (and I’ve created several simple reports), I keep getting this error. Is there any way to get more info on the error to pinpoint it’s cause?????

    BTW, here’s the version number of the dll file listed above if that helps any. 8.0.50727.42

Answers

  • I was finally able to find the «inner exception» info. Here’s what i added:

    Try

    report.Render(«Image», deviceInfo, AddressOf CreateStream, warnings)

    Catch e As System.Exception

    Dim inner As Exception = e.InnerException

    While Not (inner Is Nothing)

    MsgBox(inner.Message)

    inner = inner.InnerException

    End While

    End Try

    The second line above is from the code posted about printing without print preview so the try-catch block goes around it. I was finally able to determine the error occurring which was a datasource had not been supplied (which was but the name didn’t exactly match). Anyway, the report successfully printed this afternoon without a print preview!!!

  • Remove From My Forums
  • Question

  • I keep getting the error :

    An unhandled exception of type ‘Microsoft.Reporting.WinForms.LocalProcessingException’ occurred in Microsoft.ReportViewer.WinForms.dll

    Additional information: An error occurred during local report processing.

    This occurs on the line:

    report.Render(«Image», deviceInfo, AddressOf CreateStream, warnings)

    I’m trying to use some code posted here to print without using the report viewer’s print preview and no matter what I try (and I’ve created several simple reports), I keep getting this error. Is there any way to get more info on the error to pinpoint it’s cause?????

    BTW, here’s the version number of the dll file listed above if that helps any. 8.0.50727.42

Answers

  • I was finally able to find the «inner exception» info. Here’s what i added:

    Try

    report.Render(«Image», deviceInfo, AddressOf CreateStream, warnings)

    Catch e As System.Exception

    Dim inner As Exception = e.InnerException

    While Not (inner Is Nothing)

    MsgBox(inner.Message)

    inner = inner.InnerException

    End While

    End Try

    The second line above is from the code posted about printing without print preview so the try-catch block goes around it. I was finally able to determine the error occurring which was a datasource had not been supplied (which was but the name didn’t exactly match). Anyway, the report successfully printed this afternoon without a print preview!!!

периодически пытаюсь решить эту проблему и уже порядком задолбался, знаю что эта тема здесь крайне не популярна, 90% вопросов заданных остались без ответа, но попробую. Имеется отчет в проекте Report.rdlc, в нем одна таблица, при выводе постоянно получаю ошибку «Ошибка при локальной обработке отчета. Ссылка на объект не указывает на экземпляр объекта»
вот код которым пытаюсь прикрутить отчет к вьюверу:

C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
this.reportViewer1.LocalReport.DataSources.Clear();
            reportViewer1.Reset();
            reportViewer1.LocalReport.ReportEmbeddedResource = "Report.rdlc";
            SqlConnection con = new SqlConnection();
            con.ConnectionString = "SERVER=" + server + ";" + "DATABASE=" + database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";";
            con.Open();
            SqlCommand cmd = new SqlCommand();
            cmd.Connection = con;
            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "select ... from akttableCLS";
            DataTable akttableCLS = new DataTable();
            akttableCLS.Load(cmd.ExecuteReader());
            con.Close();
            ReportDataSource rprtDTSource = new ReportDataSource();
            rprtDTSource.Name = "DataSet1";
            rprtDTSource.Value = akttableCLS;
            this.reportViewer1.LocalReport.DataSources.Add(rprtDTSource);
            this.reportViewer1.RefreshReport();

вот часть кода Report.rdlc

XML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
  <AutoRefresh>0</AutoRefresh>
  <DataSources>
    <DataSource Name="bbbDataSet">
      <ConnectionProperties>
        <DataProvider>System.Data.DataSet</DataProvider>
        <ConnectString>/* Local Connection */</ConnectString>
      </ConnectionProperties>
      <rd:DataSourceID>ab30b7d9-7917-440f-b697-ecedb23cd657</rd:DataSourceID>
    </DataSource>
    <DataSource Name="bbbiDataSet1">
      <ConnectionProperties>
        <DataProvider>System.Data.DataSet</DataProvider>
        <ConnectString>/* Local Connection */</ConnectString>
      </ConnectionProperties>
      <rd:DataSourceID>1b87092b-150a-4d68-94c8-7b62029a51fe</rd:DataSourceID>
    </DataSource>
  </DataSources>
  <DataSets>
    <DataSet Name="DataSet1">
      <Query>
        <DataSourceName>bbbiDataSet</DataSourceName>
        <CommandText>/* Local Query */</CommandText>

Добавлено через 5 часов 20 минут
может хотя бы кто подскажет что значит сия ошибка: «Метод не найден: SystemString Microsoft.ReportingSevices.DateTimeUtil.ParseDateT oAdditionalSettingFormat(Sysyem.String.System.Goba lization.CultureInfo)??? она вылезла в окне report vyewer, мой код теперь выглядит так:

C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
reportViewer1.ProcessingMode = ProcessingMode.Local;
 
            reportViewer1.LocalReport.ReportPath = "Report1.rdlc";
 
            ReportDataSource rdS = new ReportDataSource("DataSet1", GetData());
 
            reportViewer1.LocalReport.DataSources.Add(rdS);
            this.reportViewer1.RefreshReport();
            DataTable GetData()
 
            {
 
                SqlDataAdapter dta = new SqlDataAdapter();
 
                SqlConnection con = new SqlConnection("SERVER=" + server + ";" + "DATABASE=" + database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";");
            
                DataSet ds = new DataSet();
 
                dta.SelectCommand = new SqlCommand("select from akttableCLS", con);
                
                dta.Fill(ds, "akttableCLS");
 
                return ds.Tables[0];
 
            }

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь

  • Remove From My Forums
  • Вопрос

  • периодически пытаюсь решить эту проблему и уже порядком задолбался. Имеется отчет в проекте Report.rdlc,
    в нем одна таблица, при выводе постоянно получаю ошибку «Ошибка при локальной обработке отчета. Ссылка на объект не указывает на экземпляр объекта»

    вот код которым пытаюсь прикрутить отчет к вьюверу:

    this.reportViewer1.LocalReport.DataSources.Clear();
                reportViewer1.Reset();
                reportViewer1.LocalReport.ReportEmbeddedResource = "Report.rdlc";
                SqlConnection con = new SqlConnection();
                con.ConnectionString = "SERVER=" + server + ";" + "DATABASE=" + database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";";
                con.Open();
                SqlCommand cmd = new SqlCommand();
                cmd.Connection = con;
                cmd.CommandType = CommandType.Text;
                cmd.CommandText = "select ... from akttableCLS";
                DataTable akttableCLS = new DataTable();
                akttableCLS.Load(cmd.ExecuteReader());
                con.Close();
                ReportDataSource rprtDTSource = new ReportDataSource();
                rprtDTSource.Name = "DataSet1";
                rprtDTSource.Value = akttableCLS;
                this.reportViewer1.LocalReport.DataSources.Add(rprtDTSource);
                this.reportViewer1.RefreshReport();

    вот часть кода Report.rdlc:

    <?xml version="1.0" encoding="utf-8"?>
    <Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
      <AutoRefresh>0</AutoRefresh>
      <DataSources>
        <DataSource Name="bbbDataSet">
          <ConnectionProperties>
            <DataProvider>System.Data.DataSet</DataProvider>
            <ConnectString>/* Local Connection */</ConnectString>
          </ConnectionProperties>
          <rd:DataSourceID>ab30b7d9-7917-440f-b697-ecedb23cd657</rd:DataSourceID>
        </DataSource>
        <DataSource Name="bbbDataSet1">
          <ConnectionProperties>
            <DataProvider>System.Data.DataSet</DataProvider>
            <ConnectString>/* Local Connection */</ConnectString>
          </ConnectionProperties>
          <rd:DataSourceID>1b87092b-150a-4d68-94c8-7b62029a51fe</rd:DataSourceID>
        </DataSource>
      </DataSources>
      <DataSets>
        <DataSet Name="DataSet1">
          <Query>
            <DataSourceName>bbbiDataSet</DataSourceName>
            <CommandText>/* Local Query */</CommandText>

Вопрос:

У меня есть ReportViewer в моем проекте. Когда я создаю .exe этого файла в InstallShield в Vsual Studio 2012, я добавляю в Redistributables Microsoft ReportViewer 2010.

Когда я устанавливаю свое приложение в Windows 8 – каждый ReportViewer отображает его отчет правильно.

У меня проблема с Windows XP ReportViewer загружается правильно, но отображает эту ошибку вместо правильного отчета:

Произошла ошибка при обработке локального отчета. Определение отчет “недействителен. Неожиданная ошибка, возникшая в отчете Обработка.

Не удалось загрузить файл или сборку Microsoft.ReportViewer.ProcessingObjectMode. Версия = 11.0.0., Культура = нейтральная, PublicKeyToken = 89845dc8080cc91 или одна из ее зависимостей. эта система не может найти указанный файл.

Я гарантирую вам, что в references I have added Microsoft.ReportViewer.Winfroms 11.0.0.0 и Copy Local = true.

Как я могу решить эту проблему?

Лучший ответ:

Узнал, что эта ошибка означает, что вам не хватает Microsoft.ReportViewer.PorcessingObjectMode.dll version 11.0.0.0. Существует одно решение:

На вашем компьютере Windows 8 выполните следующие действия:

  • Откройте команду командной строки dos (нажмите START + R, затем введите cmd и нажмите ENTER)

  • Введите cd .., пока вы не включите C: > Введите Cd windowsassemblygac_msilMicrosoft.ReportViewer.pro* и нажмите enter

  • Просто введите cd 11*

  • Затем введите copy * c:

  • .dll будет скопирован в ваш каталог C.

  • Этот файл просто скопируйте в Program Files на Windows XP machine в папку, где установлено ваше приложение.

Надеюсь, что это поможет другим, поскольку я долгое время рассматривал эту проблему.

Ответ №1

Я подтвердил ответ, помеченный как ответ, потому что я был, infact, missing.dlls, но я не исправил его так, как предложил @Marek. Я использую VS2013, и установка пакета Microsoft.Reporting nuget устраняет проблему. Я бы предложил любому, у кого эта проблема, попробовать это. Таким образом, вы автоматически получаете все зависимости.

enter image description here

Ответ №2

Марек ответ велик и помог мне, я просто хотел добавить дополнительный файл, который мне нужен. В дополнение к

Microsoft.ReportViewer.ProcessingObjectModel.dll

Мне также понадобилось

Microsoft.SqlServer.Types.dll

(Я запускаю это с сервера, на котором есть SQLServer, но не для служб Reporting Services, поэтому, возможно, почему второй файл отсутствовал.)

Как указывал Марек, вам нужно скопировать файл с помощью командной строки, потому что библиотеки DLL в GAC_MSIL скрыты из Проводника Windows, поэтому вы не увидите их, если их искать с помощью проводника.
Я был в тупике, потому что я создаю PDF файл с ежедневной задачей, поэтому все, что я видел в моем файле журнала, было загадочной ошибкой "An error occurred during local report processing." Я никогда не видел FaceViewer, что, по крайней мере, говорит вам пропавший файл.

Чтобы устранить эту проблему, я создал тестовую программу quickie и отобразил ReportViewer, что сделало более понятным, какие DLL мне нужны:
enter image description here

Ответ №3

Для начала

Это необходимо для установки пакетов nuget “Microsoft.Report.Viewer”, “ReportViewer.WebForms”, “Microsoft.ReportViewer.WinForms”, а также “Microsoft.SqlServer.Types”.

https://www.nuget.org/packages/ReportViewer.WebForms/

https://www.nuget.org/packages/Microsoft.ReportViewer.WinForms/

https://www.nuget.org/packages/Microsoft.Report.Viewer/

https://www.nuget.org/packages/Microsoft.SqlServer.Types/

Затем следует проверить web.config на наличие каких-либо тегов.

<system.web>
<compilation debug="true" targetFramework="4.5">
<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
</buildProviders>
<assemblies>
<add assembly="Microsoft.ReportViewer.Common, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
<add assembly="Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
</assemblies>
</compilation>
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" validate="false" />
    <assemblyBinding>
<dependentAssembly>
<assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-14.0.0.0" newVersion="14.0.0.0" />
</dependentAssembly>
</assemblyBinding>
<system.webServer>
<handlers>
<add name="ReportViewerWebControlHandler" verb="*" path="Reserved.ReportViewerWebControl.axd" preCondition="integratedMode" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
</handlers>
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>

I post this in hopes that it may provide insight to others as dense as self!!  I have been working to get this project to work for several days and finally it worked.

‘Error:

‘——————

An error occurred during local report processing
An error has occured during report processing
DataSet1

‘———Code from form test3 with Reportviewer1

Imports Microsoft.Reporting.WinForms

Public Class test3

    Private Sub test3_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        'TODO: This line of code loads data into the 'ReportData.Members' table. You can move, or remove it, as needed.
        'Me.MembersTableAdapter.Fill(Me.ReportData.Members)
        Dim tstMembers As System.Data.DataTable
        Dim tstReportMember As New rptMbr
        tstMembers = tstReportMember.Mbr
        Dim rptData As New ReportDataSource()

        'rptData.Name = "DataSet1"
        rptData.Name = "Dataset1"

        rptData.Value = tstMembers

        tstMembers = tstReportMember.Mbr
        Me.ReportViewer1.LocalReport.DataSources.Clear()
        Me.ReportViewer1.LocalReport.DataSources.Add(rptData)
        Me.ReportViewer1.RefreshReport()
    End Sub

‘— end code

Notes: 

1. In the report rdlc file the dataset is «DataSet1» (note the case of the name)

sending it «Dataset1» throws the errors above.

2. After I got it working w/o errors I was still stuck with a blank reportviewer1.  Even with a Me.Refresh() (thought that would refresh the whole form.  Nope

and ReportViewer1.Refresh()— also does not work.

but the ReportViewer1.RefreshReport() is the key to get the damn thing to re-render and show the data.

3. for the really interested I was working on an application in which I had to do a lot of preprocessing of the data to get the table structure I needed, so I built a class that returned a system.datatable of the form I needed.  I tried using the EDM,
but went to sleep as it tried to load the data :(.  This works wiki,wiki and does what I need.

Hope this helps some other poor lost soul, wondering about in the reportviewer wilderness :)


Ed Warren Raising sails on masts not masts on sails

I post this in hopes that it may provide insight to others as dense as self!!  I have been working to get this project to work for several days and finally it worked.

‘Error:

‘——————

An error occurred during local report processing
An error has occured during report processing
DataSet1

‘———Code from form test3 with Reportviewer1

Imports Microsoft.Reporting.WinForms

Public Class test3

    Private Sub test3_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        'TODO: This line of code loads data into the 'ReportData.Members' table. You can move, or remove it, as needed.
        'Me.MembersTableAdapter.Fill(Me.ReportData.Members)
        Dim tstMembers As System.Data.DataTable
        Dim tstReportMember As New rptMbr
        tstMembers = tstReportMember.Mbr
        Dim rptData As New ReportDataSource()

        'rptData.Name = "DataSet1"
        rptData.Name = "Dataset1"

        rptData.Value = tstMembers

        tstMembers = tstReportMember.Mbr
        Me.ReportViewer1.LocalReport.DataSources.Clear()
        Me.ReportViewer1.LocalReport.DataSources.Add(rptData)
        Me.ReportViewer1.RefreshReport()
    End Sub

‘— end code

Notes: 

1. In the report rdlc file the dataset is «DataSet1» (note the case of the name)

sending it «Dataset1» throws the errors above.

2. After I got it working w/o errors I was still stuck with a blank reportviewer1.  Even with a Me.Refresh() (thought that would refresh the whole form.  Nope

and ReportViewer1.Refresh()— also does not work.

but the ReportViewer1.RefreshReport() is the key to get the damn thing to re-render and show the data.

3. for the really interested I was working on an application in which I had to do a lot of preprocessing of the data to get the table structure I needed, so I built a class that returned a system.datatable of the form I needed.  I tried using the EDM,
but went to sleep as it tried to load the data :(.  This works wiki,wiki and does what I need.

Hope this helps some other poor lost soul, wondering about in the reportviewer wilderness :)


Ed Warren Raising sails on masts not masts on sails

Когда я пытаюсь открыть форму, содержащую элемент управления Report Viewer , отображается следующее сообщение:

Произошла ошибка при обработке локального отчета.

Определение недействительно. Подробности: определение отчета имеет недопустимое целевое пространство имен

«http://schemas.microsoft.com/sqlserver/reporting/2016/01 / reportdefinition » которые не могут быть обновлены.

Заголовок файла rdlc:

<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">

Справочный набор мне кажется правильным:

Microsoft.ReportViewer.WinForms
Runtime version: v2.0.50727
Version: 10.0.0.0

Целевая платформа: .NET Framework 4.5 .

Возможно, из-за того, что это обновленное приложение, оно все еще включает в себя:

Средство просмотра отчетов Microsoft Visual Studio 2008

Я могу найти статью поддержки, в которой говорится, что вы можете изменить версию схемы, скажем, до 2008 года, но это вызывает множество ошибок компиляции.

Итак, как решить эту проблему?

1 ответ

Лучший ответ

Ссылки, которые вы используете, довольно старые, хотя вы используете последнюю схему отчета. Вам необходимо использовать один или оба из следующих вариантов:

  • Вы можете изменить все отчеты на более низкую версию схемы
  • Обновите элемент управления ReportViewer и платформу .NET до более поздней версии.

Первое — это не просто обновление версии схемы, потому что есть некоторые новые теги, которые не поддерживаются в более старых версиях схемы, например ReportSections, ReportSection. Для этого прочтите этот пост.

Если ваши отчеты уже созданы с действующей схемой 2016, лучше второй вариант. Затем вы можете обновить элемент управления ReportViewer и .NET Framework:

  • Для обновления установите последнюю версию пакета Microsoft.ReportingServices.ReportViewerControl.Winforms в ReportViewer версии 15+
  • Измените целевую структуру проекта на .NET> = 4.6

Вы должны убедиться, что все другие ссылки и пакеты, которые вы используете в проекте, совместимы с версией .NET framework, которую вы собираетесь использовать.

Чтобы узнать больше о последней версии элемента управления Report Viewer, взгляните на:

  • Используйте элемент управления WinForms ReportViewer
  • Обновленный элемент управления Report Viewer теперь общедоступен


1

Reza Aghaei
2 Фев 2020 в 19:36

I have a reportViewer that I want to print, and it’s working in my developing PC but when I deploy it to my client it says:
An error occurredd during local report processing .

My code is as follows:

        try
        {
            ReportParameter[] param = new ReportParameter[12];
            param[0] = new ReportParameter("p1", P1);
            param[1] = new ReportParameter("p2", P2);
            param[2] = new ReportParameter("p3", " ");
            param[3] = new ReportParameter("p4", " ");
            param[4] = new ReportParameter("p4", " ");
            param[5] = new ReportParameter("p5", " ");
            param[6] = new ReportParameter("p6", " ");
            param[7] = new ReportParameter("p7", " ");
            param[8] = new ReportParameter("p8", " ");
            param[9] = new ReportParameter("p9", " ");
            param[10] = new ReportParameter("p10", " ");
            param[11] = new ReportParameter("p11", P11);
            reportViewer1.Reset();
            reportViewer1.LocalReport.ReportPath = ConfigurationSettings.AppSettings["ReportPath"].ToString();//Application.StartupPath + "\rptReport.rdlc";

            reportViewer1.LocalReport.SetParameters(param);

            Export(reportViewer1.LocalReport);
            Print();
            this.reportViewer1.RefreshReport();
            this.Close();
        }
        catch (Exception ex) {
            if (Convert.ToBoolean(ConfigurationSettings.AppSettings["debug"].ToString()) == true)
            {
                MessageBox.Show(ex.Message);
            }
        }

Когда я пытаюсь открыть форму, содержащую элемент управления Report Viewer , отображается следующее сообщение:

Произошла ошибка при обработке локального отчета.

Определение недействительно. Подробности: определение отчета имеет недопустимое целевое пространство имен

«http://schemas.microsoft.com/sqlserver/reporting/2016/01 / reportdefinition » которые не могут быть обновлены.

Заголовок файла rdlc:

<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">

Справочный набор мне кажется правильным:

Microsoft.ReportViewer.WinForms
Runtime version: v2.0.50727
Version: 10.0.0.0

Целевая платформа: .NET Framework 4.5 .

Возможно, из-за того, что это обновленное приложение, оно все еще включает в себя:

Средство просмотра отчетов Microsoft Visual Studio 2008

Я могу найти статью поддержки, в которой говорится, что вы можете изменить версию схемы, скажем, до 2008 года, но это вызывает множество ошибок компиляции.

Итак, как решить эту проблему?

1 ответ

Лучший ответ

Ссылки, которые вы используете, довольно старые, хотя вы используете последнюю схему отчета. Вам необходимо использовать один или оба из следующих вариантов:

  • Вы можете изменить все отчеты на более низкую версию схемы
  • Обновите элемент управления ReportViewer и платформу .NET до более поздней версии.

Первое — это не просто обновление версии схемы, потому что есть некоторые новые теги, которые не поддерживаются в более старых версиях схемы, например ReportSections, ReportSection. Для этого прочтите этот пост.

Если ваши отчеты уже созданы с действующей схемой 2016, лучше второй вариант. Затем вы можете обновить элемент управления ReportViewer и .NET Framework:

  • Для обновления установите последнюю версию пакета Microsoft.ReportingServices.ReportViewerControl.Winforms в ReportViewer версии 15+
  • Измените целевую структуру проекта на .NET> = 4.6

Вы должны убедиться, что все другие ссылки и пакеты, которые вы используете в проекте, совместимы с версией .NET framework, которую вы собираетесь использовать.

Чтобы узнать больше о последней версии элемента управления Report Viewer, взгляните на:

  • Используйте элемент управления WinForms ReportViewer
  • Обновленный элемент управления Report Viewer теперь общедоступен


1

Reza Aghaei
2 Фев 2020 в 19:36

Вопрос:

У меня есть ReportViewer в моем проекте. Когда я создаю .exe этого файла в InstallShield в Vsual Studio 2012, я добавляю в Redistributables Microsoft ReportViewer 2010.

Когда я устанавливаю свое приложение в Windows 8 – каждый ReportViewer отображает его отчет правильно.

У меня проблема с Windows XP ReportViewer загружается правильно, но отображает эту ошибку вместо правильного отчета:

Произошла ошибка при обработке локального отчета. Определение отчет “недействителен. Неожиданная ошибка, возникшая в отчете Обработка.

Не удалось загрузить файл или сборку Microsoft.ReportViewer.ProcessingObjectMode. Версия = 11.0.0., Культура = нейтральная, PublicKeyToken = 89845dc8080cc91 или одна из ее зависимостей. эта система не может найти указанный файл.

Я гарантирую вам, что в references I have added Microsoft.ReportViewer.Winfroms 11.0.0.0 и Copy Local = true.

Как я могу решить эту проблему?

Лучший ответ:

Узнал, что эта ошибка означает, что вам не хватает Microsoft.ReportViewer.PorcessingObjectMode.dll version 11.0.0.0. Существует одно решение:

На вашем компьютере Windows 8 выполните следующие действия:

  • Откройте команду командной строки dos (нажмите START + R, затем введите cmd и нажмите ENTER)

  • Введите cd .., пока вы не включите C: > Введите Cd windowsassemblygac_msilMicrosoft.ReportViewer.pro* и нажмите enter

  • Просто введите cd 11*

  • Затем введите copy * c:

  • .dll будет скопирован в ваш каталог C.

  • Этот файл просто скопируйте в Program Files на Windows XP machine в папку, где установлено ваше приложение.

Надеюсь, что это поможет другим, поскольку я долгое время рассматривал эту проблему.

Ответ №1

Я подтвердил ответ, помеченный как ответ, потому что я был, infact, missing.dlls, но я не исправил его так, как предложил @Marek. Я использую VS2013, и установка пакета Microsoft.Reporting nuget устраняет проблему. Я бы предложил любому, у кого эта проблема, попробовать это. Таким образом, вы автоматически получаете все зависимости.

enter image description here

Ответ №2

Марек ответ велик и помог мне, я просто хотел добавить дополнительный файл, который мне нужен. В дополнение к

Microsoft.ReportViewer.ProcessingObjectModel.dll

Мне также понадобилось

Microsoft.SqlServer.Types.dll

(Я запускаю это с сервера, на котором есть SQLServer, но не для служб Reporting Services, поэтому, возможно, почему второй файл отсутствовал.)

Как указывал Марек, вам нужно скопировать файл с помощью командной строки, потому что библиотеки DLL в GAC_MSIL скрыты из Проводника Windows, поэтому вы не увидите их, если их искать с помощью проводника.
Я был в тупике, потому что я создаю PDF файл с ежедневной задачей, поэтому все, что я видел в моем файле журнала, было загадочной ошибкой "An error occurred during local report processing." Я никогда не видел FaceViewer, что, по крайней мере, говорит вам пропавший файл.

Чтобы устранить эту проблему, я создал тестовую программу quickie и отобразил ReportViewer, что сделало более понятным, какие DLL мне нужны:
enter image description here

Ответ №3

Для начала

Это необходимо для установки пакетов nuget “Microsoft.Report.Viewer”, “ReportViewer.WebForms”, “Microsoft.ReportViewer.WinForms”, а также “Microsoft.SqlServer.Types”.

https://www.nuget.org/packages/ReportViewer.WebForms/

https://www.nuget.org/packages/Microsoft.ReportViewer.WinForms/

https://www.nuget.org/packages/Microsoft.Report.Viewer/

https://www.nuget.org/packages/Microsoft.SqlServer.Types/

Затем следует проверить web.config на наличие каких-либо тегов.

<system.web>
<compilation debug="true" targetFramework="4.5">
<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
</buildProviders>
<assemblies>
<add assembly="Microsoft.ReportViewer.Common, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
<add assembly="Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
</assemblies>
</compilation>
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" validate="false" />
    <assemblyBinding>
<dependentAssembly>
<assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-14.0.0.0" newVersion="14.0.0.0" />
</dependentAssembly>
</assemblyBinding>
<system.webServer>
<handlers>
<add name="ReportViewerWebControlHandler" verb="*" path="Reserved.ReportViewerWebControl.axd" preCondition="integratedMode" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
</handlers>
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>

Понравилась статья? Поделить с друзьями:
  • Ошибка при лечении пульпита биологическим методом является
  • Ошибка при лазерной коррекции зрения
  • Ошибка при копировании фильма на флешку
  • Ошибка при копировании файлов при установке windows
  • Ошибка при копировании файла разрушительный сбой