How do I customize the print layout of a SharePoint list item? - css

i need to be able to produce a "pretty" printout of an individual list item's values, with the goals being:
get rid of all navigation
organize data as it would appear on a typical paper form (a customer requirement)
i'm avoiding using InfoPath at this time due to other issues (which i'll post separate questions for...)
for example, i have an individual list item that normally displays similar to the following DispForm.aspx example:
i need a printed version (PrintForm.aspx??) that will display similar to the following example:
from what i can tell, i can't do this just by modifying/creating custom CSS.
it also seems that i can't quite do this just by creating my own "print" version of DispForm.aspx.
any suggestions, ideas, links would be very helpful.

Creating a custom list form is probably what you want. Without the master page attached to it or anything.
You can find a walkthrough here that will get you started:
http://office.microsoft.com/en-us/sharepointdesigner/HA101191111033.aspx
Enjoy.

You could use CSS to hide all the navigation etc. that you don't need using a media="print" stylesheet, but you won't be able to make the exact changes to the layout you've illustrated.
If it doesn't have to be exactly like the example, it would be fairly trivial to hide all but the name->value table and just print that. If you really do need to merge fields and re-layout the table then you likely have to hack up the server-side.
Why can't you create your own version of the page?

Using Sharepoint Designer, you could create a custom aspx page that uses a dataview webpart to do this...

#mortenbpost's link was just what i needed:
Create a new page that contains a custom list form
specifically, here's what you need to do to get a "basic" custom page for a list item -- from which you can completely customize it with XHTML/CSS:
first
ensure your list has all the columns you'll need
second
here's how to create a custom "view" page (virtually the same steps can be followed for a custom "new" or custom "edit" page):
Open MS Office SharePoint Designer
File -> Open Site...
enter your web-site URL
Make sure the "Folder List" Task Pane is visible (Task Panes -> Folder List)
Expand the "Lists" folder
You should see entries like the following:
Announcements
Calendar
...
YOUR LIST NAME
...
Expand the entry with YOUR LIST NAME
You should see entries like the following
Attachments
Items
AllItems.aspx
DispForm.aspx
EditForm.aspx
NewForm.aspx
Right-Click on YOUR LIST NAME
Select New -> ASPX
Re-name the file to something meaningful, like: PrintForm.aspx
Open PrintForm.aspx
View in "Split" mode
In the Code pane, you should see your insert-point inside a blank html form
Insert -> SharePoint Controls -> Custom List Form...
Select YOUR LIST NAME from the first drop-down (List or document library to use for form)
Select "Item" from the second drop-down (Content type to use for form)
Select "Display item form (used to view list items)" (this is where you choose between view, new, edit)
Un-check "Show standard toolbar" when creating a printable form
Click OK
In the Design pane, you should see a basic table layout with labels on the left and values on the right
In the Code pane, you should see such code as the following for every Column in your list (this one's for a "Single line of text" column type):
<tr>
<td width="190px" valign="top" class="ms-formlabel">
<H3 class="ms-standardheader">
<nobr>Column name</nobr>
</H3>
</td>
<td width="400px" valign="top" class="ms-formbody">
<xsl:value-of select="#Column_x0020_name"/>
</td>
</tr>
You can now just take all those <xsl:value-of select="#Column_x0020_name"/> entries and do standard XHTML/CSS layout
To test, save your work
Then, in a web browser, navigate to your SharePoint web-site
Select an item you've already entered data for
Choose "View Item"
In the address bar, replace DispForm.aspx with PrintForm.aspx
some things to keep in mind:
spaces and punctuation characters make for annoying naming of Column name
Column name in the code will have a maximum length of 32 -- any names longer will be truncated, e.g.:
SharePoint Column name: this is a long name
becomes in the code: this_x0020_is_x0020_a_x0020_long
any Column name in the code that would be a duplicate will be length 32 plus a numeric suffix. so, given the above column also exists, we would then have e.g.:
SharePoint Column name: this is a long name also
becomes in the code: this_x0020_is_x0020_a_x0020_long0
if you add columns or modify columns, you'll have to add them in by hand to this page
(do the Insert -> SharePoint Controls -> Custom List Form... on another "dummy" page to get the naming right)
again, i couldn't have done this without #mortenbpost's answer!

*****You can now just take all those entries and do standard XHTML/CSS layout *****
can you expand this with an example on how to do it?

This isn't an answer so much as a note to the above.
Use a custom list form but keep in mind that if any of the columns have versioning turned on you will not be able to get at the "data" easily. For example if one of your colums is a Notes column and everytime someone edits the notes field a new version is appended then none of that is accessible as it's essentially a seperate "list." I'm stuck on this issue as I also have a client asking for a print out which "doesn't look like it's from SharePoint."

Alternatively, you could export to a spreadsheet & print from there.

Related

Enterprise Architect how to exclude elements on report

I want to generate report for my diagram, I've created a simple template:
I want to have only activity task elements listed in my report table, without events, pools and other fields.
I have tried to set elements as non-printable, I was using "Hide annonymous elements" flag, and changed this field in element details, and also I was using Exclude filters. I don't know what is going on but at the end my generated report contains either all elements or none. Is there any magic flag or something? No matter what I change, at the end it does'nt matter, because report is always the same....
You can set a filter in the properties of your template to include only Activity elements
This definitely works as I use that all the time, so if something goes wrong with this there must be something else playing.

VS2008/ASP.NET 3.5 - How to create dynamic webforms

The question in a nutshell: Is there a way to add forms dynamically to a aspx-page? I know how to add controls to an existing form, but how to add a whole form?
Bckground:
I am "forced" to work in Visual Studio 2008 and I want to create a controller, which builds a page depending from the list of elements a model gives it (e.g.: the list may contain a paragraph, an image, another paragraph, a parapgraph again, a form and so on).
This works fine for the first examples as I am able to add them to the inner-html of a div-container.
Thinking about ways to generate a form like this (innerHTML += form), I feel I'd be throwing the few possible advantages ASP I can see (compared to PHP) out of the window in terms of input validation and so on. But I can't find a way to generate a "real, server-run" form. The same goes for gridviews, but I guess the solution may be similar.
A possible workaround would be to create an empty form
<form runat="server" id="dummyForm">...
and add controls to it dynamically. The obvious(?) downside to this would be, that I couldn't change its position (at least I wouldn't know how) in relation to the other content elements.
Another downside would be that I would be limited to one form per page and that may or may not be sufficient. If it wasn't I would starting to add several empty dummy-forms and would start indexing them and all of that doesn't look very cool to me.
Is there a more elegant way to a solution?
TIA
Simon
You can't add more than once server side Form tag in single aspx file
(in run time or design time)
maybe this article help you to generate dynamic forms :
https://msdn.microsoft.com/en-us/library/aa479330.aspx

adding new menu in Select (All,Inverted Selection) in Alfresco Share

I am newbie to the Alfresco.Now my requirement is how to add new menu[All(All pages)] in Select. wherever user perform search function lets say 250 results have found & user selects All in page 1 & its selecting only current page results and not selecting entire 250 records & then user goes page by page can edit the properties for the entire 250 records.in the new functionality if user selects [All(All pages)] then all records should be selected & edit the properties for 250 records at one go.So I want to add new menu with All(All pages) & change the existing menu current labels as All(Current Page).How to achieve this functionality and what files need to changed.How should i know that which files are currently used?Is there any debugger can be used to know the files?
Alfresco Version
4.2.e
My guess, is that if you go through this previous version of Jeff Potts' Tutorial you will be able to figure this out by yourself.
Simplest option is to edit label of that particular action in out of box property file.
You can find it under
<ALF_HOME>\tomcat\webapps\share\WEB-INF\classes\alfresco\messages\slingshot.properties
This entry
menu.select.all=All
Change label here and it will be reflected.
NOTE: It is not best way to implement this. Ideally you need to override property file and change label
The issue here is that only the items shown on the page have been loaded. This means that the metadata for the items not shown on the page won't be available. The metadata of each node is used to evaluate it's applicability to any action. If the node is locked or has had its permissions changed then it won't be possible to edit it. This is why "all" only means all items on the current page of data.

FilePicker.IO & Meteor (Multiple Widgets on a Page)

I am using FilePicker.IO with Meteor. I have it set up and working, but I have fun into an issue using multiple widgets on a page.
I have a table with rows of data. The data set is a bunch of users with name, photo, address, etc.
I'd like to include a "upload photo" button on EACH row, but since the widget is rendered by ID, I am limited to one per page. Wondering if there is a solution where I can have an upload widget on each row of the table.
Here is my code in my coffee file:
filepicker.setKey('askdjw&H*(Djkjew)') #Not my key
Template.admin.rendered = () ->
filepicker.constructWidget $('#uploadPhoto')
HTML:
<td><input type="filepicker-dragdrop" id="uploadPhoto" class="{{_id}}"/></td>
A couple of things :
if {{_id}} is a unique id it should be in the id attribute
it looks like you are just passing a jQuery selector into filepicker, what is stopping you from using $('.uploadPhoto') instead?
You can see a similar pattern here in my datatables implementation

SharePoint list item with checkbox databinding possible?

In SharePoint I can tee up a binding to an edit field like this below. When the form posts back the changes are automatically persisted to the underlying list item.
<PublishingWebControls:RichHtmlField ID="Field1" FieldName="MySPListItemFieldName" ...
So this works great for RichHtmlFields, but say I've got a Yes/No (boolean) field in the same list item, is there a similar construct to bind that field to a check box control in a similar way?
My goal is to not have to throw down a line of c# to transfer the value of the control to the field, I want it to be automatic like RichHtmlField. It seems like there has to be a straight forward way of doing this since SharePoint does this itself with its internal list item editing page (EditForm.aspx).
What you're after is a BooleanField control on your form:
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.booleanfield.aspx
Just set the FieldName to that of your Yes/No column, should work fine.

Resources