ssossossossosso

Forums

Forums OroCRM OroCRM – Programming Questions Totals and groupBy run uncorrectly in datagrid

This topic contains 12 replies, has 2 voices, and was last updated by  abel 1 year, 5 months ago.

  • Creator
    Topic
  • #22619

    abel
    Participant

    Hi all! I was created a datagrid with code:

    But when I run, it cannot group by with my field.
    Row grand-total run ok, but row page-total run uncorrect, it show value like grand-total (total of all value in grid, not in 1 page)
    Some one can help me.

Viewing 12 replies - 1 through 12 (of 12 total)
  • Author
    Replies
  • #22620

    Mike Kudelya
    Moderator

    Hi,

    Try to delete

    #22621

    abel
    Participant

    Great, It’s working. But why?
    I think it does not affect the result?

    #22622

    abel
    Participant

    And I have one more question. I create success report table with that grid. And now I want create line char with Charjs and data in report table. And my question is: How to get correct data from data grid?
    Thanks again!

    #22623

    Mike Kudelya
    Moderator

    Hi,

    Chart feature is supported by default, you can choose required columns when you editing a report. Here is description of ChartBundle. If you have datagrid object, that for example you can retrieve data the following approach:

    #22624

    abel
    Participant

    Thanks you, I will try.
    Sorry, I have 1 more question.
    I was created 2 table with 2 column as follow:
    – In table Order:

    – In table Store

    When I import Order from xlsx file throw cron, it’s failed (before that I create column store_id in table Order with annotion @ORM\Column(…), import ok).
    And when I use inner join in my grid

    and when I call that grid in view.html.twig, this error occurred

    #22625

    abel
    Participant

    I was try to get data from datagrid follow you. But I can’t get datagrid.
    I use class BuildAfter to get datagrid, is that true way?

    #22626

    Mike Kudelya
    Moderator

    Hi,

    Try to clear cache: /app/cache/dev and /app/cache/prod. If it didn’t help, try to rename $store_id variable in Order entity, for example to $store. In any case probably doctrine can’t find our field.

    I don’t think that events like buildAfter, buildBefore can help you. If you want to create custom report page you must change and extend either report view action or create own action. It is depends what you want.

    #22627

    abel
    Participant

    I was used event buildBefore but it occurred same error as BuildAfter

    And I don’t think class report controller can help me, because I want to create many report for 1 table (with date, channel, team, …). As I saw, that class created 1 chart for 1 entity (no parameter) but I want create 1 chart for 1 datagrid of entity (with some input parameter).

    My idea is: create report crub (with report entity), field of report entity are name, start_date, end_date (order create date), and description. In my view report, have 3 tag:
    – Report info
    – Datagrid of all order was created between start_date and end_date
    – Last, line chart of order in this datagrid

    I was use

    for get data in datagrid. But I can’t pass parameters to datagrid so it’s show error

    #22628

    abel
    Participant

    Update:
    I was use ParameterBag to passed 2 parameter start_date and end_date to my datagrid. But I can’t get those field in current report (create chart for any report with it’s start_date and end_date).
    How to do that?

    #22629

    abel
    Participant

    Sorry, I can get all data I want, but when I render chart to template, nothing show.
    This is my chart.yml

    This is my controller (include view report and create chart):

    And this is my template:

    #22630

    Mike Kudelya
    Moderator

    Try this:

    #22631

    abel
    Participant

    Great! It’s work, but have a problem. Date in horizontal not true

    My report started at 25/7 and ended at 31/7. But it’s not have 25/7 instead is 24/7 (same value). And when I hover in this point, it’s show day is 25/7.
    How to fix that problem?

Viewing 12 replies - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.