Avatar of Bruce Gust
Bruce Gust
Flag for United States of America

asked on 

How would you create this interface?

I'll give you what the user wants, what I've built thus far and then you tell me how you would proceed given the realities that have recently been revealed.

What They Want...

Their are several users who are required to submit a weekly report that consists of three sections. In the past, this report has been nothing more than an email that consists of Rich Text Formatting (text that will be published in different colors, emboldened, underlined, etc) as well as portions of either an Excel spreadsheet or an online table that inevitably has some formatting as well (see below):

Just as a quick aside, notice that the portion of the spreadsheet that is pictured above is truncated. Rarely, if ever, are the reports that are going out currently via email structured in a way where they can fit nicely on an 8.5 X 11 piece of paper.

What I've Done...

What I've accomplished thus far is pictured in part below:

system performance block
I built a page that has three sections like what you see above. The user can choose between a tinyMCE editor or an HTML option. There's some Javascript in place that reveals either a plain text block or the tinyMCE editor, depending in which option that user selects.

Initially, I was thinking I was being pretty, stinkin' clever. The tinyMCE editor gives the user the opportunity to format their text however they wish. I built another dynamic where the user can upload images and then reference them accordingly. This is going to be cake and ice cream, right?

Not so much.

The Excel spreadsheet dynamic gets kind of clunky. You can copy and paste what you have directly into the tinyMCE editor, but it doesn't reproduce any of the formatting you might have in place (colored cells, bold text, etc.). This is why I put the HTML text block in place. You can save your spreadsheet as an HTML doc, then copy and paste all of that code into the HTML text block and it looks great. But this is assuming the user is willing to do that and understands enough about HTML where they know what part of the code to grab.

Another thing you can do is put this all into an Outlook email and then display it in your web browser, grab the source code and you're all set. But that gets kind of clunky as well.

To make matters even more convoluted, exporting all of this into a pdf doc using PHP is doable PROVIDED THAT the architecture of your page / report is fixed. I can reproduce a webpage as a pdf doc easy enough, but I can't create tables and reproduce formatting on the fly. I can change the content, but not the structure (see https://www.experts-exchange.com/questions/28906224/Export-a-page-to-pdf-using-php.html)

What Would You Do...?

Here's what I'm thinking / needing some minds greater than my own to weigh in...

Spreadsheets need to be treated as attachments and not as entities displayed as inline objects for two reasons:
rarely are they structured to fit neatly and / or legibly within an 8.5 X 11 piece of paper
converting them into an HTML format is neither intuitive nor elegant

In light of each update varying in both content and architecture, writing code to export said page into a pdf format isn't an option. Rather, I have to provide for my user a page that is print friendly and from there they can print it as a pdf doc

I'm thinking those two thoughts satisfy my user's request for said interface. But what do you think and how do I provide for my user the ability to print a web based doc as a pdf? In the past, I've used PrimoPDF, but that's a separate download. Is there something out there that I'm not aware of that does the same thing? In other words, you go to print something and there's an option you can choose that prints your content as a pdf doc.

Can you smell what I'm cooking? What do you think?

Avatar of undefined
Last Comment

8/22/2022 - Mon