OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

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 7 years, 8 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #25239

    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
  • #25240

    Mike Kudelya
    Participant

    Hi,

    Try to delete

    #25241

    abel
    Participant

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

    #25242

    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!

    #25243

    Mike Kudelya
    Participant

    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:

    #25244

    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

    #25245

    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?

    #25246

    Mike Kudelya
    Participant

    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.

    #25247

    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

    #25248

    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?

    #25249

    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:

    #25250

    Mike Kudelya
    Participant

    Try this:

    #25251

    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)

The forum ‘OroCRM – Programming Questions’ is closed to new topics and replies.

Back to top