Плагин Гибкий отчет

Просмотр 15 сообщений - с 16 по 30 (из 32 всего)
  • Автор
    Сообщения
  • #34909
    Mikhail
    Модератор

    Укажите точную ссылку, на которой возникает ошибка, а также подробности ошибки из ScadaWeb.log.

    #34915
    manjey73
    Участник

    http://localhost:10008/ElasticReport/Print/PrintReport2?reportID=1&unit=Month&period=-1&archive=Day&format=Html

    Пробовал период -1

    2024-10-02 13:13:49 [raspi][root][ERR] Необработанное исключение:
    System.ArgumentException: The conversion could not be completed because the supplied DateTime did not have the Kind property set correctly.  For example, when the Kind property is DateTimeKind.Local, the source time zone must be TimeZoneInfo.Local. (Parameter 'sourceTimeZone')
       at System.TimeZoneInfo.ConvertTime(DateTime dateTime, TimeZoneInfo sourceTimeZone, TimeZoneInfo destinationTimeZone, TimeZoneInfoOptions flags, CachedData cachedData)
       at Scada.Report.ReportUtils.GetUtcStartTime(DateTime utcNow, TimeZoneInfo timeZone, PeriodUnit unit)
       at lambda_method92(Closure, Object, Object[])
       at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
       at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
       at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
       at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
    --- End of stack trace from previous location ---
       at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
       at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
       at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
    --- End of stack trace from previous location ---
       at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
       at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
       at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
       at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
    --- End of stack trace from previous location ---
       at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
       at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
       at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
       at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
       at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
       at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
       at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|10_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)
    
    #34916
    manjey73
    Участник

    Если вместо Month указать в unit Day то отчет строится.

    #34917
    AndreyV
    Участник

    А какое смещение у Вас установлено в параметрах отчета?
    <DataOptions>
    <PrependTime>00:00:00</PrependTime>
    <AppendTime>00:00:00</AppendTime>
    </DataOptions>
    Попробуйте выставить для начала 00:00:00.

    Если можно, пришлите свой конфиг отчета, попробую у себя запустить.

    • Ответ изменён 1 год, 8 месяцев назад пользователем AndreyV.
    • Ответ изменён 1 год, 8 месяцев назад пользователем AndreyV.
    #34920
    manjey73
    Участник
    <?xml version="1.0" encoding="utf-8"?>
    <ElasticReport>
      <!-- Input form options -->
      <InputOptions>
        <!-- User can select report period -->
        <SelectPeriod>true</SelectPeriod>
        <!-- User can select archive -->
        <SelectArchive>false</SelectArchive>
        <!-- User can select channels -->
        <SelectChannels>false</SelectChannels>
        <!-- User can select output format -->
        <SelectFormat>true</SelectFormat>
        <!-- Defines how the period is entered. Possible values: SingleDate, SingleMonth, DatePeriod, DateTimePeriod, MonthPeriod -->
        <PeriodControl>MonthPeriod</PeriodControl>
        <!-- Maximum report period in days -->
        <MaxPeriod>365</MaxPeriod>
        <!-- Default archive code -->
        <DefaultArchive>Day</DefaultArchive>
        <!-- Default output format: Pdf, Xlsx, Html -->
        <DefaultFormat>Html</DefaultFormat>
      </InputOptions>
      <!-- Output options. Page format and orientation only work for PDF -->
      <OutputOptions>
        <!-- Page format: A0, A1, A2, A3, A4, A5, A6, B5, Letter, Legal, Ledger or P11x17 -->
        <PageFormat>A4</PageFormat>
        <!-- Page orientation: Portrait or Landscape -->
        <Orientation>Landscape</Orientation>
        <!-- Specifies custom report styles -->
        <StyleSheet></StyleSheet>
      </OutputOptions>
      <Document>
        <DocumentOptions>
          <!-- Heading of the report -->
          <Heading>Отчет потребления Серверная 3 (303) за</Heading>
          <!-- Show or hide heading -->
          <HeadingVisible>true</HeadingVisible>
          <!-- Set text color depending on channel status -->
          <UseStatusColor>true</UseStatusColor>
        </DocumentOptions>
        <Section type="DataData">
          <SectionOptions>
            <ID>Section1</ID>
            <!-- <Subheading>DataData Section</Subheading> -->
            <SubheadingVisible>true</SubheadingVisible>
            <PrependPageBreak>false</PrependPageBreak>
            <ColumnHeadersVisible>true</ColumnHeadersVisible>
            <RowHeadersVisible>true</RowHeadersVisible>
          </SectionOptions>
          <DataOptions>
            <PrependTime>-3:00:00</PrependTime>
            <AppendTime>3:00:00</AppendTime>
          </DataOptions>
          <Table border="true">
            <ColumnGroup name="Период">
              <Column name="Значение на начало периода" />
              <Column name="Значение на конец периода" />
            </ColumnGroup>
            <ColumnGroup>
              <Column name="Расход за период кВт/ч" calcSum="true" />
              <!-- <Column name="Excel Formula" calcSum="true" /> -->
            </ColumnGroup>
            <RowGroup name="" calcSum="true">
              <Row name="Энергия Серверная 3" cnlNum="527" rowStyle="row-lg">
                <Cell calcType="FirstVal" />
                <Cell calcType="LastVal" />
                <Cell calcType="Diff" />
              </Row>
            </RowGroup>
          </Table>
        </Section>
      </Document>
    </ElasticReport>

    Если с нулями, получим прочерки, ибо архив Дневной.
    Из Часового получим другие значения, не соответствующие Дневному.

    #34921
    AndreyV
    Участник

    Запустил, и у меня туже ошибку выдает. Не понятно. Вечером попробую на домашнем ПК, где тестовый отчет работал.

    #34925
    Mikhail
    Модератор

    Укажите положительный период. Он в любом случае считается от текущего времени назад.

    #34930
    manjey73
    Участник

    @Mikhail ну вы как Фома неверующий.
    Я вам пишу, что любые иные значения, кроме -3 и 3 дают прочерки в соответствующих полях при использовании архива Day из Главное — Отчеты.

    Значения в Архивах Day и Hour соответствуют друг другу

    А так же это

    http://localhost:10008/ElasticReport/Print/PrintReport2?reportID=1&unit=Month&period=-1&archive=Day&format=Html

    в Представлении дает ошибку.
    Мой шаблон отчета выше. Вместо 527-го впишите любой свой канал (у меня это энергия от сброса из счетчика) и проверьте у себя.

    #34931
    manjey73
    Участник

    Минус на Минус дают Плюс 🙂

    Поставил значение 3:00:00 и заменил на часовой архив
    Значение из Часового Архива = 26 032,86

    Значение из Дневного архива при -3:00:00 = 26 076,24 (при иных значениях времени из Дневного ---)

    Говорю же, разберитесь со временем, оно хромает.

    #34934
    AndreyV
    Участник

    Добрый день! Я так понимаю, что данные в дневной архив пишутся 1 раз в сутки и видимо в 00:00 часов:минут. Если выставить месячный интервал с дневным архивом и задать еще смещение времени в конфиге отчета, то данных и не будет (получаем — ).
    Попробуйте задать месячный интервал, а архив часосой.

    #34937
    manjey73
    Участник

    Еще раз.

    Дневной архив — одно значение
    Часовой архив — 24 значения.

    Архивы по умолчанию, без смещения, время UTC так понимаю.
    Отображение в Графиках Про и при использовании Гибкого Отчета не соответствуют друг другу по времени. В смысле они на конкретное значение показывают разное время.
    На скринах все видно.
    Значения Часового архива и Дневного архива соответствуют только при

    <PrependTime>-3:00:00</PrependTime>
    <AppendTime>3:00:00</AppendTime>

    При других значениях из Дневного не получим НИЧЕГО.

    И то, что работает через Главное — Отчет
    Не работает в Представлении при &unit=Month

    #34942
    Mikhail
    Модератор

    Этот вопрос обсуждается здесь.

    #36499
    Oleg
    Участник

    Добрый вечер. У нас такая же проблема. Отчет с периодом в дни отображается, с периодом месяцы — ошибка. Пробовали и +3, и 0 и -3 смещения в конфиге — не помогает. Куда копать?

    Ошибка:

    System.ArgumentException: The conversion could not be completed because the supplied DateTime did not have the Kind property set correctly. For example, when the Kind property is DateTimeKind.Local, the source time zone must be TimeZoneInfo.Local. (Parameter ‘sourceTimeZone’)
    at System.TimeZoneInfo.ConvertTime(DateTime dateTime, TimeZoneInfo sourceTimeZone, TimeZoneInfo destinationTimeZone, TimeZoneInfoOptions flags, CachedData cachedData)
    at System.TimeZoneInfo.ConvertTimeToUtc(DateTime dateTime, TimeZoneInfo sourceTimeZone)
    at Scada.Report.ReportUtils.GetUtcStartTime(DateTime utcNow, TimeZoneInfo timeZone, PeriodUnit unit)
    at lambda_method18(Closure, Object, Object[])
    at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
    — End of stack trace from previous location —
    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
    — End of stack trace from previous location —
    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
    — End of stack trace from previous location —
    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
    at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
    at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
    at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
    at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
    at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|10_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)

    Ссылка:

    ElasticReport/Print/PrintReport2?reportID=2&unit=Month&period=1&archive=Hour&format=Html

    Отчет:

    <?xml version=»1.0″ encoding=»utf-8″ ?>
    <ElasticReport>
    <!— Input form options —>
    <InputOptions>
    <!— User can select report period —>
    <SelectPeriod>true</SelectPeriod>
    <!— User can select archive —>
    <SelectArchive>true</SelectArchive>
    <!— User can select channels —>
    <SelectChannels>false</SelectChannels>
    <!— User can select output format —>
    <SelectFormat>true</SelectFormat>
    <!— Defines how the period is entered. Possible values: SingleDate, SingleMonth, DatePeriod, DateTimePeriod, MonthPeriod —>
    <PeriodControl>MonthPeriod</PeriodControl>
    <!— Maximum report period in days —>
    <MaxPeriod>12</MaxPeriod>
    <!— Default archive code —>
    <DefaultArchive>Hour</DefaultArchive>
    <!— Default output format: Pdf, Xlsx, Html —>
    <DefaultFormat>Pdf</DefaultFormat>
    </InputOptions>

    <!— Output options. Page format and orientation only work for PDF —>
    <OutputOptions>
    <!— Page format: A0, A1, A2, A3, A4, A5, A6, B5, Letter, Legal, Ledger or P11x17 —>
    <PageFormat>A4</PageFormat>
    <!— Page orientation: Portrait or Landscape —>
    <Orientation>Landscape</Orientation>
    <!— Specifies custom report styles —>
    <StyleSheet></StyleSheet>
    </OutputOptions>

    <!—
    Report document consists of sections. Section is a separate block of displayed data.
    Section contains elements such as a table, columns, rows, and cells.
    Section working period is based on the specified report period and shifted according to the section data options.

    Element attributes are inherited from an element to its children and applied to suitable elements.
    The following element attributes are supported:
    * cnlNum — channel number,
    * cnlIdx — channel index if channels are specified as input parameters,
    * calcType — calculation type,
    * calcSum — whether to calculate a sum of a column or row,
    * calcAvg — whether to calculate an average of a column or row,
    * calcMin — whether to calculate a minimum value of a column or row,
    * calcMax — whether to calculate a maximum value of a column or row,
    * colStyle — column style,
    * rowStyle — row style,
    * cellStyle — cell style.

    Table attributes:
    * border — whether to display table border.

    The possible values of the calcType attribute:
    * Val — the value of the bound channel at the processed timestamp,
    * FirstVal — the value at the first timestamp of the working period,
    * LastVal — the value at the last timestamp of the working period,
    * Diff — the difference between the values at the processed and previous timestamps,
    * DiffNext — the difference between the values at the next and processed timestamps,
    * Const — the constant value to insert in the corresponding cell,
    * Formula — the formula to insert in the corresponding cell, supported only by Excel.

    Style names follow the rules:
    Column style name must be in the form «col-*».
    Row style name must be in the form «row-*».
    Cell style name must be in the form «cell-*».

    Variables can be used inside an element name and inside a constant value.
    The following variables are supported:
    {CnlNum} — channel number,
    {CnlName} — channel name.
    —>

    <Document>
    <DocumentOptions>
    <!— Heading of the report —>
    <Heading>Отчет о климате</Heading>
    <!— Show or hide heading —>
    <HeadingVisible>true</HeadingVisible>
    <!— Set text color depending on channel status —>
    <UseStatusColor>true</UseStatusColor>
    </DocumentOptions>

    <!—
    Section of TimeData type.
    Supported calculation types: Val, Diff, DiffNext, Const, Formula.
    —>
    <Section type=»TimeData»>
    <SectionOptions>
    <!— Unique section ID. Use Latin characters without spaces —>
    <ID>Section1</ID>
    <!— Subheading of the section —>
    <Subheading>TimeData Section</Subheading>
    <!— Show or hide subheading —>
    <SubheadingVisible>false</SubheadingVisible>
    <!— Start the section on a new page —>
    <PrependPageBreak>false</PrependPageBreak>
    </SectionOptions>

    <DataOptions>
    <!— Prepend additional time before the report start time —>
    <PrependTime>0:00:00</PrependTime>
    <!— Append additional time after the report end time —>
    <AppendTime>0:00:00</AppendTime>
    <!— Skip the first timestamp from output —>
    <SkipFirst>false</SkipFirst>
    <!— Skip the last timestamp from output —>
    <SkipLast>false</SkipLast>
    <!— Defines how timestamps are enumerated. Possible values: All, Step, Hour, Day, Month, Exact, BeginEnd —>
    <TimeDetailing>Hour</TimeDetailing>
    <!— Time step —>
    <TimeStep>1:00:00</TimeStep>
    <!— Times of day separated by commas —>
    <ExactTimes>0:00, 12:00</ExactTimes>
    <!— Defines how the date and time column is displayed —>
    <ShowDatesOnly>false</ShowDatesOnly>
    </DataOptions>

    <Table border=»true»>
    <ColumnGroup name=»Показания датчиков:»>
    <Column name=»{CnlName}» cnlNum=»900000″ calcType=»Val» />
    <Column name=»{CnlName}» cnlNum=»900002″ calcType=»Val» />
    <Column name=»{CnlName}» cnlNum=»900001″ calcType=»Val» />
    <Column name=»{CnlName}» cnlNum=»900003″ calcType=»Val» />
    </ColumnGroup>
    </Table>

    </Section>
    </Document>
    </ElasticReport>

    #36501
    Mikhail
    Модератор

    Переход по ссылке.

    #36502
    manjey73
    Участник

    Михаил, параметр unit=Month не работал в ссылке отчета для представления.
    Сомневаюсь, что для версии 6.4 что-то поменялось. Не проверял пока.

    • Ответ изменён 1 год, 5 месяцев назад пользователем manjey73.
Просмотр 15 сообщений - с 16 по 30 (из 32 всего)
  • Тема «Плагин Гибкий отчет» закрыта для новых ответов.