Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long Website names are truncated in pdf based reports #9936

Open
lhaupt opened this issue Mar 16, 2016 · 9 comments
Open

Long Website names are truncated in pdf based reports #9936

lhaupt opened this issue Mar 16, 2016 · 9 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc.

Comments

@lhaupt
Copy link

lhaupt commented Mar 16, 2016

We have really long website titles in our web projekt and if we use the reporting as pdf file we got useless informations because we see only the beginning of our title.
report
And so the information we are interested in is absolutly missing.

Using the html export shows perfect matching columns with the full name. But here we have an other problem. We got the reports per mail only, and there the info is not attached as an extra html file, it is only a part of the body of the mail. But for automation purposes we need such an attached file as it is the case using pdf reports. Is there an option to configure piwik to send the report in html format as an mail attachement?

thanks in advance

lars

@tsteur tsteur added the Bug For errors / faults / flaws / inconsistencies etc. label Mar 16, 2016
@tsteur
Copy link
Member

tsteur commented Mar 16, 2016

Thx for reporting this bug.

You can select report format HTML but it won't be an attachment.

@tsteur tsteur added the Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. label Mar 16, 2016
@lhaupt
Copy link
Author

lhaupt commented Mar 17, 2016

Hello Thomas,

thanks for quick awnsering. If you will fix this bug. How long do i have to wait until i will get a fixed version of piwik?

Additionally i have a nother question concerning the html task. Is there an option to automate the download process of reports? I mean, in the gui there is a button download and there i will get a file including the html based report. Otherwise, this proofs that piwik can generate html file based reports, generally. Is there an option to apply a feature request to have email reports with attached html files instead of html content inside the mail body?

Kind regards

Lars

@gausam
Copy link
Contributor

gausam commented Mar 28, 2016

@tsteur Want to take a stab at this (if no one is working on a fix now) if you suggest the best way at it

@tsteur
Copy link
Member

tsteur commented Mar 28, 2016

I would say you'd want to have a look here: https://github.com/piwik/piwik/blob/2.16.0/core/ReportRenderer/Pdf.php#L358 and maybe here https://github.com/piwik/piwik/blob/2.16.0/core/ReportRenderer/Pdf.php#L372 . It seems to truncate after 55 characters see: https://github.com/piwik/piwik/blob/2.16.0/core/ReportRenderer/Pdf.php#L58

I'm not sure what best way to solve is as some people might like this behaviour. Maybe you have an idea? Eg we could have a config setting for it but ideally we try to avoid config settings.

@gausam
Copy link
Contributor

gausam commented Mar 29, 2016

Thanks, taking a look. Is there a reason why we can't wrap to the next line when the name is longer than 55 characters?

@tsteur tsteur removed the Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. label Mar 29, 2016
@tsteur
Copy link
Member

tsteur commented Mar 29, 2016

I had a quick look but am not really familiar with this part of the code. I think from what I understand it may truncates it to make sure it is always in one line as it maybe uses hard coded width and especially height see https://github.com/piwik/piwik/blob/2.16.0/core/ReportRenderer/Pdf.php#L379 where $this->cellHeight = 6. If the value is using more than one line, likely the height of 6 is wrong and it would maybe need to know how many lines are actually consumed by a value. This is just a guess though as I don't know TCPDF. Maybe there is a way to improve this.

@gausam
Copy link
Contributor

gausam commented Mar 30, 2016

I'm not sure what best way to solve is as some people might like this behaviour. Eg we could have a config setting for it but ideally we try to avoid config settings.

You're right, there could be some users who are happy with the truncation. So the solution is entirely up to you now for this case, whether we

  • work to have the text spread out over one line or
  • if we have the HTML report - which doesn't have the truncation issue - come also as an attachment in the HTML report email (for easier printing)
  • suggest the earlier workaround to have the HTML report which they have to print from within their email client

@mattab
Copy link
Member

mattab commented Mar 31, 2016

@IhateHandles It would be ideal to not truncate the website name in PDF reports. if you manage to make it work and look good, it would be the best solution I think?

@mattab mattab added this to the Mid term milestone Mar 31, 2016
@gausam
Copy link
Contributor

gausam commented Apr 1, 2016

@mattab Alright. I quickly experimented and got it working on mine (save for some padding issues). Basically what I did for label columns was to use the MultiCell method (which allows for text spanning more than one line) instead of Cell.

I didn't go over TCPDF's docs (if they're available) so I'll do that sooner or later and see if we can have the fix in place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

4 participants