vvka's Collection

SQL server image datatype should be byte[] in C# domain model
SQL server money datatype should be decimal in C# domain model

The Decimal value type represents decimal numbers ranging from positive 79,228,162,514,264,337,593,543,950,335 to negative 79,228,162,514,264,337,593,543,950,335.
The Decimal value type is appropriate for financial calculations requiring large numbers of significant integral and fractional digits and no round-off errors.
The Decimal type does not eliminate the need for rounding. Rather, it minimizes errors due to rounding.
If you choose double you’re leaving yourself open to rounding errors

Our life moves tremendously ahead if we can identify and memorize various patterns in life. Starting from the alphabets to learning music, a new language, trading in stock market or programing a computer software. What we essentially do is most of the time learn the patterns identify by other people and commit hem into our memory and move ahead to find non identified patterns.
The person who is faster in memorizing the “existing” patterns can have them at his disposal for quick problem solving or if not with direct application but also with an implied applications and is successful.

What a beautiful day it is! I took work from home for the sake of my aching back, and as a morning ritual opened my news papers online. Sitting on my study table by the large window of my bedroom I can smell the damp grass oozing the chills of fresh morning and feel the warmth and shine of rising sun on my spectacles.

I read a friends blog yesterday and yet again felt sad for my lack of discipline to keep up mine. So here I am back again sorry but happy.

The following example reads the undefined child nodes in any xml file, whose schema is predefined. Therefore the prerequisite to write xslt code is to know your xml code structure so that you can format the child nodes accordingly. Hope it helps you.

I am now struggling to apply css and some javascript to it, so that each of my nodes appears in a tree structure(expand/shrink). If you have any solution, please share. Thanks.

Sample xml file :-

XMLSample.xml

<?xml version=”1.0″?>
<?xml-stylesheet type=”text/xsl” href=”XMLSample.xslt”?>

<Event Name=”Flyer: October 28 to November 10, 2011″ StartDate=”2011-10-28″ EndDate=”2011-11-10″ Identifier=”” Type=”Mailer” Theme=”Event”>
<Versions>
<Version Name=”Corporate1″ StartDate=”2011-10-28″ EndDate=”2011-11-10″>
<Stores>
<Store Name=”RASH BURLOAK1″ Number=”16″ />
<Store Name=”RASH Bayview1″ Number=”5″ />
</Stores>
<Offers>
<Offer Name=”Lock1-1″ Description=”3 for 9.99 or 3.99 for 1″ Page=”1″ Location=”1″ FeatureType=”Minor feature” SalesType=”Ad” IsExclusive=”False” IsElective=”False” IsCoupon=”False” IsTraffic=”False”>
<Tiers>
<Tier Number=”1-1″>
<BuySpecification Price=”9.99″ Quantity=”3.00″ />
</Tier>
<Tier Number=”1-2″>
<BuySpecification Price=”9.99″ Quantity=”3.00″ />
</Tier>
</Tiers>
<OfferProducts>
<OfferProduct ProductID=”34006″ UPC=”1369232″ ItemNumber=”00772468002840″ Description=”RASH T/C PIZZA 5 CHEESE 337G” BrandName=”LONGO’S” CaseSize=”1″ SoldPackSize=”337.00″ SoldPackUOM=”GM” VendorPackSize=”337.00″ VendorPackUOM=”GM” CostPackSize=”337.00″ CostPackUOM=”GM” CurrentRetail=”4.99″ CurrentUnits=”515.97″ ForecastedUnits=”3078.96″ ForecastedSales=”10252.93″ ForecastedProfit=”-123.16″ ForecastedAdLoss=”-5111.07″ IsNationalBrand=”False” IsPrivateLabel=”False” IsBuyRequired=”True” IsGetRequired=”False” NetUnitCost=”3.37″>
<ProductHierarchy>
<Department ID=”9012″ Name=”FROZEN”>
<Class ID=”90121207″ Name=”FROZEN PIZZA”>
<Line ID=”901212072″ Name=”PIZZA – DINNER SIZE” />
</Class>
</Department>
</ProductHierarchy>
<OfferProductStores>
<OfferProductStore StoreNumber=”16″ CurrentRetail=”4.9900″ Price=”9.99″ EffectivePrice=”9.99″ Quantity=”3.00″ />
<OfferProductStore StoreNumber=”5″ CurrentRetail=”4.9900″ Price=”9.99″ EffectivePrice=”9.99″ Quantity=”3.00″ />
<OfferProductStore StoreNumber=”20″ CurrentRetail=”4.9900″ Price=”9.99″ EffectivePrice=”9.99″ Quantity=”3.00″ />
<OfferProductStore StoreNumber=”25″ CurrentRetail=”4.9900″ Price=”9.99″ EffectivePrice=”9.99″ Quantity=”3.00″ />
</OfferProductStores>
</OfferProduct>
<OfferProduct ProductID=”34007″ UPC=”1369234″ ItemNumber=”00772468002833″ Description=”RASH T/C PIZZA MUSHROOM 345G” BrandName=”LONGO’S” CaseSize=”1″ SoldPackSize=”345.00″ SoldPackUOM=”GM” VendorPackSize=”345.00″ VendorPackUOM=”GM” CostPackSize=”345.00″ CostPackUOM=”GM” CurrentRetail=”4.99″ CurrentUnits=”251.24″ ForecastedUnits=”1731.52″ ForecastedSales=”5765.95″ ForecastedProfit=”-69.26″ ForecastedAdLoss=”-2874.32″ IsNationalBrand=”False” IsPrivateLabel=”False” IsBuyRequired=”True” IsGetRequired=”False” NetUnitCost=”3.37″>
<ProductHierarchy>
<Department ID=”9012″ Name=”FROZEN”>
<Class ID=”90121207″ Name=”FROZEN PIZZA”>
<Line ID=”901212072″ Name=”PIZZA – DINNER SIZE” />
</Class>
</Department>
</ProductHierarchy>
</OfferProduct>
<OfferProduct ProductID=”34008″ UPC=”1369236″ ItemNumber=”00772468002826″ Description=”RASH T/C PIZZA PEP&amp;HAM 381G” BrandName=”LONGO’S” CaseSize=”1″ SoldPackSize=”381.00″ SoldPackUOM=”GM” VendorPackSize=”381.00″ VendorPackUOM=”GM” CostPackSize=”381.00″ CostPackUOM=”GM” CurrentRetail=”4.99″ CurrentUnits=”492.22″ ForecastedUnits=”3348.93″ ForecastedSales=”11151.92″ ForecastedProfit=”-133.96″ ForecastedAdLoss=”-5559.22″ IsNationalBrand=”False” IsPrivateLabel=”False” IsBuyRequired=”True” IsGetRequired=”False” NetUnitCost=”3.37″>
<ProductHierarchy>
<Department ID=”9012″ Name=”FROZEN”>
<Class ID=”90121207″ Name=”FROZEN PIZZA”>
<Line ID=”901212072″ Name=”PIZZA – DINNER SIZE” />
</Class>
</Department>
</ProductHierarchy>
<OfferProductStores>
<OfferProductStore StoreNumber=”16″ CurrentRetail=”4.9900″ Price=”9.99″ EffectivePrice=”9.99″ Quantity=”3.00″ />
<OfferProductStore StoreNumber=”5″ CurrentRetail=”4.9900″ Price=”9.99″ EffectivePrice=”9.99″ Quantity=”3.00″ />
<OfferProductStore StoreNumber=”25″ CurrentRetail=”4.9900″ Price=”9.99″ EffectivePrice=”9.99″ Quantity=”3.00″ />
</OfferProductStores>
</OfferProduct>
<OfferProduct ProductID=”34009″ UPC=”1369238″ ItemNumber=”00772468002819″ Description=”RASH T/C PIZZA RSTD VEG 381G” BrandName=”LONGO’S” CaseSize=”1″ SoldPackSize=”381.00″ SoldPackUOM=”GM” VendorPackSize=”381.00″ VendorPackUOM=”GM” CostPackSize=”381.00″ CostPackUOM=”GM” CurrentRetail=”4.99″ CurrentUnits=”301.34″ ForecastedUnits=”2111.74″ ForecastedSales=”7032.10″ ForecastedProfit=”-84.47″ ForecastedAdLoss=”-3505.49″ IsNationalBrand=”False” IsPrivateLabel=”False” IsBuyRequired=”True” IsGetRequired=”False” NetUnitCost=”3.37″>
<ProductHierarchy>
<Department ID=”9012″ Name=”FROZEN”>
<Class ID=”90121207″ Name=”FROZEN PIZZA”>
<Line ID=”901212072″ Name=”PIZZA – DINNER SIZE” />
</Class>
</Department>
</ProductHierarchy>
<OfferProductStores>
<OfferProductStore StoreNumber=”16″ CurrentRetail=”4.9900″ Price=”9.99″ EffectivePrice=”9.99″ Quantity=”3.00″ />
<OfferProductStore StoreNumber=”20″ CurrentRetail=”4.9900″ Price=”9.99″ EffectivePrice=”9.99″ Quantity=”3.00″ />
<OfferProductStore StoreNumber=”25″ CurrentRetail=”4.9900″ Price=”9.99″ EffectivePrice=”9.99″ Quantity=”3.00″ />
</OfferProductStores>
</OfferProduct>

</OfferProducts>
</Offer>
<Offer Name=”Lock1-2″ Description=”Save $1.00″ Page=”1″ Location=”2″ FeatureType=”Minor feature” SalesType=”Ad” IsExclusive=”False” IsElective=”False” IsCoupon=”False” IsTraffic=”False”>
<Tiers>
<Tier Number=”1-3″>
<BuySpecification Price=”1.99″ Quantity=”1.00″ />
</Tier>
<Tier Number=”1-4″>
<BuySpecification Price=”1.99″ Quantity=”1.00″ />
</Tier>

</Tiers>

</Offer>

</Offers>

</Version>
</Versions>

</Event>

XSLT file for reading child nodes in a table:-

XMLSample.xslt

<?xml version=”1.0″ encoding=”utf-8″?>
<xsl:stylesheet version=”1.0″ xmlns:xsl=”http://www.w3.org/1999/XSL/Transform&#8221; xmlns:msxsl=”urn:schemas-microsoft-com:xslt” exclude-result-prefixes=”msxsl”>

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

<xsl:template match=”Event”>
<html>
<body>
<table id=”playlist”>
<xsl:apply-templates />
</table>
</body>
</html>

</xsl:template>

<xsl:template match=”Event”>
<tr>
<td>
EVENT – <xsl:value-of select=”@Name” />
<table>
<xsl:for-each select=”child::Versions/Version”>
<tr>
<td></td>
<td>
VERSION – <xsl:value-of select=”@Name” />
<table>
<xsl:for-each select=”child::Stores/Store”>
<tr>
<td></td>
<td></td>
<td>
STORE – <xsl:value-of select=”@Name” />
</td>
</tr>
</xsl:for-each>

<xsl:for-each select=”child::Offers/Offer”>
<tr>
<td></td>
<td></td>
<td>
OFFER – <xsl:value-of select=”@Name” />
<table>
<xsl:for-each select=”child::Tiers/Tier”>
<tr>
<td></td>
<td></td>
<td></td>
<td>
TIER – <xsl:value-of select=”@Number” />
<table>
<xsl:for-each select=”child::BuySpecification”>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td>
Price – <xsl:value-of select=”@Price” />
Quantity – <xsl:value-of select=”@Quantity” />
</td>
</tr>
</xsl:for-each>

<xsl:for-each select=”child::GetSpecification”>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td>
Price – <xsl:value-of select=”@Price” />
Quantity – <xsl:value-of select=”@Quantity” />
</td>
</tr>
</xsl:for-each>
</table>
</td>
</tr>
</xsl:for-each>

<xsl:for-each select=”child::OfferProducts/OfferProduct”>
<tr>
<td></td>
<td></td>
<td></td>
<td>
OFFER-PRODUCT – <xsl:value-of select=”@ProductID” />
UPC – <xsl:value-of select=”@UPC” />
<table>
<xsl:for-each select=”child::ProductHierarchy/Department”>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td>
Department-ID – <xsl:value-of select=”@ID” />
Department-Name – <xsl:value-of select=”@Name” />
<table>
<xsl:for-each select=”child::Class”>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>
Class-ID – <xsl:value-of select=”@ID” />
Class-Name – <xsl:value-of select=”@Name” />
<table>
<xsl:for-each select=”child::Line”>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>
Line-ID – <xsl:value-of select=”@ID” />
Line-Name – <xsl:value-of select=”@Name” />
</td>
</tr>
</xsl:for-each>
</table>
</td>
</tr>
</xsl:for-each>
</table>
</td>
</tr>
</xsl:for-each>

<xsl:for-each select=”child::OfferProductStores/OfferProductStore”>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td>
StoreNumber – <xsl:value-of select=”@StoreNumber” />
Price – <xsl:value-of select=”@Price” />
Quantity – <xsl:value-of select=”@Quantity” />
</td>
</tr>
</xsl:for-each>
</table>
</td>
</tr>
</xsl:for-each>

<xsl:for-each select=”child::Deals/Deal”>
<tr>
<td></td>
<td></td>
<td></td>
<td>
Deal description – <xsl:value-of select=”@Description” />
<table>
<xsl:for-each select=”child::DealStores/DealStore”>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td>
StoreName – <xsl:value-of select=”@StoreName” />
StoreNumber – <xsl:value-of select=”@StoreNumber” />
</td>
</tr>
</xsl:for-each>

<xsl:for-each select=”child::DealIncentives/DealIncentive”>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td>
IncentiveId – <xsl:value-of select=”@ID” />
BuyStartDate – <xsl:value-of select=”@BuyStartDate” />
BuyEndDate – <xsl:value-of select=”@BuyEndDate” />
</td>
</tr>
</xsl:for-each>

<xsl:for-each select=”child::DealProducts/DealProduct”>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td>
Name – <xsl:value-of select=”@Name” />
Description- <xsl:value-of select=”@Description” />
<table>
<xsl:for-each select=”child::DealProductIncentives/DealProductIncentive”>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td>
DealIncentiveID – <xsl:value-of select=”@DealIncentiveID” />
PercentageOff- <xsl:value-of select=”@PercentageOff” />
</td>
</tr>
</xsl:for-each>
</table>
</td>
</tr>
</xsl:for-each>
</table>
</td>
</tr>
</xsl:for-each>
</table>
</td>
</tr>
</xsl:for-each>
</table>
</td>
</tr>

</xsl:for-each>
</table>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>

Day 1

Posted on: June 11, 2008

This is the Day 1 of my MCTS preparation article. Here I am assuming that the reader has some acquaintance with programming and object oriented concepts.As I would be basically putting major differences in C# with respect to traditional programming like in C++, I would be glad to take up queries on any of these concepts.

Hope you will find it worthwhile. Good luck…

1. Overview of MS .Net Platform

The MS .Net platform provides all of the tools and technologies that you need to build distributed web applications. It has:-

1. The .Net Framework
It provides necessary compile time and run time foundation to build and run .Net based application. It has:-

     1. Common Language Runtime. The CLR,
          o simplifies application development,
          o provides a robust and secure execution environment,
          o support multiple languages and
          o Simplifies application deployment and management.
          o It is also referred as a managed environment ,
          o in which common services such as garbage collection and
          o Securities are automatically provided.

     2. Class Library
     It exposes features of the runtime and provides application (Component, Message queuing, IIS etc.) and other services that can be extended further.

     3. ADO .Net
     Ahead of MS ActiveX DO, ADO.Net provides improved support for the disconnected programming  model.
     It also provides rich XML support.

     4. User Interfaces
     Three types:-
          o Web Form, works through ASP.Net
          o Windows Form, works through Win32 client computer
          o Console application

2. .Net My Services
It is a set of user centric XML web services. XML web services are programmable web components that can be shared among applications on the internet or intranet.

3. The .Net Enterprise Servers
It provides scalability, reliability, management and integration within and across organizations

4. Visual Studio .Net

.Net Framework Advantages
1. Based on web standards and practices of existing internet technologies (HTML, XML, SOAP etc.)
2. Designed using unified application models for any .Net compatible language or programming model.
3. Easy to use, because of hierarchical namespaces and classes.
4. Extensible classes

2. C#

Class – is a user defined data type that contains a set of data and methods to manipulate that data.
A class cannot span multiple files.

In C# application, there can be onle one entry point, but it is possible to have multiple classes each with Main, but only one of them will be executed on your specification.

Compilation command:-

csc myprogram.cs /
eg.
csc myprogram.cs /my_class_having_main_method__to_be_execute
csc myprogram.cs /?
csc myprogram.cs /help
csc myprogram.cs /debug

Execution process

I

II

C# source code

C# source code

MSIL

 

Machine code

(by JIT compiler @ runtime)

Machine code

(by Native Image Generator (Ngen.exe) utility)

Advantage :-

– loads faster because it restores code and data structures from native image cache rather than generating dynamically

Advantage :-
– loads faster because it restores code and data structures from native image cache rather than generating dynamically

3. Variables Types

Common Type System of CLR is the model that defines rules for declaring, using and managing types. 2 types of variables in C#:-

 

Value Type

Reference Type

1

Directly contain data

Stores reference to data (i.e. objects)

2

Each has its own copy of data

2 refs can refer to same objects

3

Operation on one can not affect other

Operation on one can affect other

Value types
All value types directly contain data, and they cannot be null. 2 types of VT:-

1. Built in type
    E.g. int, float
2. User defined
    E.g. enum. struct

* Besides assigning a value to a variable as assignment expression itself has a value, which is the value of the variable after the assignment has taken place.
Eg. Console.WriteLine(var = 2); prints 2

* You can use structs to create objects that behave like built in value types. Because structs are stored inline and are not heap allocated, there is less garbage collection pressure than classes.

Data Type Conversion

1. Implicit
• cannot fail
• may lose precision but not magnitude
2. Explicit
• Use a “cast“expression

*checked
{
     Stmts expected to throw overflow exception
}

* C# does not support integer to Boolean conversion,
Eg.
If (x) //must be x!=0 in C#
If(x = 0) //must be x==0 in C#

Switch in C#

Enum MonthName{Jan, Feb, …,Dec}
MonthName current;
Int monthDays;

switch(current)
{
case MonthName.Feb:
monthDays = 28;
break;
case MonthName.April:
case MonthName.June:
case MonthName.September;
case MonthName.November:
monthDays = 30;
break;
default:
monthDays = 31;
break;
}

Q I want to ask:- One or more case labels cannot silently fall through or continue to the next case labels, why???

4. Exception handling

try
{
     Stmnts causing exception
}
catch(OverflowException caught) {…}
catch(DivideByZeroException caught) {…}
catch(OutOfMemoryException caught) {…}
catch(System.Exception) {…} or catch{…} /General catch block, has to be last of all catch blocks

Raising exceptions using “throw”

if (cond…)
{
     throw new InvalidTimException(“Error message text!!”);
}
The message can be displayed or logged

* You can “throw” only an object if the type of the object is directly or indirectly derived from System.Exception.

If you wan to retain the info of the exception thrown while raising another exception further then:-

catch(IOException caught)
{
     throw new FileNotFoundException(filename,caught);
}

* A throw with no expression can be used, but only in a catch block.

catch(OutOfMemoryException caught)
{
     throw caught; //equvivalent to rethrow of C++
}

catch(OutOfMemoryException caught) {throw; //same as above}

Finally block

1. Avoid duplication of statements
2. Release resources after the exception has been thrown

In finally block, don’t use:-
• break;
• continue;
• goto;
• return;
if it takes the control goes out of the finally block.

* C# program doesn’t check arithmetic for overflow, thus

int I = int.MaxValue;
Console.WriteLine(++i);

will display -2147483648 , the largest negative int value.

So you can globally turn on/off the arithmetic overflow checking by:-
C:\ csc /checked+ mycsharpfile.cs — on
C:\ csc /checked- mycsharpfile.cs — off

For statement specific

checked
{
      Statement list
}

unchecked
{
     Statement list
}

5. Methods and Parameters

Method – It is a named block of code that performs an action or computes a value. Dividing the application into functional units also allows reuse functional components.

Each method call needs memory to store return addresses and other information.

Mechanisms for passing parameters

3 ways to pass parameters to and from methods:-

1. By Value (to pass in)
2. Reference (to pass in/out)
3. Output (to pass out)

1. By Value (to pass in)
     a. It is the default way
     b. A new storage is assigned and value is copied
     c. Variables can be changed inside method
     d. Has no effect on the outside variable
     e. Has to be of the same type or compatible type

2. Reference (to pass in/out)
     a. Is the reference to the same memory location where the original variable is stored
     b. Use “ref” in method declaration and call
     c. Match types and variable values
     d. Changes in method affect the caller
     e. Have to assign value before calling the method
3. Output (to pass out)

The other day, one of my hostel mate told be about this elegant lady, who was once a CEO of HP. She has her autobiography with the name “Tough Choices: A Memoir”.

She was named one of the 30 most powerful women in the United States. A law school dropout, she earned a BA in philosophy and medieval history from Stanford, a MBA in Marketing from University of Maryland and a MS in Management from MIT.

Before holding the office of Hewlett Packard ‘s CEO, she had had her time as a secetary at various jobs. She also worked as a broker briefly for Marcus & Millichap. It is here that she notes her knowledge of the business world. Another job she took was to teach English in Italy.

In 1980, Fiorina joined AT&T to work as a management trainee and later rose to Senior Vice President before leaving in 1995. She then worked for Lucent Technologies where she was Executive Vice President (Lucent is a AT&T spinoff). She was prolific in implementing stock activities as well as planning for the future. She began President of the consumer production business and later Chairman (woma n) & Group President of the global sector of the company. All this occurred before the age of 43!

In 1999, her history with Hewlett Packard began. She succeeded Lewis Platt as CEO of the company. She was heavily involved in the decision to “Reinvent” the company. Because of a downturn in business, she authorized nearly 7,000 layoffs within the company. Three years after joining HP, she authorized a merge with Compaq.

Her departure began in 2005, when the Board Of Directors had a meeting with her about her performance. This was ultimately leaked to the famous newspaper, The Wall Street Journal. They wanted to shift her authority, but Carly was not having it. She was let go of in 2005 and was replaced by Patricia Dunn. After her departure, HP’s stock rose nearly 7%.

Fiorina currently holds board of trustee positions at the World Economic Forum, Taiwan Semiconductor Manufacturing Company and MIT. She also is director at Revolution Health Group and part of the board for Cybertrust. In 2006, her book “Tough Choices: A Memoir” was released. She currently has two residences in Los Altos Hills, California as well as the Nation’s capital.

5 Things Carly Fiorina Has Learned About Leadership

Its been 4 days now that I have been juggling with Crystal reports of Visual Studio 2005.

 But all my efforts are been worthwhile since I was able to get the output as desired.

Few things that I learnt are:-

  • Crystal reports without default log on system
  • Crystal reports using parameters through code

[C# CODE]

        protected void btnSearch_Click(object sender, EventArgs e)
        {
           
            CrystalDecisions.Shared.ParameterField PARAMETER_FIELD_Cat = new CrystalDecisions.Shared.ParameterField();
            CrystalDecisions.Shared.ParameterField PARAMETER_FIELD_SKU = new CrystalDecisions.Shared.ParameterField();
           
  
     //Assign the name same as the parameter fields you have created in the report .rpt
            PARAMETER_FIELD_Cat.Name = “ReportParamCatName”;
            PARAMETER_FIELD_SKU.Name = “ReportParamSKUName”;

            CrystalDecisions.Shared.ParameterDiscreteValue PARAMETER_Discrete_FIELD_Cat = new ParameterDiscreteValue();
            CrystalDecisions.Shared.ParameterDiscreteValue PARAMETER_Discrete_FIELD_SKU = new ParameterDiscreteValue();

           
            PARAMETER_Discrete_FIELD_Cat.Value = ddlItems.SelectedItem.Text.ToString();
            PARAMETER_Discrete_FIELD_SKU.Value = ddlSKUs.SelectedItem.Text.ToString();

            PARAMETER_FIELD_Cat.CurrentValues.Add(PARAMETER_Discrete_FIELD_Cat);
            PARAMETER_FIELD_SKU.CurrentValues.Add(PARAMETER_Discrete_FIELD_SKU);
            CrystalDecisions.Shared.ParameterFields PARAMETER_FIELDs = new ParameterFields();

            PARAMETER_FIELDs.Add(PARAMETER_FIELD_Cat);
            PARAMETER_FIELDs.Add(PARAMETER_FIELD_SKU);
           
            CrystalReportViewer1.ParameterFieldInfo = PARAMETER_FIELDs;
            CrystalReportViewer1.EnableParameterPrompt = false;
         

            ////With out log on
            string reportpath = Server.MapPath(“Reports\\RPT_PriceDissemination_Chart.rpt”);

            ReportDocument myreportdocument = new ReportDocument();
            myreportdocument.Load(reportpath);
            myreportdocument.SetDatabaseLogon(“<username>”,”<password>”);

            CrystalReportViewer1.ReportSource = myreportdocument;
            //********

        }

[/CODE]

  • Creating charts
  • Enableing the “Don’t Summarize” check box

 “Don’t Summarize” – works with the formula fields for a chart.

Thus in order to show the data points directly instead of the aggregated functions create a formula field in your .rpt file and assign it the values from the database fields.

For example: –

create a formula like ->

formula = ToNumber ({MyTable.FieldToBeDisplayed})

in

Formula Creation

Once you create a Formula Field, it will then appear in the “Fields Available list”.

chart-expert.jpg

 It will plot the data points of the referd column as it is and will not summarize if you check the “Don’t Summarize” checkbox.

Do let me know if this helps you

  

Oh my God!! It’s the nth time that I am making a fresh start for keeping this blog up and alive.Hope I’ll reach somewhere someday.So this time no cluttering of thoughts let’s just jot down the things at first then make a coherent view.

How to convert ppt slides into web page?

Let’s say we have 2 Presentations with us viz.

There is going to be a layoff at my organisation. They are going to offshore all the professional services units to professional comapnies. Majorly the IT and the software work is going to be outsourced to them. So I think its time for me to become more serious than ever before. Even though I have been looking out for new avenues for my self but I need to be more focused and aggressive about it now.

The cell phone was initially invented to provide the ease of mobile connectivity and instant communication, but with the ever increasing technology there seems to be a plethora of devices that are available in the market today. But frankly speaking none of them has ever convinced me to ditch my Nokia 1100, not even after the BL-5C issue. Rather I was impressed with Nokia’s concern over the increasing incidences of battery explode. Well who doesn’t make mistakes? So did Nokia, but at least they have the guts to take the responsibility of this and took the corrective measures of replacement.

Some where I read that “Customers will never like you if you make them think, but they will always love you if you make them think that they are thinking”. So being a typical customer I really dislike it when I have to sit down and make a comparison sheet for all the brands and models. But for some time I was just doing the same thing and was really confused as some model have some features that I want and some other has some thing else that I think would be useful for me. It just struck to me that why can we have an assembled phones? Something like we have in our PCs, where I can put in only those components that I desire most. What I basically wanted was a bare minimum cell phone that allows me just to make and receive call, with texting feature of an average character width, a good capacity of phone book, in games only “Sankes”, a longer battery and a fantastic quality of camera with sufficient memory and I can manage with only a data cable. So what I don’t want is FM, Bluetooth, scheduler, mp3, internet, Wi-fi, Gprs or any other such thing which all seems to be for the convenience of the caller and not the called.

Case:-

I have 2 power point presentations viz. “Presentaion 1” and “Presentaion 2”. In “Presentaion 1” I have a hyperlink in one of the slides, from where, I want to move to “Presentaion 2”.

Solution:-

Steps:-

  1. Open “Presentaion2.ppt”
  2. Write your content in it.
  3. When you are fully done, Go to File->”Save As”
  4. Name it “Presentation2.htm” and select “Save as Type” -> “Web page” and click “Save button”.
  5. You can close this file now.
  6. Open “Presentaion1.ppt”
  7. Put the linking text on the slide.
  8. Select the text and right click
  9. Select “Hyperlink…”
  10. Locate “the Presentation2.htm” through the “Browse” button as shown in the image below: –
  11. new-ppt-to-web.jpeg

  12. Save the “Presentation1.ppt” through “Save As” into “Presentation1.htm” by selecting the “Save as type” -> “Web Page”
  13. You are done!!
  14. Now open the “Presentation1.htm” in the browser and go to the hyperlink -> this will take you the the “Presentation2.htm”

To Edit the Hyperlink

  1. Open the “Presentation1.ppt”
  2. Select the linking text.
  3. Right click -> “Edit Hyperlink” -> this will open “Action Settings” box
  4. Select the radio button “Hyperlink to:”
  5. Select the “URL…” from the drop down list
  6. 1.jpeg

  7. Give the relative path of your destination page in the URL dialogue box , using the following logic: –
    1. If “Presentation2.htm” is in current folder then give hyperlink as “./Presentation2.htm”
    2. If it is in the folder above then give “../Presentation2.htm”
    3. or if it is in some other folder then locate its path for the browser using the dots(./..) and the folder names together in the appropriate way.

Steps:- 

  1. Verify that you have MS Visual Source Safe 6.0 for .Net applications with “Shared Applications”.
  2. Create a folder in any of the local drives for adding a “database” for your project. Remember that the “database” is synonymous to a directory that is going to hold the source saved files for your project and it has no relation to any “database” as such. It is probably called so since it is going contain the versions of you project in the repository.
  3. Go to Start-> Programs-> Microsoft Visual Source Safe-> Visual Source Safe 6.0 Admin. If you are opening this application for the first time then it won’t ask you to connect to any “database”. But next time onwards you will always have to connect to any of the existing “databases” as “Admin” for creating a new “database” or adding/changing the user settings in any of the database. 
  4. Go to Tools-> Create Database -> Browse to the folder that you created in Step 2-> ok. This will create a “database” for you in you folder with 2 default users viz. Admin and Guest. You can change/add user settings depending on your development team requirements.
  5. t.jpeg

  6. Close Visual Source Safe Administrator.
  7. To add your .Net project to the source safe, open the project Programs-> Microsoft Visual Studio .Net 2003-> Microsoft Visual Studio .Net 2003 -> File -> open your project.

Write here:-

  1. Technical learning capsules
  2. Books review/interesting stuff
  3. Opinions about incidents/people/social/philosophical etc.

The main purpose of this is to put down the scuttling ideas/thoughts in my mind so that i can make a better meaning out of them.

Wish me luck….