@Cymassius opened this Issue on March 16th 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 commented on March 16th 2016 Owner

Thx for reporting this bug.

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

@Cymassius commented on March 17th 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

@samtheson commented on March 28th 2016 Contributor

@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 commented on March 28th 2016 Owner

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.

@samtheson commented on March 29th 2016 Contributor

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 commented on March 29th 2016 Owner

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.

@samtheson commented on March 30th 2016 Contributor

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 commented on March 31st 2016 Owner

@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?

@samtheson commented on April 1st 2016 Contributor

@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.

Powered by GitHub Issue Mirror