Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. XML / XSL
  4. Simple Reports/ RTF output

Simple Reports/ RTF output

Scheduled Pinned Locked Moved XML / XSL
xmlhelpcsharpdatabasetools
7 Posts 3 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    david mindplay com
    wrote on last edited by
    #1

    I’ve got a problem, I’m hoping someone out there has the answer to. I am a .Net programmer working for a small educational software company. I need to add some simple reporting to the project I am working on. Basically, I need to take some data from my database and format a RTF document from it that can then be displayed in a rich text box or printed or saved or whatever. Unfortunately RTF code is not so easy to understand. I was told by someone that I could use XSLT to do this. After some reading I found out that this is not exactly correct. You can use XSLT, however you still need to be able to write RTF code. I could use XSL-FO, but since .Net does not implement XSL-FO, I would need to use a third party tool in order to transform my XML data and XSLT stylesheet to RTF. My company doesn’t want to pay for one of these third party tools, nor do they want to deal with any complex licensing issues, that come along with them. Does anyone have any suggestions on how I can accomplish this task? The reports are not complex, just some simple text formatting and tables. Thanks for your help

    M 1 Reply Last reply
    0
    • D david mindplay com

      I’ve got a problem, I’m hoping someone out there has the answer to. I am a .Net programmer working for a small educational software company. I need to add some simple reporting to the project I am working on. Basically, I need to take some data from my database and format a RTF document from it that can then be displayed in a rich text box or printed or saved or whatever. Unfortunately RTF code is not so easy to understand. I was told by someone that I could use XSLT to do this. After some reading I found out that this is not exactly correct. You can use XSLT, however you still need to be able to write RTF code. I could use XSL-FO, but since .Net does not implement XSL-FO, I would need to use a third party tool in order to transform my XML data and XSLT stylesheet to RTF. My company doesn’t want to pay for one of these third party tools, nor do they want to deal with any complex licensing issues, that come along with them. Does anyone have any suggestions on how I can accomplish this task? The reports are not complex, just some simple text formatting and tables. Thanks for your help

      M Offline
      M Offline
      Mike Ellison
      wrote on last edited by
      #2

      Hi David. Would an HTML format be acceptable for your reports? I'm seeing more and more reporting modules producing HTML output that in the past would have been .rtf, and the code to launch an .html report in the default browser is simple.

      D 1 Reply Last reply
      0
      • M Mike Ellison

        Hi David. Would an HTML format be acceptable for your reports? I'm seeing more and more reporting modules producing HTML output that in the past would have been .rtf, and the code to launch an .html report in the default browser is simple.

        D Offline
        D Offline
        david mindplay com
        wrote on last edited by
        #3

        HTML would be ok. If it could look the same on the screen as it would on printed paper. Also, I would have to learn HTML, which I thankfully have been able to avoid up to this point. Can HTML do tables and margins and such? Forgive my ignorance. Also, the end users of the application's reporting feature will be school teachers, who aren’t known for being very computer savvy. If I use the default browser to open and view reports, I’ll get thousands of tech support calls because a teacher has lost the browser window behind the application window. It’s hard to explain the concept of “[Alt]+[Tab]” to school teachers. :-D The application hides the task bar so that kids aren’t messing with it instead of using the application. If I were to use HTML, I would have to use one of those browser window controls on a form in order to prevent the “[Alt]+[Tab]” problem. Thanks

        D 1 Reply Last reply
        0
        • D david mindplay com

          HTML would be ok. If it could look the same on the screen as it would on printed paper. Also, I would have to learn HTML, which I thankfully have been able to avoid up to this point. Can HTML do tables and margins and such? Forgive my ignorance. Also, the end users of the application's reporting feature will be school teachers, who aren’t known for being very computer savvy. If I use the default browser to open and view reports, I’ll get thousands of tech support calls because a teacher has lost the browser window behind the application window. It’s hard to explain the concept of “[Alt]+[Tab]” to school teachers. :-D The application hides the task bar so that kids aren’t messing with it instead of using the application. If I were to use HTML, I would have to use one of those browser window controls on a form in order to prevent the “[Alt]+[Tab]” problem. Thanks

          D Offline
          D Offline
          DavidNohejl
          wrote on last edited by
          #4

          hi, david@mindplay.com wrote: Also, I would have to learn HTML, which I thankfully have been able to avoid up to this point. :wtf: thankfully? hmmm. HTML is nice. CSS is cool. XML is almost perfect. :) (yes I am web developer ) :-D david@mindplay.com wrote: Can HTML do tables and margins and such? Forgive my ignorance. Even more. With use of CSS, you have lot of freedom in appereance. david@mindplay.com wrote: If I use the default browser to open and view reports, I’ll get thousands of tech support calls because a teacher has lost the browser window behind the application window. hmm. .NET can use Microsoft WebBrowser control - Using the WebBrowser control in .NET Article[^] And .NET Framework 2.0 has native WebBrowser control for .NET After quick search, there are some tutorial on HTML & related stuff: HTML Guide article[^] CSS For Beginners article[^] W3C - My favourite Web standard organization[^] And W3C Schools, great tutorials for web (recommended)[^] best regards, David 'DNH' Nohejl Never forget: "Stay kul and happy" (I.A.)

          D 1 Reply Last reply
          0
          • D DavidNohejl

            hi, david@mindplay.com wrote: Also, I would have to learn HTML, which I thankfully have been able to avoid up to this point. :wtf: thankfully? hmmm. HTML is nice. CSS is cool. XML is almost perfect. :) (yes I am web developer ) :-D david@mindplay.com wrote: Can HTML do tables and margins and such? Forgive my ignorance. Even more. With use of CSS, you have lot of freedom in appereance. david@mindplay.com wrote: If I use the default browser to open and view reports, I’ll get thousands of tech support calls because a teacher has lost the browser window behind the application window. hmm. .NET can use Microsoft WebBrowser control - Using the WebBrowser control in .NET Article[^] And .NET Framework 2.0 has native WebBrowser control for .NET After quick search, there are some tutorial on HTML & related stuff: HTML Guide article[^] CSS For Beginners article[^] W3C - My favourite Web standard organization[^] And W3C Schools, great tutorials for web (recommended)[^] best regards, David 'DNH' Nohejl Never forget: "Stay kul and happy" (I.A.)

            D Offline
            D Offline
            david mindplay com
            wrote on last edited by
            #5

            I would need the end product to be one single file, so that it can be saved or emailed. If I use XSLT to transform my data into HTML then it would be one file. I don't know much about CSS. Can I use CSS to create an HTML file or would I essentially have two files my XML and my CSS? Thanks

            D 1 Reply Last reply
            0
            • D david mindplay com

              I would need the end product to be one single file, so that it can be saved or emailed. If I use XSLT to transform my data into HTML then it would be one file. I don't know much about CSS. Can I use CSS to create an HTML file or would I essentially have two files my XML and my CSS? Thanks

              D Offline
              D Offline
              DavidNohejl
              wrote on last edited by
              #6

              hi again if you need one file, you can use inline CSS. CSS if for formatting HTML, you can write (generate with XSLT) it inside your html file. Example: (bold part is inline CSS) HTML Source:

              <h1 style="color:red">HTML heading 1, coloured to red using css</h1>
              

              result:

              HTML heading 1, coloured to red using css

              Got the idea? much cleaner way is to have css classes (you can define them in external .css file, bt you can do it in style element): <style> .red {color:red} </style> Use is similar: <h1 class="red"></h1> (it gives exctly same result as first example - benfit is that you can reuse defined class many times, and also that CSS effects may overlap - that's why they call it Cascading Style Sheet) Hope I gave you some ideas. This is only tip of the iceberg! :-> one more note - with css you can nicely control printing David Never forget: "Stay kul and happy" (I.A.)

              D 1 Reply Last reply
              0
              • D DavidNohejl

                hi again if you need one file, you can use inline CSS. CSS if for formatting HTML, you can write (generate with XSLT) it inside your html file. Example: (bold part is inline CSS) HTML Source:

                <h1 style="color:red">HTML heading 1, coloured to red using css</h1>
                

                result:

                HTML heading 1, coloured to red using css

                Got the idea? much cleaner way is to have css classes (you can define them in external .css file, bt you can do it in style element): <style> .red {color:red} </style> Use is similar: <h1 class="red"></h1> (it gives exctly same result as first example - benfit is that you can reuse defined class many times, and also that CSS effects may overlap - that's why they call it Cascading Style Sheet) Hope I gave you some ideas. This is only tip of the iceberg! :-> one more note - with css you can nicely control printing David Never forget: "Stay kul and happy" (I.A.)

                D Offline
                D Offline
                david mindplay com
                wrote on last edited by
                #7

                I see, thank you. I'm reading about CSS right now. Dave

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups