Ressource Files - InfoPath Dev
in

InfoPath Dev

Ressource Files

Last post 08-20-2009 06:53 PM by basquang. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 08-08-2005 12:31 AM

    Ressource Files

    Hi,

    I have some ressource Files in my form (XSL files) and I have sometimes problem with them!

    How to know where I have to copy them?

    Because If I open my form sometimes infopath don't find my xsl because he search on my desktop and sometimes that work because he go on c:\ (where the file was when I have link it to my form)! and when you are in debug mode you have to put your files on c:\Progrm Files\Visual Stuio .Net 2003\Common7\IDE !

    Is there any way to put this file in the xsn for don't have this problem of deployment? Or things to make for be sure that infopath go on the right place?

    Thanks for your help!

    ++

    Thierry

    P.S. Patrick if it's in your book can you say me in which chapter? Because I don't remember that you speak about that! Thanks

    I don't understand

    Every moment hesitated is a moment gone for life!!! Think about it
    Infopath 2007, Langage: C#2.0 (Modèle Objet 2003)
    merci de lire ceci
  • 08-08-2005 01:19 AM In reply to

    Hi Thierry,
    Tools->Resource Files->Add should add your XSL files to the XSN. If you add it as an XML file, then you can reference it from within the solution using code or in the view by treating it as a data source. How are you trying to reference it? Did you really add it as an XML resource file (note: XSL is just XML)?

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

    quote:
    Hi Thierry,
    Tools->Resource Files->Add should add your XSL files to the XSN.


    I'm ok with this ;-)

    My problem is when you use the form. Sometimes infopath make an error and he say for example : unable to find "a path here/myxsl.xsl"

    My question was how to know or how to be sure that infopath can find my xsl file?

    If I have good understand, you say me that is better to link my XSL as a datasource! So you can include in the xsn my xsl! I am right?

    Thanks for your help!

    ++

    Thierry

    Every moment hesitated is a moment gone for life!!! Think about it
    Infopath 2007, Langage: C#2.0 (Modèle Objet 2003)
    merci de lire ceci
  • 08-08-2005 12:43 PM In reply to

    Yes, then you can access via code and you don't have to hardcode the path. Agni, can you paste some sample code which accesses 2DS files?

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

    Hi Thierry,
    Here is the code that accesses the secondary datasource.
    IXMLDOMDocument2 domSecondaryXML = (IXMLDOMDocument2)thisXDocument.CreateDOM();
    domSecondaryXML.async = false;
    domSecondaryXML.load("datasource.xml");

    Now youc an start using domSecondaryXML like any other IXMLDOMDocument2 object.


    Agni
    InfoPath Dev India
  • 08-09-2005 12:39 AM In reply to

    Hi Patrick and Agni,

    Thanks a lot for your help!

    I know now how I can do!

    ++

    Thierry

    Every moment hesitated is a moment gone for life!!! Think about it
    Infopath 2007, Langage: C#2.0 (Modèle Objet 2003)
    merci de lire ceci
  • 08-19-2009 08:22 PM In reply to

    Hi All!

    Can I use C# code to access Resource Files (template.xsl) in InfoPath 2007? How to use it?

  • 08-19-2009 09:12 PM In reply to

     You can get a Stream object to the any of the XSN's files using the method OpenFileFromPackage() like this:

    this.Template.OpenFileFromPackage("view1.xsl")

    This will allow you to acces the files' contents, but not modify them at runtime.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 08-20-2009 06:53 PM In reply to

    Thanks Jimmy. It work well!

Page 1 of 1 (9 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.