Ravendra's Blog

March 20, 2012

Contents within a Broder with DropShadowEffect getts blured (WPF)

Filed under: Uncategorized — Ravendra Mishra @ 11:02 am

I have a user control which mimics behaviour of modal window on WPF application. This user control is wrapped in a border with drop shadow effect. Problem is contents within this user control are not clear, fonts are specially blurred, problem getts worse on resizing etc.


				<Style TargetType="{x:Type UserControl}" x:Key="ctModalWindow">


				<Setter Property="Template">


				<Setter.Value>


				<ControlTemplate TargetType="{x:Type UserControl}">


				<Grid>


				<Border Style="{StaticResource DarkShadowBorderStyle}">


				<Grid>

............

.................

                </grid>


				</Border>


				</Grid>


				</ControlTemplate>


				</Setter.Value>


				</Setter>


				</Style>

 

I found that creating a new border without dropshadow effect and wrapping everything else init solves the problem. While original order is just on top of everything else. It gives same visual appearance and behaviour but solves the problem of blurness. So now template looks like as below


				<Style TargetType="{x:Type UserControl}" x:Key="ctModalWindow">


				<Setter Property="Template">


				<Setter.Value>


				<ControlTemplate TargetType="{x:Type UserControl}">


				<Grid>


				<Border Style="{StaticResource DarkShadowBorderStyle}"/>


				<Border Style="{StaticResource BorderStyle}">


				<Grid>

............

.................

                </grid>


				</Border>


				</Grid>


				</ControlTemplate>


				</Setter.Value>


				</Setter>


				</Style>

 


				<Style TargetType="{x:Type Border}" x:Key="BorderStyle">


				<Setter Property="Background" Value="#FF0090BC"/>


				<Setter Property="BorderBrush" Value="#FF0090BC"/>


				<Setter Property="CornerRadius" Value="5"/>


				<Setter Property="Width" Value="Auto"/>


				<Setter Property="Height" Value="Auto"/>


				</Style>

 


				<Style TargetType="{x:Type Border}" x:Key="DarkShadowBorderStyle" BasedOn="{StaticResource BorderStyle}">


				<Setter Property="Effect">


				<Setter.Value>


				<DropShadowEffect Opacity="0.65" Direction="270" BlurRadius="10"/>


				</Setter.Value>


				</Setter>


				</Style>

Advertisements

May 24, 2010

Things to know

Filed under: Uncategorized — Ravendra Mishra @ 5:04 pm

.Net performance related links

http://msdn.microsoft.com/en-us/library/ms173196(v=vs.80).aspx

Asp.net interview questions

http://www.interviewquestionseasy.com/55-asp-dot-net-interview-questions.html

Sharepoint interview quetions

http://mysharepointwork.blogspot.com/2009/09/sharepoint-object-model.html

C#

 Class/Struct, Value/Ref type, Boxing/ Unboxing, PassByValue, PassByRef, System.Object, GetHashCode, Equals, ==, IComparable

Managed Code, MSIL, byte code, CLR, CTS, JIT, CLS,

Assembly (Private, Shared, Satellite, local, global), Manifest, Metadata, GAC, Strong Name, ILDASM, Gacutil, Delay Signing,

garbage collection, Compaction, Pining, Finalize, Destructor, Dispose, GC.SuppressFinalize, Resurrection,

process, apartments, threads, task

Localization, globalization

Static Class/Method, Interface, Abstract class, Polymorphism, Sealed class, virtual, Derived, final, private, public, internal, protected,

System exception, Application exception,

CCW, RCW, PInvoke

[DllImport(“Kernel32.dll”)]
static extern int Sleep(long dwMilliseconds);

Thread, Sleep/Interrupt, Suspend/Resume, Abort, Wait, Join,

BeginInvoke, EndInvoke, IAsyncResult, WaitOne, Callback method

Lock, Monitor, Mutex, Reader/Writer, ManualResetEvent/AutoResetEvent

Abstract class/method, interfaces, virtual, override, new

Indexer, Extension methods, Enumerator

Serialization, Remoting, Web services

ADO.NET, Dataset, DataAdapter, Commands, SQlConnection

Debug, trace, logging,

Yield, dynamic

Delegate, Event, MulticastDelegate, Asynchronous delegate, IAsyncResult

Threading, Wait, Join, Task, Thread Safety, AppDomain

AsParallel,AsParallel().WithDegreeOfParallelism(6),
AsParallel().WithCancellation (cancelSource.Token), 
Parallel.foreach, ThreadLocal<T>, Task.Factory.StartNew, Task.WaitAll , Task.WaitAny ,
AggregateException, TaskCreationOptions, CancellationToken , TaskContinuationOptions, 
ContinueWith, TaskFactory ,

http://www.albahari.com/threading/

Serialization, XML Serialization, Binary, Benefits

XML, Parsing

Attributes
Linq, Lambda express, anonymous methods, extension methods, anonymous types, generic, partial classes

Threading, Deadlock, Synchronization

Dataset, SQLConnection, Adapter, Command etc..

Unity, Inversion of control, dependency injection, interception patterns

ASP.Net

Page lifecycle

state management (viewstate, cookies, hidden files, querystring, control state and Application state, session, profiles)

Cache (Dependency (File Based, Time, Key Dependency), Expiration), Cache Callback, Page output caching, page fragment caching

Application,

AJAX, HttpHandler, HttpModule, scriptmanager, updatepanel,

session, state,

WCF

http://wcftutorial.net/

Unification of NET remoting, MSMQ , Web services , COM+

Transport scheme(TCP, HTTP, Peer network, IPC or Pipe, MSMQ)

Hosting (IIS, SelfHosting, Windows Activation Service)

EndPoint, Address, Binding, contract

ServiceContract, OperationContract,

DataContract (DataMember, IsRequired, Order), KnownType, Serializable,

FaultContract

MessageContract, MessageHeader, MessageBodyMember

WSDL, WS-Policy

ServiceBehaviour (PerSession, PerCall, Single)

two way (http://msdn.microsoft.com/en-us/library/ms731064.aspx), security, Asynchronous, Transaction)

OperationContract overloading not supported due to limitation in WSDL (Use name property for overloads, this will be used to create method names in proxy)

receiving/sending messages to/from WCF service (instead of operation parameter)

OperationContext.Current.IncomingMessageHeaders.GetHeader(Of String)(“ServiceMessage”, “ns”))

OperationContext.Current.OutgoingMessageHeaders.Add(header)

SQL

Stored procedure vs User defined function

http://chiragrdarji.wordpress.com/2007/04/17/difference-between-user-defined-function-and-stored-procedure/

Delete vs Truncate

http://codebetter.com/raymondlewallen/2005/05/09/the-difference-in-truncate-and-delete-in-sql-server/

Correlated subquery and Subqueries

Temporary table, Global Temporary table vs table variable

http://www.sqlteam.com/article/temporary-tables

Clustered / Non clustered index

Exception handling

Locking

Trigger

Cursor

Dynamic parameters in sql stored procedure

Profiling, performance tunning

Design Patterns

 

Prism, CompositePresentationEvent

MVVM, MVP, Observer, Repository, Facade

Unity how to resolve with multiple parameter constructor http://classicalprogrammer.wikidot.com/registering-constructor-parameter-with-unity-container

WPF

 

Event, AttachedEvent, Routed Event (Tunnelling, Bubbeling)

IValueConverter, ObservableCollection, INotifyPropertyChanged

Page, Class, User Control, Context, DataContext

Command, CommandParameter, CommandBinding, RoutedCommand (Execute, CanExecute),

Resources, Resource Dictionary, Managed Dictionary, Static Resource

Content, Template, ItemTemplate, DataTemplate, ControlTemplate, ContentPresenter,

Style, Trigger, MultiDataTrigger, Setter,

Dependency Propery, DependencyObject, Binding, TemplateBinding, Path, Mode, RelativeSource, AncestorType, Converter (Convert/ConvertBack),

Transform, StoryBoard, VisualStateManager, Animation,

KeyboardNavigation.TabNavigation,

Brush, Panels, TextBlock (Inline, Run), Grid, DataGrid,

February 10, 2010

SQL Query to find all column names in a table

Filed under: Uncategorized — Ravendra Mishra @ 12:19 pm

 

declare @SearchStr as
varchar(256)

set @SearchStr =
‘System_’

 

CREATE
TABLE #Results
(ColumnName nvarchar(370), ColumnValue nvarchar(3630))

 

    SET
NOCOUNT
ON

 

    DECLARE @TableName nvarchar(256), @ColumnName nvarchar(128), @SearchStr2 nvarchar(110)

    SET @TableName =

    SET @SearchStr2 =
QUOTENAME(‘%’
+ @SearchStr +
‘%’,””)

 

    WHILE @TableName IS
NOT
NULL

    BEGIN

        SET @ColumnName =

        SET @TableName =

        (

            SELECT
MIN(QUOTENAME(TABLE_SCHEMA)
+
‘.’
+
QUOTENAME(TABLE_NAME))

            FROM     INFORMATION_SCHEMA.TABLES

            WHERE         TABLE_TYPE =
‘BASE TABLE’

                AND    QUOTENAME(TABLE_SCHEMA)
+
‘.’
+
QUOTENAME(TABLE_NAME)
> @TableName

                AND    OBJECTPROPERTY(

                        OBJECT_ID(

                            QUOTENAME(TABLE_SCHEMA)
+
‘.’
+
QUOTENAME(TABLE_NAME)

                             ),
‘IsMSShipped’

                         )
= 0

        )

 

        WHILE (@TableName IS
NOT
NULL)
AND
(@ColumnName IS
NOT
NULL)

        BEGIN

            SET @ColumnName =

            (

                SELECT
MIN(QUOTENAME(COLUMN_NAME))

                FROM     INFORMATION_SCHEMA.COLUMNS

                WHERE         TABLE_SCHEMA    =
PARSENAME(@TableName, 2)

                    AND    TABLE_NAME    =
PARSENAME(@TableName, 1)

                    AND    DATA_TYPE IN
(‘char’,
‘varchar’,
‘nchar’,
‘nvarchar’)

                    AND    QUOTENAME(COLUMN_NAME)
> @ColumnName

            )

    
 

            IF @ColumnName IS
NOT
NULL

            BEGIN

                INSERT
INTO #Results

                EXEC

                (

                    ‘SELECT ”’
+ @TableName +
‘.’
+ @ColumnName +
”’, LEFT(‘
+ @ColumnName +
‘, 3630)

                    FROM ‘
+ @TableName +
‘ (NOLOCK) ‘

                    –+ ‘ WHERE ‘ + @ColumnName + ‘ LIKE ‘ + @SearchStr2

                )

            END

        END    

    END

 

    SELECT
distinct (ColumnName)
FROM #Results order
by ColumnName–where columnName like ‘%Words%’

drop
table #Results

December 31, 2009

Sharepoint 2010 New Features

Filed under: Uncategorized — Ravendra Mishra @ 2:50 pm

 Sharepoint 2010 New Features

December 3, 2009

Sharepoint workflow on list item delete

Filed under: Uncategorized — Ravendra Mishra @ 6:04 pm

In order to trigger workflow on item delete you need to create event receivers and from event receiver call the workflow already attached with list. You may also pass parameters to the workflow.

FeatureReceiver.cs

using System;

using System.Collections.Generic;

using CMPM;

using Microsoft.SharePoint;

using Microsoft.SharePoint.Administration;

using Microsoft.SharePoint.Workflow;

namespace CMPM

{

    public class FeatureReceiver : SPFeatureReceiver

    {

        string assemblyName = “EventDeleteItemMPPWWorkflow, Version=1.0.0.0, Culture=neutral, PublicKeyToken=42bd3e28d7726752”;

        public override void FeatureActivated(SPFeatureReceiverProperties properties)

        {

            SPWebApplication webApp = null;

            if (properties.Feature.Parent is SPWeb)

            {

                SPWeb spWeb = properties.Feature.Parent as SPWeb;

                foreach (string strList in ActivityLists.Get())

                {

                    SPList list = spWeb.Lists[strList];                   

                    //Add date event receiver

                    string classNameDateHandler = “CMPM.DeleteEventHandler”;

                    list.EventReceivers.Add(SPEventReceiverType.ItemDeleting, assemblyName, classNameDateHandler);                  

                }

                spWeb.Update();

            }

        }

        public override void FeatureDeactivating(SPFeatureReceiverProperties properties)

        {

            if (properties.Feature.Parent is SPWeb)

            {

                using (SPWeb web = (SPWeb)properties.Feature.Parent)

                {

                    foreach (string strList in ActivityLists.Get())

                    {

                        SPList List = web.Lists[strList];

                        foreach (SPEventReceiverDefinition listEventReceiverDefinition in List.EventReceivers)

                        {

                            if (listEventReceiverDefinition.Assembly == assemblyName && listEventReceiverDefinition.Type == SPEventReceiverType.ItemDeleted)

                            {

                                listEventReceiverDefinition.Delete();

                                break;

                            }

                        }

                    }

                    web.Update();

                }

            }

        }

        public override void FeatureInstalled(SPFeatureReceiverProperties properties) { /* no op */}

        public override void FeatureUninstalling(SPFeatureReceiverProperties properties) { /* no op */}

        private List<SPWebConfigModification> CreateConfigModifications()

        {

            List<SPWebConfigModification> configModifications = new List<SPWebConfigModification>();

            //

            //  TODO: Add code to create web config modifications

            //

            return configModifications;

        }

    }

}

DeleteEventHandler.cs

using System;

using Microsoft.SharePoint;

using Microsoft.SharePoint.Workflow;

namespace CMPM

{

    public class DeleteEventHandler : SPItemEventReceiver

    {

        //public override void ItemDeleted(SPItemEventProperties properties)

        public override void ItemDeleting(SPItemEventProperties properties)

        {

            base.ItemDeleting(properties);

            string strListName = properties.ListTitle;

            SPWorkflowManager objWorkflowManager = null;

            SPWorkflowAssociationCollection objWorkflowAssociationCollection = null;

            using (SPWeb web = properties.OpenWeb())

            {

                SPListItem item = properties.ListItem;

                objWorkflowManager = web.Site.WorkflowManager; //item.Web.Site.WorkflowManager;

                objWorkflowAssociationCollection = web.Lists[strListName].WorkflowAssociations; //item.ParentList.WorkflowAssociations;

                foreach (SPWorkflowAssociation objWorkflowAssociation in objWorkflowAssociationCollection)

                {

                    //Find the GUID for the workflow association

                    if (objWorkflowAssociation.BaseId.ToString() == “dc891ef1-00e1-45fd-9774-528d00bf945d”)

                    {

                        MPPWWorkflowParameters objParams = new MPPWWorkflowParameters();

                        objParams.ListName = strListName;

                        objParams.IsDelete = true;

                        string strSerializedParams = objParams.getInitXmlString(objParams);

                        objWorkflowAssociation.AssociationData = strSerializedParams;

                        objWorkflowManager.StartWorkflow(item, objWorkflowAssociation,

                        objWorkflowAssociation.AssociationData, true);

                    }

                }

            }

        }

    }

}

WorkflowParameters.cs

using System;

using System.Linq;

using System.Text;

using System.IO;

using System.Xml.Serialization;

namespace CMPM

{

    [Serializable()]

    public class MPPWWorkflowParameters

    {

        private string listName = string.Empty;

        private bool isDelete = false;

        public string ListName

        {

            get { return listName; }

            set { listName = value; }

        }

        public bool IsDelete

        {

            get { return isDelete; }

            set { isDelete = value; }

        }

        public string getInitXmlString(MPPWWorkflowParameters objParams)

        {

            MPPWWorkflowParameters parameters = new MPPWWorkflowParameters();

            parameters.ListName = objParams.ListName;

            parameters.IsDelete = objParams.IsDelete;

            using (MemoryStream stream = new MemoryStream())

            {

                XmlSerializer serializer = new XmlSerializer(typeof(MPPWWorkflowParameters));

                serializer.Serialize(stream, parameters);

                stream.Position = 0;

                byte[] bytes = new byte[stream.Length];

                stream.Read(bytes, 0, bytes.Length);

                return Encoding.UTF8.GetString(bytes);

            }

        }

    }

}

Creating your own WSP package from a .net Assembly

Filed under: Uncategorized — Ravendra Mishra @ 4:43 pm

Creating your own WSP package from a .net Assembly

 

Let’s say you want to create a WSP package for a web part class library. For some reason you are not able to use standard tools to create WSP for you (i.e. stsdev etc).

  1. Create web part class library

Use sharepoint web part project type to create a new project.

  1. Add as many web parts you need to add

Please not that for each web part added you need to make a entry in following files

  1.  
    1. .ddf
    2. manifest.xml
    3. feature.xml
    4. webparts.xml

In a moment I will come into details of these file types.

  1. .ddf file

; Generated at 30/11/2009 10:10:50

.OPTION EXPLICIT

.Set CabinetNameTemplate=ReportingWebParts.wsp

.set DiskDirectoryTemplate=CDROM

.Set CompressionType=MSZIP

.Set UniqueFiles=off

.Set Cabinet=on

.Set DiskDirectory1=”bin\Debug\”

;*** Solution manifest

bin\Debug\manifest.xml

;*** Assembly files

“bin\Debug\BusinessLogicLayer.dll”

“bin\Debug\DataLayer.dll”

“bin\Debug\ReportingWebParts.dll”

;***********************************

;***     FeatureFiles section    ***

;***********************************

;*** add files for Reports feature

.Set DestinationDir=ReportingWebParts

“C:\Ravendra\ReportingWebParts\ReportingWebParts\feature.xml”

“C:\Ravendra\ReportingWebParts\ReportingWebParts\WebParts.xml”

;*** add files for Reports\WebParts feature

.Set DestinationDir=ReportingWebParts\WebParts

“C:\Ravendra\ReportingWebParts\\ReportingWebParts\\WebParts\DistributorActivityByAccountManager.webpart”

“C:\Ravendra\ReportingWebParts\\ReportingWebParts\\WebParts\ReportOfOutcomesReport.webpart”

“C:\Ravendra\ReportingWebParts\\ReportingWebParts\\WebParts\ReportByShippingCompanyReport.webpart”

“C:\Ravendra\ReportingWebParts\\ReportingWebParts\\WebParts\ReportByProductReport.webpart”

  1. manifest.xml

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

<!–Manifest created at 30/11/2009 09:41:19–>

<Solution SolutionId=”40890978-145b-4684-b3b7-5c2012541795″ ResetWebServer=”True” xmlns=”http://schemas.microsoft.com/sharepoint/”&gt;

  <!–Feature Manifest files–>

  <FeatureManifests>

    <FeatureManifest Location=”CMPMReportingWebParts\feature.xml” />

  </FeatureManifests>

  <!–Assembly files–>

  <Assemblies>

    <Assembly Location=”BusinessLogicLayer.dll” DeploymentTarget=”GlobalAssemblyCache” />

    <Assembly Location=”CMPM.DataLayer.dll” DeploymentTarget=”GlobalAssemblyCache” />

    <Assembly Location=”CMPMReportingWebParts.dll” DeploymentTarget=”GlobalAssemblyCache”>

                <SafeControls>

        <SafeControl Assembly=”CMPMReportingWebParts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=42bd3e28d7726752″ Namespace=”CMPM.WebParts.Reports” TypeName=”*” Safe=”True” />

      </SafeControls>

                  </Assembly>

  </Assemblies>

</Solution>

  1. Feature.xml

<Feature Title=”ReportingWebParts” Description=”Cusotm web parts containing reports for ” Version=”1.0.0.0″ Scope=”Site” Hidden=”false”  xmlns=”http://schemas.microsoft.com/sharepoint/”&gt;

  <ElementManifests>

    <ElementManifest Location=”WebParts.xml” />

    <ElementFile Location=”WebParts\DistributorActivityByAccountManager.webpart” />

    <ElementFile Location=”WebParts\ReportByProductReport.webpart” />

    <ElementFile Location=”WebParts\ReportByShippingCompanyReport.webpart” />

    <ElementFile Location=”WebParts\ReportOfOutcomesReport.webpart” />

  </ElementManifests>

</Feature>

  1. Webparts.xml

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

<!–Created by STSDEV at 2/11/2009 1:41:01 AM–>

<Elements xmlns=”http://schemas.microsoft.com/sharepoint/”&gt;

  <Module List=”113″ Url=”_catalogs/wp” Path=”WebParts” RootWebOnly=”True”>

    <File Url=”DistributorActivityByAccountManager.webpart”>

      <Property Value=”ReportingWebParts” />

    </File>

    <File Url=”ReportByProductReport.webpart”>

      <Property Value=”ReportingWebParts” />

    </File>

    <File Url=”ReportByShippingCompanyReport.webpart”>

      <Property Value=”ReportingWebParts” />

    </File>

    <File Url=”ReportOfOutcomesReport.webpart”>

      <Property Value=”ReportingWebParts” />

    </File>

  </Module>

</Elements>

  1. .WebPart files: for each webpart

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

<webParts>

  <webPart xmlns=”http://schemas.microsoft.com/WebPart/v3″&gt;

    <metaData>

      <type />

      <importErrorMessage>Error importing WebParts.Reports.DistributorActivityByAccountManagerReport Web Part</importErrorMessage>

    </metaData>

    <data>

      <properties>

        <property>Distributor Activity By Account Manager Report</property>

        <property>Distributor Activity By Account Manager Report</property>

        <property>Normal</property>

        <property>True</property>

        <property>True</property>

        <property>All</property>       

      </properties>

    </data>

  </webPart>

</webParts>

 

  1. .Bat file to create WSP package

“C:\WINDOWS\System32\makecab.exe” /F ReportingWebParts.ddf /D CabinetNameTemplate=ReportingWebParts.wsp

JQuery to show/Hide elements dynamically

Filed under: Uncategorized — Ravendra Mishra @ 4:31 pm

<script>
 /*

 Text Boxes html
 <tr>
  <td width=”190px” valign=”top”>
   <h3>
    <nobr>Key or Licence Number
     <span>*</span>
    </nobr>
   </h3>
  </td>
  <td width=”400px” valign=”top”>
   <span dir=”none”>
   <input maxlength=”255″ title=”Key or Licence Number” /><br>
   </span>Provide UKHO licence
   number or ADP Key number where
   applicable.
  </td>
 </tr>
 Option/Radio Button html
 <tr>
  <td>
   <span title=”Digital Chart Services – AVCS”>
    <input value=”ctl00″ checked=”checked” />
    <label for=”ctl00_ctl19_g_e7b38077_2b92_4881_b667_83ee40defade_ff7_1_ctl00_ctl00″>Digital Chart Services – AVCS</label>
   </span>
  </td>
 </tr>

 */

 _spBodyOnLoadFunctionNames.push(“configureFields”);

 function slideShow(fieldName) {
  var selector = “nobr:contains(‘” + fieldName + “‘)”;
  //$(selector).parent().parent().parent().slideDown(‘slow’);
  $(selector).parent().parent().parent().show();
 }
 
 function slideHide(fieldName) {
  var selector = “nobr:contains(‘” + fieldName + “‘)”;
  //$(selector).parent().parent().parent().slideUp(‘slow’);
  $(selector).parent().parent().parent().hide();
 }
 
 function showGeneral()
 {
  // Hide these fields
  slideHide(‘Key or Licence Number’);
  slideHide(‘Product Name or Number’);
  slideHide(‘Current Base discs installed’);
  slideHide(‘Expiry Date’);
  slideHide(‘Permit Number’);
  slideHide(‘Edition Date’);
  slideHide(‘Current Weekly Update Held’);
 }
 
 function showDigital()
 {
  // Show these fields
  slideShow(‘Key or Licence Number’);
  slideShow(‘Product Name or Number’);
  slideShow(‘Current Base discs installed’);
  slideShow(‘Expiry Date’);
  // Hide these fields
  slideHide(‘Permit Number’);
  slideHide(‘Edition Date’);
  slideHide(‘Current Weekly Update Held’);
 }

 function showPaper()
 {
  // Hide these fields
  slideHide(‘Key or Licence Number’);
  slideHide(‘Product Name or Number’);
  slideHide(‘Current Base discs installed’);
  slideHide(‘Expiry Date’);
  // Show these fields
  slideShow(‘Permit Number’);
  slideShow(‘Edition Date’);
  slideShow(‘Current Weekly Update Held’);
 }
 
 function configureFields() {
  showGeneral();
  $(“span[title^=’General’]”).children(“input”).focus( function () { showGeneral() } );
  $(“span[title^=’Digital Chart Services’]”).children(“input”).focus( function () { showDigital() } );
  $(“span[title^=’Paper Products & Publications’]”).children(“input”).focus( function () { showPaper() } );
 }
</script>

Insert web parts in NewItem or Edit Item sharepoint pages

Filed under: Uncategorized — Ravendra Mishra @ 4:28 pm

ToolPaneView hack

This next workaround is great, because it can be done in the web browser and requires no SharePoint designer. It is exceedingly simple. For any web part page, simply append the following text to the URL:

&ToolPaneView=2

Thus, if my original URL was:

http://tidemo/tftp/Lists/IT%20Assets/DispForm.aspx?ID=2&Source=http%3a%2f%2ftidemo%2ftftp%2fLists%2fIT%2520Assets%2fAllItems.aspx&PageView=Shared

Then my new URL is:

http://tidemo/tftp/Lists/IT%20Assets/DispForm.aspx?ID=2&Source=http%3a%2f%2ftidemo%2ftftp%2fLists%2fIT%2520Assets%2fAllItems.aspx&PageView=Shared&ToolPaneView=2

Below is a screen capture of the effect. If you look carefully you see two things have happened. The page is now in Edit Mode and the “Add Web parts” window is displayed. Since we are in edit mode, we can click any web part zone and add our web part!

Sharepoint related sites to visit

Filed under: Uncategorized — Ravendra Mishra @ 3:43 pm

Following sites and blogs contains quite interesting sharepoint stuff

First of all another compiled list of top 100 sharepoint blogs http://www.sharepointjoel.com/Lists/Posts/Post.aspx?ID=31 

Bil Simser  http://weblogs.asp.net/bsimser

Jan Tielens http://weblogs.asp.net/jan

Richard http://cglessner.blogspot.com/

Gary Lapointe http://stsadm.blogspot.com/

Cleaver workaround http://www.cleverworkarounds.com/2008/02/28/more-sharepoint-branding-customisation-using-javascript-part-3/

October 29, 2009

How to convert XML Data into Excel

Filed under: Uncategorized — Ravendra Mishra @ 12:31 pm

using System;
using System.Data;
using System.IO;
using System.Xml;
using System.Xml.Xsl;
namespace XML2Excel
{
    class Program
    {
        static void Main(string[] args)
        {
            if (args.Length < 2)
            {
                throw new Exception(“Usage: XML2Excel XMLFileName XSLName ExcelFileNameToCreate”);       
            }

            DataSet ds = new DataSet();
            ds.ReadXml(args[0]);
            XmlDataDocument xdd = new XmlDataDocument(ds);
            XslTransform xt = new XslTransform();
            xt.Load(args[1]);

            StreamWriter swriter = new StreamWriter(args[2]);
           
            xt.Transform(xdd, null, swriter.BaseStream);           
        }
    }
}

Next Page »

Blog at WordPress.com.