Retrieving Data as XML from SQL Server

  • Scenario:

    I want to populate a form via XML with data that is pulled from a 2005 SQL server.

    Scope:

    I have a customer database. The entry page displays the text, 'Customer RX:' and a field for input. When the submit button is clicked, the form queries the SQL database and I need for it to return patient information and auto fill a form that returns on the display page. In turn, once the page is displayed and the form fields are filled from the query. A program we use called RIGHT FAX, will then open and allow us to send this filled form as a faxed PDF.

    Question:

    How can I accomplish this? Any ideas anyone? I'm open.

    Thank you in advance.

    Rick

  • You can receive the data from SQL Server by using the FOR XML clause. With some additional effort it's even possible to get complete html pages (but text formatting would be kinda painful...)

    Please search for "XML Workshop" on this site to get a list of great articles by Jacob Sebastian covering both ways, importing and exporting xml data.

    If you need more guidance please provide more information. Please follow the first link in my signature on how to do that.

    Since this is a SQL Server forum you'll get the best help we can related to SQL Server subjects. For your remaining questions regarding filling forms and fax as PDF you might find better help on a forum that covers your (unmentioned) development tool.

    It would be a different subject if you're talking about SSRS as the reporting tool... But that's guessing. from my side.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • Lutz,

    Thank you for your words. I researching the idea of this and trying to explain the why or why not of this little adventure.

    You guessed correctly and we will be using SSRS for the reporting tool. I know that I should have said it earlier, but I was in a hurry. (My mistake)

    I am a FLASH/AS3 developer and am usually only connecting to a database. However, this task has been pushed upon me and it's sink or swim. So I came here looking for answers.

    Can you help me to figure this out?

    Is it possible, using ssrs, to pull the info from a SQL database, save it out as XML and then populate a form with it?

    Thank you,

    Rick

  • Did you read the articles I referred to in my previous post?

    What help do you need exactly? If it's a "how to" in general, I would recommend you try the tutorial that's available together with the SQL Server installation e.g. search for "tutorials [Reporting Services]" in BOL (BooksOnLine, the help system installed together with SSRS).

    The general answer to your question is: yes, it's possible (at least to generate the report. I'm not sure about fax as PDF).

    I'd recommend using this thread regarding questions about getting the report done and once that's working start another one thread regarding sending the results by fax. I think those are two different subject.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • Yes, I did. Thank you very much for the shove in the right direction.

    I looked up the entire series and printed them out and put them in a 3-ring binder. i also downloaded his series on XQuery as well and sqlxml tutorials.

    As luck would have it, I've found a way to process the populated form into a pdf and fax it.

    So, to confirm, I only need to find a way to pull the information in an xml string and use it to fill my display page.

    So, now what I am left with is this:

    I have a database filled with customers. Each can be tracked through an RX Prescription #: That is the only thing on my entry page. The data returned should fill fields that are:

    First Name

    Last Name

    Address

    DOB

    Doctors Name . . . . etc.

    This information should be pulled as xml. It does not have to be saved. Just populate my fields and I can take it from there.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply