Monday, August 27, 2007

Microsoft SQL Reporting Services and Visual Studio 2005

If you want to be able to create Report Projects for SQL Reporting Services with Visual Studio 2005 you have to install SQL 2005, I did the Standard install, and make sure you select the "Business Intelligence" items. Wait forever.......and when the install is finally done you will get a option for "Report Server Project" when you select "New Project" in Visual Studio 2005.

Thursday, August 23, 2007

Seamless inline text editing with ASP.NET AJAX | Encosia

I've seen this done Google calendar and think it's a nice way to have the same page used as display and edit. The author of this blog does an awesome job of explaining each step.

Seamless inline text editing with ASP.NET AJAX Encosia

Tuesday, August 21, 2007

SAP MDM COM API SP5

I've noticed that the console now seems to show ALL com api connections in the Logins section. Apparently MDM COM API creates a connection for the application and another for the trace. I'm not sure if this is true but I've never saw it before moving to SP5.

Thursday, August 16, 2007

SQL Reporting Services

I had a report that looked great in the browser but showed this error when exported to Excel:
"Subreports within table/matrix cells are ignored."

It's a limitation with the software. I removed the table and put my Fields and sub reports in a List control. I set the datasource and grouping properties for the List control and everything works fine now.

Thursday, August 9, 2007

SAP MDM COM API Get Attribute By Category ID

public static DataTable GetByCategoryID(int attributeID, int categoryID, XCATCOMLib.Catalog catalog)
{
// There are 3 types of attributes:
// Feature - text values;
// Characteristic - numeric values;
// Coupled - coupled numeric values.

DataRow row = null;
DataTable dt = new DataTable();
dt.Columns.Add("AttributeID");
dt.Columns.Add("AttributeValue");
dt.Columns.Add("AttributeCoupleValue");
dt.Columns.Add("AttributeDisplayValue");
dt.Columns.Add("AttributeRating");
dt.Columns.Add("ShowAllFlag");
dt.Columns.Add("AttributePriority");
dt.Columns.Add("AttributeUnitID");
dt.Columns.Add("AttributeCoupleUnitID");

XCATCOMLib.Attribute prodAttribute = catalog.GetAttribute(CATEGORY_TABLE, attributeID);
XCATCOMLib.Search search = new XCATCOMLib.SearchClass();
XCATCOMLib.TaxonomyLookupParameter param = search.Parameters.NewTaxonomyLookupParameter(PRODUCT_TABLE, CATEGORY_FIELD);
param.NodeID = categoryID;


XCATCOMLib.FreeFormTableParameter tableParam = search.Parameters.NewFreeFormParameter(PRODUCT_TABLE);
XCATCOMLib.FeatureParameter featureParam = null;


int attribType = prodAttribute.Type;
string attribDefinition = prodAttribute.Definition;
byte attribPriority = prodAttribute.Priority;

if (attribType == 0) //xcFeatureValueType
{
XCATCOMLib.FeatureValues fvs = catalog.GetLimitedFeatureValues(search, CATEGORY_TABLE, attributeID);
foreach (FeatureValue fv in fvs)
{
row = dt.NewRow();
row["AttributeValue"] = fv.ID;
row["AttributeID"] = attributeID;
row["AttributeDisplayValue"] = fv.Value;
row["AttributeRating"] = 0;
row["ShowAllFlag"] = false;
row["AttributePriority"] = attribPriority;
row["AttributeUnitID"] = "";
row["AttributeCoupleUnitID"] = "";
dt.Rows.Add(row);
}
}
else if ((attribType & 0xFF) > 0) //xcCharacteristicValueType
{
string attribName = Helper.FormatAttributeName(prodAttribute.Name);
string attribAlias = prodAttribute.Alias;

int[] gRatingArray = new int[5];
gRatingArray[0] = 8;//"xcNominalRating";
gRatingArray[1] = 1;//"xcMinimumRating";
gRatingArray[2] = 2;//"xcMaximumRating";
gRatingArray[3] = 16;//"xcAverageRating";
gRatingArray[4] = 4;//"xcTypicalRating";

int attribTypeInt = prodAttribute.Type;
for (int k = 0; k < gRatingArray.Length; k++)
{
int rating = gRatingArray[k];

if ((attribTypeInt & rating) == rating)
{
XCATCOMLib.CharacteristicValues cvs = catalog.GetLimitedCharacteristicValues(search, CATEGORY_TABLE, attributeID, (RatingEnum)rating);

foreach (CharacteristicValue cv in cvs)
{
row = dt.NewRow();
row["AttributeID"] = attributeID;
row["AttributeDisplayValue"] = cv.GetString(prodAttribute.DimensionID, prodAttribute.DecimalPlaces, prodAttribute.AllowFractions, cv.UnitID);;
row["AttributeValue"] = cv.Value;
row["AttributeCoupleValue"] = "";
row["AttributeRating"] = rating;
row["ShowAllFlag"] = false;
row["AttributePriority"] = attribPriority;
row["AttributeUnitID"] = cv.UnitID;
row["AttributeCoupleUnitID"] = "";
dt.Rows.Add(row);
}
}
}
}
else if (attribType == 0x8000) //xcCoupledValueType
{
XCATCOMLib.CoupledValues cpvs = catalog.GetLimitedCoupledValues(search, CATEGORY_TABLE, attributeID);
foreach (CoupledValue cpv in cpvs)
{
string primary;
string coupled;
primary = cpv.Primary.GetString(prodAttribute.DimensionID, prodAttribute.DecimalPlaces, prodAttribute.AllowFractions, cpv.Primary.UnitID);
coupled = cpv.Coupled.GetString(prodAttribute.CoupledDimensionID, prodAttribute.CoupledDecimalPlaces, prodAttribute.CoupledAllowFractions, cpv.Coupled.UnitID);

row = dt.NewRow();
row["AttributeDisplayValue"] = primary + " " + prodAttribute.CoupledDelimiter + " " + coupled;;
row["AttributeValue"] = cpv.Primary.Value;
row["AttributeCoupleValue"] = cpv.Coupled.Value;
row["AttributeID"] = attributeID;
row["AttributeRating"] = 0;
row["ShowAllFlag"] = false;
row["AttributePriority"] = attribPriority;
row["AttributeUnitID"] = cpv.Primary.UnitID;
row["AttributeCoupleUnitID"] = cpv.Coupled.UnitID;
dt.Rows.Add(row);
}
}

return dt;
}

SAP MDM COM API SP5

MDM SP5 seems to be faster overall. A new field has been added in the console called "Code". This is really nice because now you can access fields using this Code name instead of the display Name.

There were a lot of places in where I had to change .Name to .Code, but after that the upgrade went smoothly.

Friday, August 3, 2007

Scrollovers - A New Way of Linking

I like the idea. Too many on a page might be overkill though.

Scrollovers - A New Way of Linking