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
  1. Home
  2. General Programming
  3. Visual Basic
  4. working with a xps document

working with a xps document

Scheduled Pinned Locked Moved Visual Basic
csharpdatabasesecurityxml
5 Posts 4 Posters 5 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.
  • A Offline
    A Offline
    Aptiva Dave
    wrote on last edited by
    #1

    I have a client that works in security and has a program that displays all of the instances when a key card is used at one of the many locked doors they have and registers who's key was used, the door they were trying to open, the time of the attempt, and whether they were successful or not. Now, the software they have can pull up a report based on a date range but it can't sort any other way. That is when they called me. I found that the format that the program saves a report only saves the schema of the report fields and none of the data, but I could send the report to the microsoft xps printer and got it to save me a xps file (the document printer would only save it as a tiff image). So, now I have an xps document that I would like to load into a vb.net 2.0 app to do some searches on the document. Is there a way for vb.net to read this document as is, or do I need to convert it to another format?

    D J 2 Replies Last reply
    0
    • A Aptiva Dave

      I have a client that works in security and has a program that displays all of the instances when a key card is used at one of the many locked doors they have and registers who's key was used, the door they were trying to open, the time of the attempt, and whether they were successful or not. Now, the software they have can pull up a report based on a date range but it can't sort any other way. That is when they called me. I found that the format that the program saves a report only saves the schema of the report fields and none of the data, but I could send the report to the microsoft xps printer and got it to save me a xps file (the document printer would only save it as a tiff image). So, now I have an xps document that I would like to load into a vb.net 2.0 app to do some searches on the document. Is there a way for vb.net to read this document as is, or do I need to convert it to another format?

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      XPS describes an image of a printed page, not the data in it, kind of like PostScript or HP's PCL. The .NET Framework, nor anything else for that matter, has no methods to turn the file back into the data that generated it. Basically, the file is useless to you. You have to find some other way to export the data from that app or have it print in some other format that can output plain text or an XML file, or find some kind of export function in it.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      A 1 Reply Last reply
      0
      • D Dave Kreskowiak

        XPS describes an image of a printed page, not the data in it, kind of like PostScript or HP's PCL. The .NET Framework, nor anything else for that matter, has no methods to turn the file back into the data that generated it. Basically, the file is useless to you. You have to find some other way to export the data from that app or have it print in some other format that can output plain text or an XML file, or find some kind of export function in it.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007

        A Offline
        A Offline
        Aptiva Dave
        wrote on last edited by
        #3

        Okay, that is what I was afraid of. Back to the drawing board.

        S 1 Reply Last reply
        0
        • A Aptiva Dave

          Okay, that is what I was afraid of. Back to the drawing board.

          S Offline
          S Offline
          Steven J Jowett
          wrote on last edited by
          #4

          I have used some data mining software in the past for just this sort of thing. Have a look at Monarch[^] by DataWatch.

          Steve Jowett ------------------------- It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)

          1 Reply Last reply
          0
          • A Aptiva Dave

            I have a client that works in security and has a program that displays all of the instances when a key card is used at one of the many locked doors they have and registers who's key was used, the door they were trying to open, the time of the attempt, and whether they were successful or not. Now, the software they have can pull up a report based on a date range but it can't sort any other way. That is when they called me. I found that the format that the program saves a report only saves the schema of the report fields and none of the data, but I could send the report to the microsoft xps printer and got it to save me a xps file (the document printer would only save it as a tiff image). So, now I have an xps document that I would like to load into a vb.net 2.0 app to do some searches on the document. Is there a way for vb.net to read this document as is, or do I need to convert it to another format?

            J Offline
            J Offline
            Justin Kalweit
            wrote on last edited by
            #5

            XPS is just XML compressed with zip. (If you change the file extension from .xps to .zip, you can view the contents with WinZip) Once you figure out how to load it into VB.Net, (try looking up PrintDocument) you should be able to traverse the XML. Depending on the format of the report, you should be able to recover the data into a usable format. But that sounds like a lot of work to avoid if possible :)

            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