tag:blogger.com,1999:blog-20250114342500754682024-03-13T20:01:11.028-07:00Think 4 CodeVJhttp://www.blogger.com/profile/15297632783860873931noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-2025011434250075468.post-17759993345148624582012-07-07T09:30:00.005-07:002012-07-07T11:07:48.144-07:00SPUnlock Tool "The file is locked for exclusive use by"<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
<strong style="background-color: white; color: red; font-family: 'Segoe UI', 'Microsoft Sans Serif', Arial, Geneva, sans-serif; text-align: -webkit-auto;">The file "" is locked for exclusive use by domain\user</strong></div>
<div style="font-family: 'Segoe UI', 'Microsoft Sans Serif', Arial, Geneva, sans-serif; text-align: -webkit-auto;">
Normally you will get this when file from SharePoint library is in use in by any user in client applications that's as expected. But due to many reasons this lock never get released even when you are not using this file. </div>
<div style="text-align: -webkit-auto;">
<div style="font-family: 'Segoe UI', 'Microsoft Sans Serif', Arial, Geneva, sans-serif;">
<br /></div>
<div style="font-family: 'Times New Roman';">
<span style="font-family: 'Segoe UI', 'Microsoft Sans Serif', Arial, Geneva, sans-serif;"><b><u><br class="Apple-interchange-newline" />SharePoint Lock and Checkout</u></b></span></div>
<div>
<span style="font-family: 'Segoe UI', 'Microsoft Sans Serif', Arial, Geneva, sans-serif;"><i><span style="font-family: 'Times New Roman'; font-size: small;"> SharePoint lock are not same as item checkout. </span></i></span><br />
<span style="font-family: 'Segoe UI', 'Microsoft Sans Serif', Arial, Geneva, sans-serif; font-size: x-small;"><i><span style="font-family: 'Times New Roman'; font-size: small;"><br /></span></i></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><b><u>Checkout</u></b></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"> is when user perform through SharePoint UI for via programatically to edit a file </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"> <u><b>Checkout type</b></u></span><br />
<div style="text-align: justify;">
<i style="font-family: 'Segoe UI', 'Microsoft Sans Serif', Arial, Geneva, sans-serif; font-size: medium;"> </i><b><span style="font-family: Arial, Helvetica, sans-serif;">Online</span></b><i style="font-family: 'Segoe UI', 'Microsoft Sans Serif', Arial, Geneva, sans-serif; font-size: medium;"> :- </i><span style="background-color: white; font-family: Verdana; text-align: left;">The file is checked out for editing on the server.</span></div>
<div style="text-align: justify;">
<span style="font-family: Verdana; font-weight: bold; text-align: left;"> </span><span style="font-family: Verdana; text-align: left;"><b>Offline</b></span><span style="font-family: Verdana; font-weight: bold; text-align: left;"> :- </span><span style="background-color: white; font-family: Verdana; text-align: left;">The file is checked out for editing on the local computer.</span></div>
</div>
<div style="font-family: 'Segoe UI', 'Microsoft Sans Serif', Arial, Geneva, sans-serif; font-size: 13px;">
<div style="text-align: justify;">
<span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;"> </span></div>
</div>
<div>
<br /></div>
<div style="font-family: 'Segoe UI', 'Microsoft Sans Serif', Arial, Geneva, sans-serif;">
<b><u>Lock Type</u></b></div>
<div style="text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;">When user open a document in edit mode in office client SharePoint <span style="background-color: white;">Creates a short term lock <b>( 10 min) </b> on the file, preventing other users from modifying it. this lock get renew by office client after every 10 min.</span></span></div>
<div style="text-align: justify;">
<span style="background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;"><b><u>Lock Type </u></b></span></div>
<div style="text-align: left;">
<div style="text-align: justify;">
<span style="background-color: white; font-family: Verdana; font-size: 11px; font-weight: bold; text-align: left;"> </span><span style="background-color: white; font-family: Verdana; font-weight: bold; text-align: left;"> Exclusive: -</span><span style="background-color: white; font-family: Verdana; font-size: 11px; font-weight: bold; text-align: left;"> </span><span style="background-color: white;"><span style="font-family: Verdana;">The file is locked for editing by a single user. No other user can modify the file until the lock is released.</span></span></div>
</div>
<div style="text-align: -webkit-auto;">
<div style="text-align: justify;">
<span style="font-family: Verdana; font-size: 11px; font-weight: bold;"> </span><span style="font-family: Verdana; font-weight: bold;">Shared:-</span><span style="font-family: Verdana; font-weight: bold;"> </span><span style="background-color: white; text-align: -webkit-auto;"><span style="font-family: Verdana;">The file is locked for editing by a group who are using a collaborative application. Other users are prevented from modifying the file until the lock is released.</span></span></div>
</div>
<div style="font-family: 'Segoe UI', 'Microsoft Sans Serif', Arial, Geneva, sans-serif; font-size: 13px;">
<br /></div>
<div style="font-family: 'Segoe UI', 'Microsoft Sans Serif', Arial, Geneva, sans-serif; font-size: 13px;">
<i style="color: #cccccc; font-family: Arial, Helvetica, sans-serif; font-size: small;">Note:- The checkout state of a file is independent of its locked state</i>
</div>
<div style="font-family: 'Segoe UI', 'Microsoft Sans Serif', Arial, Geneva, sans-serif; font-size: 13px;">
<br /></div>
<div style="font-family: 'Segoe UI', 'Microsoft Sans Serif', Arial, Geneva, sans-serif; font-size: 13px;">
<br /></div>
<h3 style="text-align: left;">
<span style="color: red; font-family: Arial, Helvetica, sans-serif; font-size: small;"><b><u>Solutions for Sharepoint Accidental Lock</u></b> </span></h3>
</div>
<div style="text-align: -webkit-auto;">
<h4 style="text-align: left;">
<ol style="text-align: left;">
<li><span style="background-color: white; font-family: Arial, Helvetica, sans-serif;">Wait for 10 min for lock to expire (this is true in 80 % of cases)</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: white;">Quick solution is to reset share point server </span><b style="background-color: white;">( not always feasible )</b></span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><b style="background-color: white;">Use a codeplex tool to unlock these file<span style="color: red;"> <a href="https://spunlockfiles.codeplex.com/">SPUnlock</a></span> (</b>
<a href="https://spunlockfiles.codeplex.com/">https://spunlockfiles.codeplex.com/</a>)</span></li>
</ol>
</h4>
</div>
<div style="text-align: -webkit-auto;">
<span style="font-family: Arial, Helvetica, sans-serif;"><b><u>SPUnlock Tool</u></b></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">Its a Sandbox based solution developed by me as an additional nice to have tool while working/ supporting project issues where files get locked by user for some reason .</span><br />
<span style="font-family: 'Segoe UI', 'Microsoft Sans Serif', Arial, Geneva, sans-serif; font-size: x-small;"><br /></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><b><u>SPUnlock Tool Setup</u></b></span><br />
<ol style="text-align: left;">
<li><span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: white;">Download <b><u>SPUnlockSandbox.wsp</u></b> from </span>
<a href="https://spunlockfiles.codeplex.com/">https://spunlockfiles.codeplex.com/</a></span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">Upload SPUnlockSandbox.wsp to SP Site Collection Solution Gallery<span style="color: #999999;"> <span style="background-color: white;">(</span><span style="background-color: white;"> <u>http://<server>/sites/<sitecollection>/</sitecollection></server></u></span><u>_catalogs/solutions/Forms/AllItems.aspx</u>)</span></span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">Activate solution from solution gallery</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">Confirm above step activate a sitecollection feature "SPUnlockSandbox_Feature1" .</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">Navigate to you site or any subsite w<span style="color: #999999;">here and add webpart "<b><u>SPFile Unlock</u></b>" to any page.</span></span></li>
</ol>
<div style="text-align: left;">
<span style="font-family: Arial, Helvetica, sans-serif;">and there you go with this simple but useful tool </span></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: left;">
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-gRhEBOF0r5A/T_hqywuJNFI/AAAAAAAAFZc/Ypi1c7hc2dY/s1600/SPUnlockWEBPartUI.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="227" src="http://2.bp.blogspot.com/-gRhEBOF0r5A/T_hqywuJNFI/AAAAAAAAFZc/Ypi1c7hc2dY/s400/SPUnlockWEBPartUI.JPG" width="400" /></a><a href="http://2.bp.blogspot.com/-gRhEBOF0r5A/T_hqywuJNFI/AAAAAAAAFZc/Ypi1c7hc2dY/s1600/SPUnlockWEBPartUI.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-left: 1em;"><br /></a></div>
<br /></div>
</div>
</div>VJhttp://www.blogger.com/profile/15297632783860873931noreply@blogger.com15tag:blogger.com,1999:blog-2025011434250075468.post-23280537594518829462012-04-14T05:57:00.004-07:002012-07-05T09:17:24.939-07:00Info path 2010 on Ipad<div dir="ltr" style="text-align: left;" trbidi="on">
From today I will be working on rare combination of products Microsoft and Apple. to starts with Info path 2010 forms on I PAD browser . thanks to share point 2010 for having better html output to support multiple browser<br />
<br />
<br />
<b>Day 1 </b><br />
1. Basic browser infopath form works good in IPAD<b> .</b> thanks to SP 2010<br />
<br />
<b>Day 2</b><br />
1. Will target application in two phase 1st create infopath application for client in windows system for offline capability and online version (browser) for IPAD.<br />
2. Phase 2 will add offline capability in IPAD. this going to be interesting options here are<br />
a. Create or buy any infopath Ipad App like <strong style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: sans-serif; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto; vertical-align: baseline;">SharePlus</strong><br />
<strong style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: sans-serif; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto; vertical-align: baseline;"> b. Create a ipad app for application mean not a infopath but a ui application which will read and write infopath xml to sharepoint library . but downside of this is it will be specific to Application.</strong><br />
<strong style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: sans-serif; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto; vertical-align: baseline;"><br /></strong><br />
<strong style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: sans-serif; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto; vertical-align: baseline;"><b>Day 3</b>.</strong><br />
<span style="border-width: 0px; font: inherit; margin: 0px; padding: 0px; text-align: -webkit-auto; vertical-align: baseline;">Notices a issue in info path browser forms in safari (IPAD) not sure whom to blame MS or Apple.</span><br />
<span style="border-width: 0px; font: inherit; margin: 0px; padding: 0px; text-align: -webkit-auto; vertical-align: baseline;"><b><br /></b></span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-KkcBD-c6rxk/T7YsMiXsJ_I/AAAAAAAAFB8/1Zn2qHEFGq0/s1600/infopath+Rich+ribbon.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="67" src="http://3.bp.blogspot.com/-KkcBD-c6rxk/T7YsMiXsJ_I/AAAAAAAAFB8/1Zn2qHEFGq0/s320/infopath+Rich+ribbon.png" width="320" /></a></div>
You can't change text color or hi light a test with given ribbon controls. very minor issue .<br />
<br />
I will skip some around 10 days it went smooth without any issue<br />
<br />
<b>Day 13</b><br />
<b> </b>Notices one more issue in infopath browser form in Safari both desktop and iPAD<br />
Description : My info path form have Submit button . when you hit submit button with some validation error in form ( required field validation) infopath will prompt a error popup . which is normal but once you are back to form from error popup <b> last Rich text box field which i was filling just before hitting submit button will be blank.</b><br />
agian <span style="background-color: white; text-align: -webkit-auto;">not sure whom to blame MS or Apple.</span></div>VJhttp://www.blogger.com/profile/15297632783860873931noreply@blogger.com0tag:blogger.com,1999:blog-2025011434250075468.post-25159557535809576612012-04-11T08:27:00.001-07:002012-04-11T08:28:08.344-07:00InfoPath Design Copy Past Issue<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
Today while working with infopath forms i feel sometime when I try to <b>copy and past</b> some text or control across the view or to different location in a same view it never past the content i have copyed. many people do system restart and it work but when i dig a bit its a strange dependency<br />
<br />
<b><u>Solution </u></b><br />
<span style="color: red;"><b>if you close all your open IE window copy past starts working normally .</b></span><br />
<br />
Don't know what this have to do with IE . but certainly there is some relation between on IE and info path one more such example if if you make you your IE offline your info path will also get into offline mode .</div>VJhttp://www.blogger.com/profile/15297632783860873931noreply@blogger.com0tag:blogger.com,1999:blog-2025011434250075468.post-29933765614818863312012-03-09T17:27:00.000-08:002012-03-09T17:32:35.685-08:00Move SharePoint List Item (SPListItem) To Sub Folder<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
Below is a sample code to move SPlist item from Root Location to sub folder. as every list item have unique url they can treated as File(SPFile). With SPFile Object we know how SPFile.Move() works.<br />
<br />
In this sample code will try to move SharePoint list item from root folder to subfolder during ItemAdded Event.<br />
<br />
<br /></div>
<pre class="c-sharp" name="code">
/*
* /Move List Item to folder ( not Document library folder )
* with sahrepoint 2010(not sure if poosible in MOSS 2007 )
* Key point sahrepont create unique URL for every list item also . it will look like
* http://<sahrepointserver>/sites/<site>/Lists/<ListName>/1_.000 where 1 is SPitem ID
*
*/
SPWeb web= properties.Web;
//Folder123 is Inside root location of List
string DestinationFolderName="Folder123";
// Source item outside folder Folder123
SPListItem listitem = properties.ListItem;
SPFile listitemFile = web.GetFile(listitem.Url);
//Create New Destination URL ../Lists/Folder123/1_.000
string NewDestinationUrl=listitemFile.Url.Replace(listitem.ID.ToString()+"_.000",DestinationFolderName+"/"+listitem.ID.ToString()+"_.000");
//Move Item Insite Folder123
listitemFile.MoveTo(NewDestinationUrl);
</pre>VJhttp://www.blogger.com/profile/15297632783860873931noreply@blogger.com9tag:blogger.com,1999:blog-2025011434250075468.post-46169608561905599372012-02-20T18:17:00.000-08:002012-02-20T18:18:45.456-08:00Sharepoint 2010 Date Column Validation with [Today] Date<div dir="ltr" style="text-align: left;" trbidi="on">
with new SP 2010 Column validation . 1st thought that came to my mind is date field validation with respect to today's date. then quickly create a date column TestDate and and add the validation formula as below .<br />
<span style="color: #cc0000;"><b>=[
TestDate ]>=[TODAY]</b></span><br />
<br />
<span style="color: red;">Then it will give you a error.</span><br />
after some hit and trial I found actual expression should be<br />
<span style="color: #38761d;"><b>=[
TestDate ]>=TODAY()</b></span><br />
<span style="color: #38761d;"><b><br /></b></span><br />
<span style="color: #38761d;"><b>Yapee......</b></span></div>VJhttp://www.blogger.com/profile/15297632783860873931noreply@blogger.com1tag:blogger.com,1999:blog-2025011434250075468.post-16015000621284442272012-02-14T10:31:00.000-08:002012-02-14T10:34:33.904-08:00WP e-Commerce digital product Download link on google checkout<div dir="ltr" style="text-align: left;" trbidi="on">
When you are working with WP e-Commerce plugin for word press linked with Google Checkout for payment .and your shop is for Digital Product and you feel you need more from this plugin then you are in right place . I have many issues while configuring this plugin for one of my shop<br />
1. Unable to display download link for digital products after checkout .<br />
2. No links to download digital product after Google checkout .<br />
3
WP e-Commerce add multiple entries to for single transaction<br />
4.Google checkout send Pending for shipping mail to user which in confusing .<br />
<br />
Solution:<br />
the problem is plugin is not sending google information about the product . it just sends its pricing details. to fix this go ahead and modify phugins PHP files<br />
<br />
Step 1 Go to Location "..\wp-e-commerce\wpsc-merchants"<br />
Step2 . Open <b><u>GoogleCheckout-XML.php</u></b><br />
Step 3. Go to Line number 182 ( just above <span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #b4a7d6;">$cart->AddItem($cart_item);</span> )<br />
Step 4.Add below code to it just before line $cart->AddItem($cart_item);<br />
<pre class="php" name="code">
//Extra code send media download url to google checkout
$siteurl = get_option('siteurl');
$previous_download_ids = array(0);
$product_id = wpsc_cart_item_product_id();
$link = "";
//$product_data = $wpdb->get_row("SELECT * FROM `".WPSC_TABLE_PRODUCT_LIST."` WHERE `id`='{$product_id}' LIMIT 1", ARRAY_A) ;
$wpdb->query("UPDATE `".WPSC_TABLE_DOWNLOAD_STATUS."` SET `active`='1' WHERE `product_id` = '$product_id' AND `purchid` = '{$purchase_log[0]['id']}'");
$download_data = $wpdb->get_results("SELECT * FROM `".WPSC_TABLE_DOWNLOAD_STATUS."`
WHERE `".WPSC_TABLE_DOWNLOAD_STATUS."`.`active`='1'
AND `".WPSC_TABLE_DOWNLOAD_STATUS."`.`purchid`='".$purchase_log[0]['id']."'
AND `".WPSC_TABLE_DOWNLOAD_STATUS."`.`product_id` ='".$product_id."'
AND `".WPSC_TABLE_DOWNLOAD_STATUS."`.`id` NOT IN ('".implode("','",$previous_download_ids)."')",ARRAY_A);
$link=array();
if(sizeof($download_data) != 0) {
foreach($download_data as $single_download){
if($single_download['uniqueid'] == null){// if the uniqueid is not equal to null, its "valid", regardless of what it is
$link[] = array("url"=>$siteurl."?downloadid=".$single_download['id'], "name" =>$single_download["filename"]);
} else {
$link[] = array("url"=>$siteurl."?downloadid=".$single_download['uniqueid'], "name" =>$single_download["filename"]);
}
}
}
foreach($link as $single_link)
{
// $product_list .= "\n\r ".$single_link["name"].": ".$single_link["url"]."\n\r";
$cart_item->SetURLDigitalContent($single_link["url"], null, wpsc_cart_item_name());
break;
}
//End of extra code Vijay
</pre>
Step 4. Now you are done .<br />
<br />
What the above line of code will do ?<br />
1. Create entry in WPSC_TABLE_DOWNLOAD_STATUS table unique id for download url .<br />
2. Activate the URL<br />
3. Send download URL information to Google to be displayed in Google checkout page after transaction complete. user really dont have to come back to your site to get the download link<br />
4. Along with download URL Google will treat this product as digital digital product so no shipping issue .<br />
5. on top of all these this download url information will be there in Google checkout mail send to buyer .<br />
<br />
I hope wp-ecommerce will add this oprion to there code .<br />
<br />
<br /></div>VJhttp://www.blogger.com/profile/15297632783860873931noreply@blogger.com6tag:blogger.com,1999:blog-2025011434250075468.post-35856324847847221272010-03-05T20:27:00.000-08:002012-02-12T17:31:27.558-08:00Updating site the site content type failed. Infopath 2007<div dir="ltr" style="text-align: left;" trbidi="on">
Suddenly one day while publishing an InfoPath form with 40+ fields promoted as column to a SharePoint library I found it started throwing error msg “<span style="font-weight: bold;">Updating site the site content type failed”. </span><br />
After doing some research on it I found basically this issue is due to inc in number of column promoted to library .<br />
<br />
1. when we publish InfoPath forms with more than 30+ column some time it take more than 30 sec(time taken for .xsn file to get copied into sharepoint site not the entire publish wizard) . and problem is here in infopath client process time out is hard-coded for 30 sec . this is why we get this error.<br />
<br />
Solution for this :<br />
1. MS have fixed this 30 sec hardcoded issue in SP2 of MS Office clients (<span style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 115%;">(<a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=B444BF18-79EA-46C6-8A81-9DB49B4AB6E5&displaylang=en">MS Office SP2 Download</a>)</span>)<br />
<div>
<br /></div>
<div>
<br />
2. If By any chance you cannot upgrade to SP2 then only solution for Is remove few promoted column till it publish successfully. or check for network speed if it is slow enough to increase the publish time more than 30 sec, switch to higher network speed.</div>
</div>VJhttp://www.blogger.com/profile/15297632783860873931noreply@blogger.com0tag:blogger.com,1999:blog-2025011434250075468.post-19300897847547200792009-01-13T09:25:00.000-08:002009-01-13T11:12:43.317-08:00MOSS 2007 'Hello world' WebPart<div>In order to develop moss 2007 webpart you will need<br /><br /><div>1. Visual Studio 2005/2008 or later.</div><br /><div></div><br /><div>2. You will also need network access to a Windows 2003/2008 server with SharePoint 2007 (WSS or MOSS) . One can also install Visual Studio 2005/8 on the development server. </div><br /><br /><div>3. Administration rights on your SharePoint server and also administration rights on SharePoint web application. </div><br /><br /><div></div><br /><br /><div>Step 1: Create a Class Library project in vs 2005 </div><a href="http://1.bp.blogspot.com/_dcXbYMl-NkA/SWzmvfcJ4EI/AAAAAAAABJY/ZpCQMczOkAw/s1600-h/1.JPG"><img id="BLOGGER_PHOTO_ID_5290857365821317186" style="WIDTH: 320px; CURSOR: hand; HEIGHT: 230px" alt="" src="http://1.bp.blogspot.com/_dcXbYMl-NkA/SWzmvfcJ4EI/AAAAAAAABJY/ZpCQMczOkAw/s320/1.JPG" border="0" /></a><br /><br /><div>2. Add a reference to System.Web </div><br /><a href="http://4.bp.blogspot.com/_dcXbYMl-NkA/SWzm_P1JdSI/AAAAAAAABJg/v6bxaCHEG_A/s1600-h/2.JPG"><img id="BLOGGER_PHOTO_ID_5290857636509087010" style="WIDTH: 143px; CURSOR: hand; HEIGHT: 171px" alt="" src="http://4.bp.blogspot.com/_dcXbYMl-NkA/SWzm_P1JdSI/AAAAAAAABJg/v6bxaCHEG_A/s320/2.JPG" border="0" /></a><br /><div><a href="http://4.bp.blogspot.com/_dcXbYMl-NkA/SWzUcFMBCJI/AAAAAAAABJA/ogRPkAnlWdg/s1600-h/2.JPG"></a></div><br /><br /><div>3. create a simple Web Part that will print "Hello World!" . bellow class will inherits from the WebPart class in System.Web.UI.WebControls.WebParts. In order to render the Web Part we need to overrides the Render method. A HtmlTextWriter instance is passed into the Render method and can then be used to write markup to the page output. </div><br /><div>Code: </div><div>using System; </div><div>using System.Collections.Generic; </div><div>using System.Text; </div><div>using System.Web;<br />using System.Web.UI;</div><div>using System.Web.UI.WebControls; </div><div>using System.Web.UI.WebControls.WebParts;</div><div>namespace HelloWorld_Webpart</div><div>{</div><div>public class HelloWorld :WebPart </div><div>{</div><div>//test Hello world webpart </div><div>protected override void Render(HtmlTextWriter writer)</div><div>{</div><div>// base.Render(writer); </div><div>writer.Write("Hello World from Vijay");</div><div>}</div><div>}</div><div>}</div><br /><div>4. Attach ur class library with a strong name key </div><div>5. Add the statements </div><div> using System.Security; </div><div> and </div><div> [assembly: AllowPartiallyTrustedCallers] to AssemblyInfo.cs file. </div><br /><div>6. builds the project and copy the dll( HelloWorld Webpart.dll ) to C:\Inetpub\wwwroot\wss\VirtualDirectories\37459(Port no of web application)\bin<br />7. Add the webpart detail as safe control entry in webconfig file as<br /><a href="http://4.bp.blogspot.com/_dcXbYMl-NkA/SWzlhbAAJxI/AAAAAAAABJQ/T8CWuWuW0fM/s1600-h/4.JPG"><img id="BLOGGER_PHOTO_ID_5290856024599701266" style="WIDTH: 320px; CURSOR: hand; HEIGHT: 194px" alt="" src="http://4.bp.blogspot.com/_dcXbYMl-NkA/SWzlhbAAJxI/AAAAAAAABJQ/T8CWuWuW0fM/s320/4.JPG" border="0" /></a> </div><div></div><div>Reflector tool(free download)</div><div> </div><div><a href="http://2.bp.blogspot.com/_dcXbYMl-NkA/SWzkUOunINI/AAAAAAAABJI/vaNPz0_ottU/s1600-h/3.JPG"><img id="BLOGGER_PHOTO_ID_5290854698455605458" style="WIDTH: 254px; CURSOR: hand; HEIGHT: 320px" alt="" src="http://2.bp.blogspot.com/_dcXbYMl-NkA/SWzkUOunINI/AAAAAAAABJI/vaNPz0_ottU/s320/3.JPG" border="0" /></a><br /><br /><br /><br /><br /><div></div></div></div>VJhttp://www.blogger.com/profile/15297632783860873931noreply@blogger.com0tag:blogger.com,1999:blog-2025011434250075468.post-86980419846214101172008-08-20T23:25:00.000-07:002009-01-13T09:24:38.514-08:00How to send multi value parameter to oracle store procedureHi all ,<br /><br />From past 1 week i am goggling how to send multi value parameter to oracle store procedure from SSRS 2005.<br /><br />As we can't send delimiter separated multiple values to oracle store procedure IN CLAUSE. We are left with two option<br /><br />1st option : use a user define split function which Take a comma delimited list of values in a single string and return it as a table of values to IN clause of ur store procedure<br /><br />step 1. define the result type to be a TABLE type of the largest possible string.<br /><br />create or replace type split_tbl as table of varchar2(32767);/show errors;<br />step 2. Create a function split<br /><br /><span style="font-family:times new roman;"><em>create or replace function split( p_list varchar2, p_del varchar2 := ',') return split_tbl pipelinedis l_idx pls_integer; l_list varchar2(32767) := p_list;AA l_value varchar2(32767);begin loop l_idx := instr(l_list,p_del); if l_idx > 0 then pipe row(substr(l_list,1,l_idx-1)); l_list := substr(l_list,l_idx+length(p_del)); else pipe row(l_list); exit; end if; end loop; return;end split;/show errors;<br /></em></span>Step 3. use this split( ) in ur store procedure<br /><em><span style="font-family:times new roman;">CREATE OR REPLACE PROCEDURE PR_RANKING_SSRS( multivaluestring IN VARCHAR2,<br />PO_RANKING OUT SYS_REFCURSOR) IS<br /><br />BEGIN<br />OPEN PO_RANKING FOR<br />SELECT col_namr FROM tbl_name<br />WHERE (any_Col_name IN ( select * from table(split(( multivaluestring )) ));<br />END PR_RANKING_SSRS;<br /></span></em><br /><br /><br />2nd option if u don’t have to create table privilege on database then use dynamic SQL query.<br /><br /><br />Step1: create a store procedure as bellow . and send ur multi value parameter as comma separated string from SSRS 2005<br /><br /><span style="font-family:times new roman;"><em>CREATE OR REPLACE PROCEDURE PR_RANKING_SSRS( multivalue_parameter IN VARCHAR2,<br />PO_RANKING OUT SYS_REFCURSOR) IS<br />query_str VARCHAR2(1000);<br />BEGIN<br />query_str := 'SELECT Col_name<br />FROM Table_name<br />WHERE (BRAND_NM IN (' multivalue_parameter '))<br />GROUP BY XYZ_col_Name<br />ORDER BY XYZ_xyz_col_name;<br /><br />OPEN PO_RANKING FOR query_str;<br />END PR_RANKING_SSRS;<br /></em></span><br /><br /><br />Note : ur parameter string should be like = 'abc’,’def’,’geh’,’ddd'<br />Not like abc,def,geh,ddd or like abc’,’def’,’geh’,’dddVJhttp://www.blogger.com/profile/15297632783860873931noreply@blogger.com0