How to call Infopath form from ASPX - InfoPath Dev
in

InfoPath Dev

How to call Infopath form from ASPX

Last post 08-29-2005 10:04 PM by Patrick Halstead. 14 replies.
Page 1 of 1 (15 items)
Sort Posts: Previous Next
  • 08-22-2005 11:43 AM

    How to call Infopath form from ASPX

    I have infopath form connected to SQL database
    I need to create aspx that list one field of the connected records
    and when I click it to open appropriate infopath form, so I can change data and submit back to database.

    Thanks

    Eugene
  • 08-22-2005 12:24 PM In reply to

    Re: How to call Infopath form from ASPX

    Hi Eugene,
    Welcome to the Forum!

    You find info regarding this at
    http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=645

    For further info search in the forums using "open InfoPAth form from ASPX" as the key word.

    If you still have the doubt please post here.

    Agni
    InfoPath Dev India
  • 08-22-2005 12:28 PM In reply to

    Re: How to call Infopath form from ASPX

    Hi Eugene,
    Page 278 of our book has a VB example of how to do this.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 08-24-2005 11:48 AM In reply to

    Re: How to call Infopath form from ASPX

    Thaks for reply.
    Agni, I checked the link, looks like it is good idea, but could you please explain what does it mean "trow xml into the browser as attachment"

    Patrik I got your book, but on page 278 is nothing about asp, maybe the page number is wrong ?

    Thanks in advance

    eugene

    Eugene
  • 08-24-2005 05:04 PM In reply to

    Re: How to call Infopath form from ASPX

    Hi Eugene,
    I was wrong. Sorry about that. I will ask Agni to post code on how to do this.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 08-25-2005 12:54 AM In reply to

    Re: How to call Infopath form from ASPX

    Hi Eugene,
    "throw xml into the browser as attachment" means, we will send an xml file to the client as an attachment to the response.

    Here is the code to throw an xml to open in InfoPath
    Note: Code is in c#

    //xmlDoc should be your InfoPath form xmldocument
    string xmlContent = xmlDoc.OuterXml;
    Response.AddHeader("Content-Disposition", "attachment; filename=Form.Xml");
    Response.AddHeader("Content-Length", xmlContent.Length.ToString());
    Response.ContentType = "text/xml";
    Response.Write(xmlContent);

    Hope this Helps!

    Agni
    InfoPath Dev India
  • 08-25-2005 09:29 AM In reply to

    Re: How to call Infopath form from ASPX

    Thank you Agni, but my case is a little bit different
    My infopath form connected to database and I do not want to save xml file at all.
    Can I generate output stream from ASPX with content of the xml document inside,
    the browser will understand "xml" and open infopath form on client side ?
    Thanks

    Eugene
  • 08-25-2005 04:55 PM In reply to

    Re: How to call Infopath form from ASPX

    Hello Eugene
    To throw the xml you will need to build it as per what you InfoPath solution is expecting it to be. This code can be used to talk to DB also. Its just that the data that you recieve from the DB needs to be appropriately molded so that you have the correct xml that you want to throw with you.

    Shanthi
    InfoPath Dev India
    Shanthi Reddy
  • 08-26-2005 11:04 AM In reply to

    Re: How to call Infopath form from ASPX

    Thank you all.
    What I'm trying to do is:
    I created an xml from My Infopath form as template, I read this xml file row by row and Respond.writeln(row); in the loop
    After I fluch Respond
    I set Response.Context type to "text/xml"


    Eugene
  • 08-26-2005 11:21 AM In reply to

    Re: How to call Infopath form from ASPX

    Sorry , disregard prev posting, I clicked submit by mistake.

    Thank you all.
    What I'm trying to do is:
    I created an xml from My Infopath form as template, I read this xml file row by row
    I set Response.Context type to "text/xml" and
    Respond.writeln(row); in the loop
    After I flush Respond.
    on the client side I have dialog save/open,
    but when I select save Infopath starts to open and give me the message:

    Infopath cannot open following File: WebForm1.aspx. The file is not a valid XML file

    with details:
    The form contains XML that cannot be parsed:
    A name was started with an invalid character.

    Line 1, Position 2
    <%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="EvalAsp.WebForm1" %>
    -^
    Why it is send .aspx file instead of .xml file?
    Is it possible to avoid it?

    If I save file as .aspx, change extension to .xml InfoPath form is fine
    I guess some thing wrong with HTTP header ?

    Thanks


    Eugene
  • 08-26-2005 01:44 PM In reply to

    Re: How to call Infopath form from ASPX

    Hi Eugene,
    I've asked Agni to respond in e-mail.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 08-26-2005 02:22 PM In reply to

    Re: How to call Infopath form from ASPX

    Thanks you for quik answer.
    It is working now, I had to change http header.
    I have another problem.
    When I publish my form to the localhost it is working fine.
    When I'm trying to publish even to same host but with IP address likehttp://###.888.999.000/Folder/ggg.xsn Infopath ask me to login with my network login and password, publish form, but this form crashes when I'm trying to run it.
    It asks me to report to Microsoft about the error and if I click debug button gives me some memory cennot write error.

    What I'm douing wrong

    Thanks


    Eugene
  • 08-26-2005 10:55 PM In reply to

    Re: How to call Infopath form from ASPX

    Hi Eugene,
    Are you saying that it crashes when you publish? Is that from inside the Designer? I've never heard of this, but I think the debug error may offer some clue here. Can you copy something to thehttp://.../ location using some other tool?

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 08-29-2005 09:07 AM In reply to

    Re: How to call Infopath form from ASPX

    Hi Patrick, it crashes when I'm trying to use published template.
    I can wright to the server anything, because it in the internal network.
    Thanks Eugene

    Eugene
  • 08-29-2005 10:04 PM In reply to

    Re: How to call Infopath form from ASPX

    Hi Eugene,
    We need more details. Please send me e-mail and we can do a Live Meeting and debug this with you on Wednesday or Thursday.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (15 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.