Friday, December 20, 2013

Problems with date/time formats with Telerik Grid

Today I had a problem with Telerik Grid showing a databound column on the test server, in that crazy US format (no offence to Dave!) 'mm-dd-yyyy' rather than they far more logical format 'dd-mm-yyyy'. This was not the case on the Production server or when running locally on a development PC. Logging on to the server and manually setting the region to "Australia" did not work.

The solution is to check the user account under which the application is running under IIS; then logon to the server using this account and changing the region. After that you'll need to do an IIS reset and all should be well.

Sunday, November 17, 2013

Next key violation in Primavera

If you get this error message after copying and pasting a record in Primavera, the next key value may be out of sequence. This may be due to an import issue.

Run this script to find the key errors.
PRINT '====================================================================='
PRINT 'create a script for key errors and show the max key values and next key values'
PRINT '====================================================================='
GO
DECLARE @S NVARCHAR(MAX) = ''
;WITH
key_table_list
AS
(
select key_name, key_seq_num, table_name = LEFT(key_name, CHARINDEX('_',key_name, 0)-1), column_name = RIGHT(key_name, LEN(key_name) - CHARINDEX('_',key_name, 0)) FROM NEXTKEY
)
,
single_script
AS
(
SELECT
    [RowNumber]= ROW_NUMBER() OVER(ORDER BY tl.table_name)
, script = 'SELECT table_name =''' + tl.table_name + ''', max_key_seq_num = MAX(' + tl.column_name + '), key_seq_num = '
+ CAST(tl.key_seq_num AS VARCHAR) + ', KeyError = CASE WHEN MAX(' + tl.column_name + ') > ' + CAST(tl.key_seq_num AS VARCHAR)
+ ' THEN ''EXEC dbo.getnextkeys N''''' + tl.column_name + ''''', '' + CAST(MAX(' + tl.column_name + ') - ' + CAST(tl.key_seq_num AS VARCHAR) + ' + 1 AS VARCHAR) + '', @NewKeyStart OUTPUT'' ELSE NULL END FROM ' + tl.table_name
FROM
    key_table_list tl
INNER JOIN sys.objects ob ON ob.name = tl.table_name
WHERE ob.type = 'U'
)
SELECT @S = @S + CASE WHEN [RowNumber] != 1 THEN ' UNION ' ELSE '' END + script
FROM
single_script
EXEC ('SELECT * FROM (' + @S+ ') AS se WHERE KeyError IS NOT NULL')
GO
table_name
max_key_seq_num
key_seq_num
KeyError
spidmap
539
100
EXEC dbo.getnextkeys N'spid', 440, @NewKeyStart OUTPUT
wbrscat
3
1
EXEC dbo.getnextkeys N'wbrs_cat_id', 3, @NewKeyStart OUTPUT
The 'key_seq_num' should be + 1 greater than the 'max_key_seq_num'. Use the script from 'KeyError' to update the tables as below.
PRINT '====================================================================='
PRINT 'update next key to number of missing increments '
PRINT '====================================================================='
GO
SET XACT_ABORT ON
BEGIN TRANSACTION
DECLARE @NewKeyStart AS INT
EXEC dbo.getnextkeys N'spid', 440, @NewKeyStart OUTPUT
EXEC dbo.getnextkeys N'wbrs_cat_id', 3, @NewKeyStart OUTPUT
ROLLBACK TRANSACTION
--COMMIT TRANSACTION

Wednesday, August 28, 2013

How to refresh the Universe in a Business Objects report

Right click on the universe name in the data panel and select "Change Source"

Select the second option "Specify a new data source" and select "Universe" from the dropdown

Then select the universe name and click "Select"

Then click "Next"

Then check the columns and click "Finish"

Wednesday, May 8, 2013

Change the timeout setting for Business Objects

We've been having problems with running out of session on the production server. To assist this I wanted to reduce the time-out limits from 20 minutes to 10...

Edit the file "D:\Program Files (x86)\SAP BusinessObjects\Tomcat6\webapps\BOE\WEB-INF\web.config", and look for the setting at the bottom of the file....

<session-config>

<session-timeout>10</session-timeout>

</session-config>

Restart tomcat service and that should be it.

Friday, April 19, 2013

Installation of Business Objects Client V4

  1. Run setup .exe
  2. Select English
  3. All Prerequisites should succeed

  1. Click/Next/Next and accept the license/Next/Next
  2. Select the installation directory and click Next

  1. Keep the standard installation options and click Next/Next

  1. After successful installation Click finish.
  2. Reboot your PC.
  3. Information Design tool should be in the Start/SAP BusinessObjects BI platform 4/ folder.

Tuesday, April 16, 2013

Setup Business Objects Explorer for SSO

Logon to the server using RDP
1. Stop Tomcat.
2. Modify the file D:\Program Files (x86)\SAP BusinessObjects\Tomcat6\webapps\explorer\WEB-INF\classes\sso.properties as shown below.

3. Modify the file D:\Program Files (x86)\SAP BusinessObjects\Tomcat6\webapps\explorer\WEB-INF\web.xml as shown below.
image

4. Start Tomcat.
5. Restart the 4 Explorer Servers in Central Configuration Manager (CCM).

Friday, October 19, 2012

Doing the URL re-write in ASP.Net

So you want to re-write URLs in a ASP.NET application? Well here is one solution ....

Intelligencia.UrlRewriter (http://urlrewriter.net/)

Setup in your project is simple, just add the following to the Web.Config

<configSections>

<section name="rewriter" requirePermission="false" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter"/>.

<httpHandlers>

<add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter"/>.

.. then you add a section like that below:

<rewriter>

<rewrite url="~/Contracts/?(.*)" to="~/Contracts.aspx?ID=$1" />

i.e. When the user tries to access the URL: /Contracts/">http://<server>/Contracts/ this will be converted to the application as /Contracts.aspx/">http://<server>/Contracts.aspx/

But what about the “?(.*)” ? I hear you cry .. Well this is a Regular Expression that lets you parse the rest of the URL entered. For example “/contracts/ABC” will be converted to “/contracts.aspx?ID=ABC”. You can of course get all fancy and take out specific values for things so the URL becomes far more meaningful, but that I’ll leave up to you to Google on the web.

One good into blog is here: http://www.blogiversity.org/blogs/blogdayafternoon/archive/2008/12/18/url-rewriting-using-intelligencia-urlrewriter.aspx)

So what are the Problems?

1) Well the biggest issue you get is with Post backs.. When you do an ASP.NET postback it sometimes plays around with the “action=” URL for your form. As an example it takes the converted URL : contracts.aspx and sets the forms “Post” action to “contracts.aspx”. that’s fine until it gets back to the rewriter which converts this to “contracts.aspx?ID=.aspx” !! which won’t work.

To get around this issue you just have to put the following in the site.master code behind.

masterform.Action = Request.RawUrl;

In your Master Page you make sure the form name matches this;

<form ID="masterform" runat="server">

2) Another issue you might face is that the URL rewriting is order specific, i.e. once it finds a URL that matches that entered it will assume you’re calling that page. For example “/contactsForMyApplication/” you may want to go to the “/contactsForMyApplication.aspx” page, but it the appears *after* the “/Contracts/ rewrite entry you’ll find yourself hitting the “contracts.aspx” page by mistake.

To get around this you need to be careful of the ordering in the web.config and you can put an attribute (which I can’t remember) option in the <rewrite> node which stops further processing.