We have changed our pricing. Flexmonster Software License Agreement was also updated (list of changes)

PDF Export is cutting long header labels

Answered
Jean Teran asked on December 3, 2024

I would like to know if exist some possibility of control this issue in the grid headers, it is cutting the complete label.

 

Attachments:
Unknown.png

5 answers

Public
Maksym Diachenko Maksym Diachenko Flexmonster December 5, 2024

Hello, Jean!

Thank you for writing to us.

We could not reproduce the issue on our side. To help us identify the cause, could you please provide a reproducible example of this behavior? You can modify the following JSFiddle to demonstrate the issue: https://jsfiddle.net/flexmonster/avmrk9cy/

If this is not possible, could you clarify the following details:

  1. Have you applied any styles to cells or changed the grid's font? If so, share any related settings.
  2. Are you using a default unmodified export, or customize it with the exportTo API call. If you are using this method, please provide us with a code snippet where it is used with all parameters.

This information will help us understand the context better and provide a solution.

Looking forward to hearing from you.

Best Regards,
Maksym

Public
Jean Teran December 5, 2024

Please just replace the pivot config with this in the same url:

let pivot = new Flexmonster({
  container: "pivot-container",
  componentFolder: "https://cdn.flexmonster.com/",
  report: {
    dataSource: {
      filename: "data/data.csv",
    },
    options: {
      grid: {
        showHierarchyCaptions: false,
      },
    },
    slice: {
      columns: [
        {
          uniqueName: "Color",
          filter: {
            members: ["red", "green", "blue"],
          },
        },
        {
          uniqueName: "[Measures]",
        },
      ],
      measures: [
        {
          aggregation: "sum",
          uniqueName: "Price",
        },
        {
        	caption: "Sales $ YTD Jan 24-Feb 24",
        	uniqueName: "Price",
        	aggregation: 'sum',
        },
      ],
      rows: [
        {
          uniqueName: "Category",
        },
      ],
    },
      localization: {
    aggregations: {
      sum: {
        caption: 'Sum',
        grandTotalCaption: 'Σ {0}',
        totalCaption: 'Σ {0}',
      },
    },
  },
  },
})

function pdf() {
  const params = {
    //Insert any custom settings here
  }
  pivot.exportTo("pdf", params)
}
Public
Maksym Diachenko Maksym Diachenko Flexmonster December 6, 2024

Hello, Jean!

Thank you for sharing the code example.

We could reproduce this behavior. It is caused by the "Σ" character missing from the encoding of the exported PDF file. To resolve the issue, we suggest using the exportTo method with the fontUrl parameter - the URL to the TTF font file for saving PDF reports. Our team prepared an example with the NotoSans-Regular.ttf font file, which includes characters for 582 languages and special symbols: https://jsfiddle.net/flexmonster/avmrk9cy/
If supporting that many languages is unnecessary, you may use a font that contains fewer symbols to reduce the exported file weight.

Additionally, if you use the export through the toolbar, you can replace the default PDF export handler. Check this guide for more information about toolbar customization: https://www.flexmonster.com/doc/customizing-toolbar/

Please let us know if the suggested solution works for you.

Best Regards,
Maksym

Public
Maksym Diachenko Maksym Diachenko Flexmonster December 19, 2024

Hello, Jean!

Hope you are doing well.
We are wondering if you tried using the suggested approach for fixing labels including the "Σ" character.
Please let us know if this works for you.

Best Regards,
Maksym

Public
Maksym Diachenko Maksym Diachenko Flexmonster 1 day ago

Hello, Jean!

Just checking in to ask if you had time to try the suggested approach for adding characters for exporting to PDF.
We are looking forward to hearing your feedback.

Best Regards,
Maksym

Please login or Register to Submit Answer