Problem with Contenttype

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kenChris
    New Member
    • Feb 2008
    • 3

    Problem with Contenttype

    I have a page that prints out custom (school) reports for a variety of subjects/years/teachers/subjects etc.

    When i run this page i get my reports very quickly, however when i use

    <code>
    <% response.Conten tType ="applicatio n/msword" %>

    The report can take upto 5 mins and appears to hang the computer. But does ultimately work.

    Can anyone help with where i could be going wrong or what to look for? It does seam specific to word as changing the contenttype to Excel dramatically speeds up the process.

    Or is there an alternative way to output a report for printing.
  • CroCrew
    Recognized Expert Contributor
    • Jan 2008
    • 564

    #2
    Well MSWord is, has been, and all ways will be a hog. I don’t know if we could really help you with out seeing your code. There might be some code improvements we could suggest if we could see it.

    Other then that you say the page renders fast when not using Word so, Word just might be the problem. As, far as formatting pages for a printer that has been a long battle for developers. Help me out here guys; a few more that I know of from the top of my head are PDF and forced HTML.

    Good luck kenChris~

    Comment

    • DrBunchman
      Recognized Expert Contributor
      • Jan 2008
      • 979

      #3
      You could try using

      <% response.Conten tType ="applicatio n/doc" %>

      I don't know if that will correctly display all MS Word content but it might be faster.

      Dr B

      Comment

      • markrawlingson
        Recognized Expert Contributor
        • Aug 2007
        • 346

        #4
        Originally posted by CroCrew
        Well MSWord is, has been, and all ways will be a hog. I don’t know if we could really help you with out seeing your code. There might be some code improvements we could suggest if we could see it.

        Other then that you say the page renders fast when not using Word so, Word just might be the problem. As, far as formatting pages for a printer that has been a long battle for developers. Help me out here guys; a few more that I know of from the top of my head are PDF and forced HTML.

        Good luck kenChris~
        Ugh, tell me about it. I just had to make a bunch of our pages printer friendly. No easy task. Ended up creating a duplicate of the page, reformatting the entire page to fit on a 8 1/2 x 11, opening it in its own window, sending it a print command onload and then closing the window immediately after sending the print command.

        As far as word is concerned I would agree with CroCrew that if the only thing you're changing is ms word - that's probably where the problem lies because it is a hog. The only advice i could give you would be to mind the HTML content you're throwing at it, make it as lean as possible so that word has less to draw.

        On the fly pdf creation might be your best bet since it's built to be as printer friendly as possible. Though the context of what you're trying to do should always be considered.

        Sincerely,
        Mark

        Comment

        • kenChris
          New Member
          • Feb 2008
          • 3

          #5
          Originally posted by markrawlingson
          ......The only advice i could give you would be to mind the HTML content you're throwing at it, make it as lean as possible so that word has less to draw.......Sinc erely,
          Mark
          I took everything out and slowly rebuilt to see the problem and it was that i used an <input> as a checkbox. And although this did eventually render in word...it took forever.

          Taking that out and using an x instead of a checkbox has done the trick.

          Does anyone know a better way to create a checkbox control?

          Thanks for your help guys.

          Comment

          • jhardman
            Recognized Expert Specialist
            • Jan 2007
            • 3405

            #6
            Originally posted by kenChris
            I took everything out and slowly rebuilt to see the problem and it was that i used an <input> as a checkbox. And although this did eventually render in word...it took forever.

            Taking that out and using an x instead of a checkbox has done the trick.

            Does anyone know a better way to create a checkbox control?

            Thanks for your help guys.
            Is this something that only needs to be printed? Word automatically opens up a scripting engine when you try to add controls (so users can attach macros to clickable objects), it is my guess that that is what is causing the long load time. If it only needs to be printed, can you use an image of a checkbox?

            Jared

            Comment

            • kenChris
              New Member
              • Feb 2008
              • 3

              #7
              Originally posted by jhardman
              Is this something that only needs to be printed? Word automatically opens up a scripting engine when you try to add controls (so users can attach macros to clickable objects), it is my guess that that is what is causing the long load time. If it only needs to be printed, can you use an image of a checkbox?

              Jared
              Thanks jared. That's what i've done basically replaced it with an X.

              Thanks for the info about the scripting engine!

              Comment

              Working...