We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12147
    • 182 Posts
    I haven’t been able to find information, so hope this isn’t too elemental (read: lame) but is there some tv/snippet that will allow the user to upload Excel-type files to (be published on a page)?

    It would be horse-show results (names, horse names, places, class, etc., lots of database-type info) with each entry on one line).

    Thanks!
    Higgy
      • 3749
      • 24,544 Posts
      I don’t know how much help this will be. There are dozens of different ways to do what you want but none of them I know of are particularly simple.

      It depend mostly on what form the files are in to begin with. If they are actual Excel files, there may be a utility to process them but I’m not aware of one. If your users are willing to convert the file into CSV (comma-delimited) text files or SQL files, you can import them into the MODx database using PhpMyAdmin and write a custom snippet to display them.

      You could also use the FileUpload snippet to let users upload the files and then write a snippet that would process them and put them into the DB on upload.

      If your users would be entering data directly on the web site (one horse at a time), you could use eForm and eForm2DB to communicate with the MODx database.

      You might also look at the DataGrid Widget which can help set up a table to display the data.

      Can you be more specific about what you want to do?

        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 12147
        • 182 Posts
        Thanks, Bob! What happens generally is that the show is scored, real-time, using special show software, which produces what I guess are, or could be, CSV files (I think it’s fairly easy to convert Excel files to CSV, so that might be a starting point). The FileUpload snippet sounds good - as to writing a snippet, yikes, I wouldn’t know where to begin. huh

        I would like to make this as easy as possible for them, of course, so was hoping there would be a direct way. They’ve been operating with a FrontPage-generated site, with pretty easy uploading processes (we won’t discuss the html, of course).

        Does this make things clearer or murkier? undecided
          • 12147
          • 182 Posts
          Thanks for the input on this! I should have made clear at the outset that I am only just now setting up my first MODx site - so I basically know nothing!

          You make it sound so easy... undecided but at least you’ve given me some hope!

          Is there somewhere on the forum to request the creation of what you suggest? Would it be useful to other users? I’m a little surprised this is the first time this has come up, but maybe it’s a pretty mundane process.

          One thing I just found in the Repository is called Tableau - do you think this might work???

          Again, many thanks indeed for your help!
            • 3749
            • 24,544 Posts
            I’m not familiar with Tableau but it appears to create on-screen tables. I’m not sure where Tableau gets the data to fill the table. I’ve asked in the Tableau support section of the forum so, hopefully, we’ll have an answer soon.

            If you wanted to put a "bounty" on development of your snippet. This would be the place to do it:

            http://modxcms.com/forums/index.php/board,224.0.html

            I’m getting closer to understanding what you want but still have a few questions. It sounds like your users could upload CSV files (and, yes, they’re easily saved from Excel).

            The big question is whether you want to accumulate, combine, analyze and/or archive the results. Another important question is whether you can absolutely count on them all being in the same format (same fields in the same order).

            If you just want to create a new table to display for each one uploaded and you know the number of field and their order, it should be fairly simple.

            If you want to create new tables which combine existing data (e.g. "show me the results for a particular horse in all events"), it gets more complicated.

            If you can’t count on knowing the field count and order, it’s still doable but, again, more complicated, especially if the users are not all using the same software.

            Here are some approaches:

            1. In the simplest scenario, you could just save each uploaded CSV file and later create the web page from that file on the fly.

            2. A step up from that would be to have the user fill out a form on the upload page (date, location, event title, etc.) and save the file to disk and the form data and filename to the MODx DB. You’d then query that DB table to get a menu of events. When the user selected one, you’d build the web page from the DB data and the saved file.

            3. If you’re really ambitious, you’d have the user act as in approach 2, but you’d save everything in the database. This would allow you to add various bells and whistles later, such as a table for a particular horse or stable or venue, results for a particular time frame, performance graphs, etc. This would mean some serious planning of the database structure because once any data is entered, it’s a lot of work to change things.

            You might also want some validation of the form contents and some custom code to check the validity of the uploaded filed.

            The one thing I can tell you for sure is that the more time you spend figuring out exactly what you want now, and might want in the future, the fewer massive headaches you’ll have later. Down the road, you can count on your users saying, "Couldn’t you just add x?" It will appear to them as a trivial task but, if the design isn’t prepared for it, trying to add it will drive you nuts.

            Hope this helps.

            Bob
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 12147
              • 182 Posts
              Quote from: BobRay at May 14, 2008, 12:36 AM

              The big question is whether you want to accumulate, combine, analyze and/or archive the results. Another important question is whether you can absolutely count on them all being in the same format (same fields in the same order).

              I am checking about this, but what I think is that show results will be posted, and possibly archived for a short time (again, will verify that). The "same order every time" I think would (or could) be true, since results could be sorted so that they /were/ in the same order each time (if it was an Excel file, that is). I think justification could be found for requiring that, if it facilitates this process.

              I am fairly certain that results will not need to be combined or analyzed or anything else made of them besides straightforward reporting.

              They are currently being posted as pdfs. I’d envisioned that they would be able to be uploaded/translated, then posted on a page (automatically?), which could then be printed if the viewer wanted.

              But like I say, this is the ignorance of babes envisioning! I’ll report the real and actual needs, which will narrow down the requirements and possibilities (hopefully).

              Thank you for all your thought on this matter!
                • 12147
                • 182 Posts
                Quote from: ganeshXL at May 13, 2008, 06:11 PM

                I swear I saw an example by someone not too long ago for exactly the same task, but I can’t find it anymore via search... (iirc by sottwell).

                If you happen to run across it again, give me a shout!!

                If you have several such CSVs (i.e. one per document / event), you could use a TV with input-type = file, and just upload your file while in doc-editing mode (no need to switch to the filemanager or FTP).

                This sounds very workable. I don’t want the show-result-reporters to have to jump through a lot of hoops to get the results up on the website. The more one-click it is, the better!

                Thank you very much for the snippet code grin. I really hope to get a template sorted out today and some pages made, and I’ll see if I can’t add this and then try it!

                I can’t tell you how much I appreciate the help I’ve gotten here - and it’s great to think this might actually work. A real group effort (with not much input from me except requirements rolleyes )
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org