Okay
  Public Ticket #1487364
Unable to open .Docx Report
Closed

Comments

  •  2
    Cathexis started the conversation

    Hi TMS Team

    I am having an issue with the report plugin, the Word DOCX document that is generated can't be opened. I receiving the following error.

    "We're sorry/ We can't open client-reference-report.docx because we found a porblem with its contents."

    I have tried with using your word-invoice-purchase.docx with only one of my variable and I still get the same issue.

    What would cause the file to be corrupted?

    Warm regards

    Mark

  • [deleted] replied

    Hi Mark,

    Could you please send me an broken report so I can examine it or, even better if possible, give me a temporary admin credentials so I can take a look from the inside?

  •   Cathexis replied privately
  • [deleted] replied

    Hi Mark,

    I found a problem and it is not in the report but in the data itself. "&" character are causing problems when are inserted directly in Word documents. We are working on the solution for this and it will be included in the next version of the plugin.

    Best solution at this moment would be to just replace all "&"with HTML equivalent entity "&" and should work. You can do this from our table one by one or, if you have larger number of character in your data you can use MySQL to search and replace.

     

  •  2
    Cathexis replied

    Hi Miljko


    Thank you for the feedback, I have updated all the & with the "and" word. Ok thank you. Please assist me with two more things.

    1) I can download the report now. It pulls all the data from the column even if the column has been filtered to only show some data?

    2) Front-row editing - The save button inst showing, even though it is there. See attached image. 

    Thank you

    Warm regards

    Mark


  • [deleted] replied

    Hi Mark,

    1.) To enable this please go to step 2. of Report builder wizard named "Settings and variables" where you will find option - "Follow table filtering" - Documentation 

    2.) It looks like you set color for buttons in Settings page of our plugin which also applies in modals


  •  2
    Cathexis replied

    Hi Miljko

    Thank you, I have managed to get it to work. The table wasn't properly inserted into the page and was causing and issue with the save the report with filtering even though - follow table filtering was enable. I have also cleared the colors, not sure how that changed.

    Warm regards

    Mark

  • [deleted] replied

    Hi Mark,

    Glad to hear that it's solved now. I hope that you will enjoy using our product.

  •  2
    Cathexis replied

    Hi Milijko

    I have an issue, where if i set a the column to be a URL link, then unable to export it as a report, the .Docx report is unable to open. Is there a way to get around this?

    Warm regards


    Mark

  • [deleted] replied

    Hi Mark,
     

    Could you send me a Word file so I can try to find what is wrong whit it?

  •  2
    Cathexis replied

    Hi Milijko

    Thank you, see the attached Word file, let me know if you need anything else

    Warm regards

    Mark

  • [deleted] replied

    Hi Mark,
     

    Some HTML in your data breaks Word document. Could you please check if is valid HTML around 

    <a class='fancybox-youtube' href='<a class='fancybox-youtube' href='http://tcaabudhabi.ae' target='_self'>http://tcaabudhabi.ae' target='_self'>


  •  2
    Cathexis replied

    Hi Miljiko

    I removed code from the class.link.wpdatacolumn.php and tested it with the website field set to a URl and the word document still doesn't open. I have attached this version for you to check.

    Thank you

    Warm regards


    Mark

  • [deleted] replied

    Hi Mark,

    It's the same problem as before. Looks like you have a single quotes around element arguments and that that breaks the Word document. Could you send me an SQL dump from that table and your template so I can test this in my local environment? 

  •   Cathexis replied privately
  • [deleted] replied

    Hi Mark,

    As I can see you have regular links in your database and links formatted as a link below in your wpDataTables. I also notice that you have some CustomJS on that page triggering click on link class  "fancybox-youtube". Could you tell me which way did you add that class?

  •  2
    Cathexis replied

    Hi Miljko

    We have a multisite setup. With the integration site (integrations.cathexisvideo.com), using the tables to display integration information, the links in the tables are using the script to a pop-up window, instead of opening the information in a new page. 

    We are using the Easy FancyBox plugin to control and call the pop up, that is where the fancybox-youtube class originals from.


    Custom wpDataTables JS

    jQuery(window).load(function(){ wpDataTables.table_1.addOnDrawCallback( function(){ jQuery(\"#fancybox-auto\").trigger(\'click\'); }) });

    Then a class='fancybox-youtube' is added to the link, so it has been added to the class.link.wpdatacolumn.php & class.image.wpdatacolumn.php files, i have added the modified files(see attached)

    The class needs to be added with in the <a class='fancybox-youtube'></a> otherwise it doesn't work.

    I tried added the class to the columns CSS Class(es) option instead, however then the class is inserted in the the <td> and not the <a> and doesn't work:

    td style="" class=" fancybox-youtube column-product">a data-content="ACTpro 4000" href="https://integrations.cathexisvideo.com/integration/act-access/" target="_self">ACTpro 4000>a>td

    See the example of the pop in action:

    https://integrations.cathexisvideo.com/supported-integrations/access-control/


    The download site (downloads.cathexisvideo.com), is using the table for a client reference that needs to be exported as a Word Document, its doesn't require the pop-up window, however it is sharing the plugin due to the multi-site setup, so it is using the modified.


  • [deleted] replied

    Hi Cathexis

    Unfortunately this is problem a problem caused by your customization and because of that it is out of the scope of this support.

    My suggestion for you would be to remove that code from our plugin and use it with a hook. List of all hooks can be found in our - Documentation and in your most suitable whould be:

    wpdatatables_filter_image_cell( $formattedValue, $tableId )

    wpdatatables_filter_link_cell( $formattedValue, $tableId )

    Whit this filters you can change url columns only in tables where you need them and also keep core code intact so you can update plugin without breaking anything.  


  •  2
    Cathexis replied

    Hi Miljko

    Thank you for the feedback. Ok sure, if possible, could recommend a contractor who could write the php hooks required?

    The initial code was written in-house by an employee who has left the company and have limited php knowledge.

    Thank you for your time and assistance

    Warm regards

    Mark

  • [deleted] replied

    Hi Mark,

    We can offer you to hire one of our own developers to do this for you as a custom service. If you are interested please send me as much details as you can at email from my signature and, if one of them is available to do this, we will send you an estimation. 

  •  2
    Cathexis replied

    Hi Miljko

    Thank you, i have interested. I have emailed you.

    Warm regards

    Mark

  • [deleted] replied

    Hi Mark,

    I forwarded your request to other developers and I will get back to you when I have an answer from them

  •  2
    Cathexis replied

    Hi Miljko

    Thank you

    Warm regards

    Mark

  • [deleted] replied

    Hi Mark,

    My coworker send you an email and you will proceed there. I'm closing this ticket.