, ,

How file uploading works (for new and existing records)

Navigate to Attachments Tab.

 

A user can add attachments in two different ways, by browsing for files or by dragging and dropping files on the Existing Attachments area.

Browsing for Attachments:

Select 

. The new Browse Feature allows multiple files selection from the same location or multiple browse actions to select files from multiple locations. Select the desired files and press Open.

Note: The selected files are added to the list of pending files and are not uploaded yet.

At this stage, you can remove the selected files by pressing  or finish uploading the files by pressing  or Save Record. During Save, all pending files are uploaded.

Dragging and Dropping Files as Attachments

An easier way to handle attachments is to Drag-and-Drop the desired files on the Existing Attachmentsarea. The dragged files are added to the list and follow the same mechanism for uploading as described above.

Open Attachment

To view the contents of an attachment, select the desired file and press  .

Deleting Attachments

Select the desired attachments and press  . Multi-Selection works.

, ,

Set Default Values using the querystring

In the Querystring, you can define values that will be used as default values for a new record. The keyword “ID” is reserved and when used in the querystring, the form tries to load the record with the ID specified. All the other field names can be used to apply default values in the form of :

Code

http://<servername>/<site>/New.aspx?<FieldName1>=<Value1>&<FieldName2>=<Value2>…

For example :

We want to set the Category field (combobox lookup to another list) to 1, the Evaluation field (choise) to Negative, the PublishedDate field to the current date and the Priority field (popup lookup picker) to 3;#Medium.

The querystring should look like this :

Code

http://url_to_form/page.aspx?Category=1&amp;Evaluation=Negative&amp;PublishedDate=%3Dtoday()&amp;Priority=3;%23Medium

Notice that in the DateField we are actually applying a formula to the default value (=today()) and we escape the ‘=‘ character with %3D. We also have to escape the # character with the %23 equivalent.

NOTE : The keywords : “Type”, “RootFolder”, “ID” and “Source” are reserved from SharePoint and cannot be used as querystring default values.

We have 2 lists :

1. Customers. Columns : ID, Title

2. Orders. Columns : ID, Title, Date, Customer (Lookup for Customers)

In order to add multiple orders for the same customer, we should add a hyperlink control in the customer form.

The value of the control should be the absolute url of the NEW ORDER item. For example :

http://ServerName/Lists/Orders/NewForm.aspx?Source=xxxxx

In order to apply default value for the customer field, we make the hyperlink control calculated and we apply the following formula :

Code

http://ServerName/Lists/Orders/NewForm.aspx?Source=xxxxx&Customer={c_ID};%23{c_Name}

We use the following format since the default value should be in the ID;#Title format.

This allows the users to navigate to the New Order form directly from the customer form and execute multiple SAVE (NOT Save and Exit) and NEW actions without having to set the Customer field.

, ,

How to delete Error Web Parts from Edit/New page

How to delete web parts in any web part page

First navigate to the page that has the problematic web part. Then at the end of the url add the url parameter Contents=1. This will open the page in ‘Maintenance’ mode.

Now all the web parts can be viewed, even those with errors.

Users can select and delete the required web part the page will work as expected.

, ,

Localization in PowerForms

PowerForms can be localized through the Localization Section in the designer.

A list containing all the texts appearing inside forms either in controls, buttons or messages is displayed and the user can change the required texts. The list supports Unicode so changing the texts to fit your needs should not be a problem.

For performance and simplicity reasons, the  localization list can be saved separately in a xml file. In order to achieve this, an XML export button is available in the designer toolbar :

Press the export button and copy the “<Translations>” section of the XML specification (meaning from the “<Translations>” element until the “</Translations>” element) :

 

Place it in a text file, save as Unicode and upload it in the BPC PowerForms Binaries document library or another accessible Url. Then in the form options section, define the absolute url of the xml localization file and set the form NOT to save localizations.

Using this mechanism you can achieve simpler localization support for multiple forms, as a single xml file can support localization for all the forms in your site collection. Multiple files can be defined to support multiple languages as soon as you set the appropriate url in the “Localizations Url” property of the designer options section.

, ,

Locale/Calendar options in PowerForms

PowerForms enables users to identify the preferred Locale and Calendar Type for each form. (v.2.4)

PowerForms automatically recognizes the server locale and default calendar type and uses these settings to display data and perform data conversions (in formulas and script).

Two new properties have been added in the Form Options editor that allow users to alter that behaviour :

By default, these properties are empty which forces PowerForms to use the server settings retrieved.

Users can enter the required locale (a complete list can be found here) and then select one of the available calendars for that specific locale.

Available calendars Types :

 

  •  Gregorian
  • Hebrew
  • Hijri
  • Japanese
  • Korean
  • Taiwan
  • ThaiBuddhist
  • UmAlQura
, ,

XSLT Printing Step by Step using PowerForms

PowerForms provides an out of the box printing functionality using the layout of the run-time designer configuration.

In order to build our own custom reports, we have to use the XSLT based printing provided by PowerForms.

This is a step by step guide on designing your custom reports for users with minimum or no prior knowledge of XSLT.

Since the final output of the pritout is send to the browser, minumim Html knowledge is required.

Example

For our example we will assume we already have a simple list using PowerForms.

Our list will use a list with Articles.

 

The columns of this list are shown in the screen below :

The out of the box print layout is something like the following :

Now lets try to customize the print layout to fit our needs.

We should start from an empty XSLT file. Copy the following text and place it inside a text file (using a text editor, i.e. Notepad).

<?xml version=1.0 encoding=utf-8?>

<xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transformxmlns:msxsl=urn:schemas-microsoft-com:xslt exclude-result-prefixes=msxsl>

<xsl:output method=html indent=yes/>

<xsl:template match=/>

</xsl:template>

</xsl:stylesheet>

Now give the file a name that will assosiate it with the Articles list (i.e. articles.txt) and upload it in the “BPC PowerForms Binaries” document library or any other document library you already use for public use.

For this example we will upload the file in the “http://SERVERNAME/BPC PowerForms Binaries” library which is created during PowerForms installation.

Now we must apply the xslt file url to the form.

We edit an existing record from the Articles list using PowerForms, open the designer, select the OPTIONSsection and in the Printing properties of the designer, we apply the complete path of the file in the “Print Template” property.

If we try to use the print button at this moment, we will get an empty page which is expected since we haven’t made any changes in the contents of the file.

Now, since the file is in the document library, click on the file and select “Edit” to edit it in a text editor.

From now on, each time we save the file, we will be able to test the print layout.

We want to build a report that will include 2 columns : One for the Caption and one for the Contents of each control we use.

To do that we should create an HTML table inside the file.

This is how the xslt file becomes :

<?xml version=1.0 encoding=utf-8?>

<xsl:stylesheet version=1.0

xmlns:xsl=http://www.w3.org/1999/XSL/Transform

xmlns:msxsl=urn:schemas-microsoft-com:xslt

exclude-result-prefixes=msxsl>

<xsl:output method=html indent=yes/>

<xsl:template match=/>

<table cellspacing=0 cellpadding=4” >

<tr>

<td style=background-color:LightGray;font-weight:bold;width:150px;>Title</td>

<td><xsl:value-of select=*/*[@ControlName=’c_Title’]/></td>

</tr>

</table>

</xsl:template>

</xsl:stylesheet>

We added a table with a single row and 2 columns.

We have changed the background color of the first cell as well as font weight and cell width.

Than inside the second cell, we used the “<xsl:valuue-of select=”*/*[@ControlName=’c_Title’]”/>” tag in order to display the value of the Title.

Now to add more rows in our report, we use the same pattern adding tags of the following format:

<tr>   (OPEN ROW)

<td>   (OPEN CELL)

CAPTION

</td>   (CLOSE CELL)

<td>   (OPEN CELL)

<xsl:valuue-of select=”*/*[@ControlName=’c_Title’]”/>   (CONTROL VALUE)

</td>   (CLOSE CELL)

</tr>    (CLOSE ROW)

So after adding more fields in our report, the xslt file should become something like this :

<?xml version=1.0 encoding=utf-8?>

<xsl:stylesheet version=1.0

xmlns:xsl=http://www.w3.org/1999/XSL/Transform

xmlns:msxsl=urn:schemas-microsoft-com:xslt

exclude-result-prefixes=msxsl>

<xsl:output method=html indent=yes/>

<xsl:template match=/>

<table cellspacing=0 cellpadding=4” style=font-family:Verdana;>

<tr>

<td style=background-color:LightGray;font-weight:bold;width:150px;>Title</td>

<td><xsl:value-of select=*/*[@ControlName=’c_Title’]/></td>

</tr><tr>

<td style=background-color:LightGray;font-weight:bold;width:150px;>Category</td>

<td><xsl:value-of select=*/*[@ControlName=’c_Category’]/></td>

</tr><tr>

<td style=background-color:LightGray;font-weight:bold;width:150px;>Sub Category</td>

<td><xsl:value-of select=*/*[@ControlName=’c_SubCategory’]/></td>

</tr><tr>

<td style=background-color:LightGray;font-weight:bold;width:150px;>Priority</td>

<td><xsl:value-of select=*/*[@ControlName=’c_Priority’]/></td>

</tr><tr>

<td style=background-color:LightGray;font-weight:bold;width:150px;>Article Type</td>

<td><xsl:value-of select=*/*[@ControlName=’c_ArticleType’]/></td>

</tr><tr>

<td style=background-color:LightGray;font-weight:bold;width:150px;>Author</td>

<td><xsl:value-of select=*/*[@ControlName=’c_ArticleAuthor’]/></td>

</tr><tr>

<td style=background-color:LightGray;font-weight:bold;width:150px;“>Tags</td>

<td><xsl:value-of select=*/*[@ControlName=’c_Tags’]/></td>

</tr>

</table>

</xsl:template>

</xsl:stylesheet>

We changed the font family to Verdana and testing our print layout would give us something like this :

Besides from building your report from scratch, you could use an html editor to prepare the final report layout and then you should place the html content inside the <xsl:template> and </xls:template> tags and add the <xsl:value-of XXX> tags wherever you want to apply control values from the underlying list item.

Note 1 : As you can see in the above example, the control name is used to print data values, since PowerForms allows users to print any control value instead of list item value, allowing the users to also print controls with calculated values or any other control placed on the form.

Note 2 : XSLT performs special handling for some characters like “&“. You should replace the “&” character with the “&amp;” equivalent otherwise the transformation will fail.