Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

First, I apologize if this is the wrong forum; however, I believe someone here may have the answer. I have no problems associating the resource css file and calling it within the view.xml file. The form looks like I want it to until I republish the form with the "Enable this form to be filled out using a browser".

The colors and formatting go away when called as a web form essentially. Am I out of luck? Any suggestions or alternatives?

share|improve this question
    
I have still been toying with this idea and am close to resolving it for myself. I have the form working as desired and I have it published using XMLFormView. Finally, I added a Content Editor Web Part and using the source editor, I entered in some basic css: input {styles...}. It appears to be working so far. I will publish the full solution when I have it all working. –  Sean Jan 25 '12 at 14:48
add comment

2 Answers

up vote 2 down vote accepted

The InfoPath forms server (built in to SharePoint) doesn't support using custom styling outside of what you can do with the InfoPath designer. You'll need to still with the available options in the InfoPath designer.

If you want to post some screenshots of what you are trying to accomplish, we can give you some ideas on how to get creative with the InfoPath designer.

share|improve this answer
    
I appreciate the response. I figured as much so I went another direction. I decided to save my own simple generic xsn and then include the form via the XMLFormView Web Part. Here's a link on how to do this for anybody else who wants to go this route: nickgrattan.net/Publications.aspx –  Sean Jan 9 '12 at 19:45
add comment

OK, I have this working to my own satisfaction. I created my Infopath form and removed all formatting other than the tables of course. I published the form locally (it has managed code for a SQL Conn) and then uploaded via Central Admin. I then created an aspx page in SharePoint Designer and added the XMLFormView Web Part. I published the page. Once there, I edited the page to add a Content Editor Web Part. I added it underneath my form and choose a minimal chrome setting. Finally, I added this css using the source editor. I was able to find the style classes easily using Firebug.

<style type="text/css">
input {
border: 1px #CCC solid;
}
.ms-WPBody td {
    font-family: arial,helvetica,sans-serif !important;
    font-size: 12px !important;
}

.ms-WPBody TABLE, .ms-TPBody TABLE {
    font-size: 10px;
}

.ai_ {
    font-family: arial,helvetica,sans-serif !important;
    font-size: 12px !important;

}
.i_ {
    border: medium none;
    border-collapse: collapse;
    table-layout: fixed;
    word-wrap: break-word;
}

.d_ {
    font-family: arial;
    font-size: 12px;
} 
</style>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.