working with a xps document
-
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?
-
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?
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 -
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, 2007Okay, that is what I was afraid of. Back to the drawing board.
-
Okay, that is what I was afraid of. Back to the drawing board.
-
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?
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 :)