Pages

Friday, August 5, 2011

SharePoint: Create a Document Library for a Specific Content Type in SharePoint 2007

This blog post gives a few simple instructions on how to work with Document Libraries and Content Types. As an example this post shows you how to create a new document library just for "Report Data Source" objects from SQL Server Reporting Services.


Navigate to your site and select "View All Site Content";

Then select the "Create" button (centre of the above image);

Select "Document Library" (highlighted above);

Enter the details for your new document library.

NOTE: "Document Template" at the bottom right. Unless it will benefit all your users to have a default document type I'd be tempted to (and usually do) change this to "None".

After the details have been entered click "Create";

Now we've got the document library use the "Settings" drop down and click "Document Library Properties";

Click on "Advanced Settings " (under "General Settings" - on the middle left);

The top item is "Content Types" and this will initially be set to "No". Change this to "Yes" and then click "OK";

A new section "Content Types" has now appeared. The only available content type as the moment is "Document". Click "Add from existing site content types";

Select the content type you wish to add in the list and move it into the "Content types to add" list. Then click "OK";

As you can now see we have two content types listed; Document and Report Data Source. Click on "Document";

Click on "Delete this content type" (under "Settings" in the middle section);

Click "OK";

You are now left with the single content type for your document library (it has automatically been made the default).

Tuesday, August 2, 2011

Noetix: Fixing Compilation Errors in the KFF Packages

This blog post provides step-by-step instructions on how to rebuild the KFF packages that are automatically generated by Noetix which populate the cached flex field tables.


The source code to build the packages that keep the KFF tables populated are generated by the packages N_GSEG_PKG and the routine VALUE_TBL_POPULATE.

This routine takes a single parameter the, the data table key from the table N_F_KFF_FLEX_SOURCES which matches to the package you wish to re-create. To get a list from the table use the SQL;

SELECT nfkfs.data_table_key,
       nfkfs.id_flex_code,
       nfkfs.target_value_object_name,
       nfkfs.kff_view_description
  FROM n_f_kff_flex_sources nfkfs;

This will give you results similar to;

When you call the routine you need to record the session ID (as the script to create the new view is written into a temporary table indexed by the session ID). PL/SQL Developer makes this very easy by allowing both input and output variables from code blocks;

begin
  -- Call the procedure
  :id := USERENV ('sessionid');
  n_gseg_pkg.value_tbl_populate(i_data_table_key => :i_data_table_key);
end;

In this case I'm storing the sessionid in :id and using the value in :i_data_table_key to call the routine. If you're using some other tool then you'll need to modify the code above if it doesn't support output parameters in code blocks.

Once you've called the routine the source code will have been inserted into the table N_BUFFER, you can get it at using the SQL;

SELECT nb.TEXT
  FROM n_buffer nb
 WHERE nb.session_id = 7751119
 ORDER BY nb.line_number

This then needs to be extracted and written into the correct file in your Noetix Installation folder. The correct file will be the value of TARGET_VALUE_OBJECT_NAME with "_pkg.sql" appended to the end of it. For example to rebuild the Accounting Key Flexfield KFF package (N_KFF_GL_Acct_pkg, data table key = 1 above) the code will be in the file N_KFF_GL_Acct_pkg.sql.

Thursday, July 28, 2011

Solving the "Cannot display this help file" error with Windows Help (.hlp) Files Under Vista/Windows 7/and later

This blog post provides simple step-by-step solutions to getting Windows Help files to display under Windows Vista/ Windows 7.


NOTE: Microsoft Help Viewer is not installed as standard in any of the newer operating systems (Microsoft is actively discouraging it's use). In order to add this feature to you system consult this Mircosoft Knowledgebase Article;

http://support.microsoft.com/kb/917607

This gives you the information you need to install the Help viewer on Vista/7/2008/etc. Without it you will not be able to view help files *at all*.

The message which this knol is attempting to solve when viewing a Help file is;

The error message reads;

 "Cannot display this help file. Try opening the help file again, and if you still get this message, copy the help file to a different drive, and try again".

First of all it's just "information" (not an error) and whilst copying it to a drive with different permissions could solve the problem the fact that you're seeing this error in the first place indicates that it might not.

The problem is caused by the file not being from a "known" source and being in a location (on your hard drive/ network share/ USB stick/ etc) where items with a unknown source cannot be run. Windows in effect treats Help Files in the same was as it does with executables. The message is quite correct in that moving it to a location where this restriction isn't enforced will solve the problem, it's just pretty unlikely there is one!

Anyway to solve the problem right-click the file and select "Properties" (usually at the bottom).

I've highlighted the "Security" section. Click "Unblock". Click "OK".

You should now be able to open the file.

Wednesday, July 27, 2011

Noetix: Including the GL Cost in the GMF_Item_Costs Template


This blog post covers how to add in a field called GL_Cost_Item_Period_Total which displays the GL Cost from the GMF.GL_ITEM_CST table for both Release 11i and Release 12 of Oracle E-Business Suite.

The field uses a sub-query as a comparison between adding in the table and doing a sub-query revealed that adding the table causes rows to be excluded from the result set (and therefore is a big Noetix No-No).


The SQL required for Release 11 (in the column definition) is;

(SELECT MAX(GIC.ACCTG_COST)
   FROM GMF.GL_ITEM_CST GIC
  WHERE 1=1
    AND GIC.PERIOD_CODE = CLDTL.PERIOD_CODE
    AND GIC.Orgn_Code = XMAP.PROCESS_ORGN_CODE
    AND GIC.ITEM_ID = COSTS.Item_Id
) GL_Cost_Item_Period_Total

By using the MAX value we ensure that only a single record is returned. In our configuration this is correct but you should do some testing to ensure the value is correct in all circumstances (a lot easier than it sounds - just change the SQL above to be MAX(GIC.ACCTG_COST) - MIN(GIC.ACCTG_COST), do a rebuild and look for non-zero valued columns).

The SQL required for Release 12 is;

(SELECT MAX(GIC.ACCTG_COST)
   FROM GMF.GL_ITEM_CST GIC
  WHERE 1=1
    AND GIC.PERIOD_ID = PSTAT.PERIOD_ID
    AND GIC.Organization_Id = XMAP.ORGANIZATION_ID
    AND GIC.INVENTORY_ITEM_ID = COSTS.INVENTORY_ITEM_ID
) GL_Cost_Item_Period_Total

The change is around the join condition and reflect the changes Oracle has made at Release 12.

The code to test the new view is;

SELECT DISTINCT 
  Item$Item, -- You'll need to change this to your item-identifying flex field
  PERIOD_CODE, 
  GL_Cost_Item_Period_Total 
FROM GMFG0_Item_Costs
;

The complete code for the file called "gmf_item_costs_gl_cost_item_period_total_xu2.sql" which needs to be saved in your Installs directory and linked to from wnoetxu2.sql is below;

-- Template for adding a simple column to the Noetix template table
-- This template can be used for adding columns of type 'COL' and 'EXPR'
-- It MUST NOT be used for column types 'LOOK', 'ATTR' or 'AUTOJOIN'
-- ****************************************************************************
-- File Name:    gmf_item_costs_gl_cost_item_period_total_xu2.sql
-- Date Created: 26-JUL-2011
-- Purpose:
--    To add in a column that shows the GL Cost Total for the Item and Period
-- ****************************************************************************


-- output to .lst file
@utlspon gmf_item_costs_gl_cost_item_period_total_xu2


COLUMN max_from NEW_VALUE max_from_position


SELECT MAX(from_clause_position) max_from
FROM   n_view_table_templates
WHERE  view_label = 'GMF_Item_Costs';


COLUMN max_col NEW_VALUE max_col_position


SELECT MAX(column_position) max_col
FROM   n_view_column_templates
WHERE  view_label = 'GMF_Item_Costs';


-- -----------
INSERT INTO n_view_column_templates
  (view_label, query_position, column_label, table_alias, column_expression, column_position, column_type, description, group_by_flag, gen_search_by_col_flag, profile_option, product_version, created_by, creation_date, last_updated_by, last_update_date)
VALUES
  ('GMF_Item_Costs' -- view_label
  ,1 -- query_position
  ,'GL_Cost_Item_Period_Total' -- column_label
  ,NULL -- table_alias
  ,'(SELECT MAX(GIC.ACCTG_COST) ' || 
   '   FROM GMF.GL_ITEM_CST GIC ' || 
   '  WHERE 1=1 ' || 
   '    AND GIC.PERIOD_ID = PSTAT.PERIOD_ID ' || 
   '    AND GIC.Organization_Id = XMAP.ORGANIZATION_ID ' || 
   '    AND GIC.INVENTORY_ITEM_ID = COSTS.INVENTORY_ITEM_ID ' || 
   ')' -- column_expression
  ,(&max_col_position + 1) -- column_position
  ,'EXPR' -- column_type
  ,'The total GL Cost associated with the Item and Period. NOTE Do not try and SUM this column as the value will be incorrect' -- description
  ,'N' -- group_by_flag
  ,'N' -- gen_search_by_col_flag
  ,null -- profile_option
  ,'12+' -- product_version
  ,'A Pellew' -- created_by
  ,TO_DATE('26-JUL-2011') -- creation_date
  ,'A Pellew' -- last_updated_by
  ,TO_DATE('26-JUL-2011')) -- last_update_date
;


INSERT INTO n_view_column_templates
  (view_label, query_position, column_label, table_alias, column_expression, column_position, column_type, description, group_by_flag, gen_search_by_col_flag, profile_option, product_version, created_by, creation_date, last_updated_by, last_update_date)
VALUES
  ('GMF_Item_Costs' -- view_label
  ,1 -- query_position
  ,'GL_Cost_Item_Period_Total' -- column_label
  ,NULL -- table_alias
  ,'(SELECT MAX(GIC.ACCTG_COST) ' || 
   '   FROM GMF.GL_ITEM_CST GIC ' || 
   '  WHERE 1=1 ' || 
   '    AND GIC.PERIOD_CODE = CLDTL.PERIOD_CODE ' || 
   '    AND GIC.Orgn_Code = XMAP.PROCESS_ORGN_CODE ' || 
   '    AND GIC.ITEM_ID = COSTS.Item_Id ' || 
   ')' -- column_expression
  ,(&max_col_position + 1) -- column_position
  ,'EXPR' -- column_type
  ,'The total GL Cost associated with the Item and Period. NOTE Do not try and SUM this column as the value will be incorrect' -- description
  ,'N' -- group_by_flag
  ,'N' -- gen_search_by_col_flag
  ,null -- profile_option
  ,'11-11.999' -- product_version
  ,'A Pellew' -- created_by
  ,TO_DATE('26-JUL-2011') -- creation_date
  ,'A Pellew' -- last_updated_by
  ,TO_DATE('26-JUL-2011')) -- last_update_date
;


INSERT INTO n_view_table_templates
  (view_label, query_position, table_alias, from_clause_position, application_label, table_name, product_version, base_table_flag, subquery_flag, gen_search_by_col_flag, created_by, creation_date, last_updated_by, last_update_date)
VALUES
  ('GMF_Item_Costs' -- view_label
  ,1 -- query_position
  ,'GIC' -- table_alias
  ,(&max_from_position + 1) -- from_clause_position
  ,'GMF' -- application_label
  ,'GL_ITEM_CST' -- table_name
  ,'%' -- product_version
  ,'N' -- base_table_flag
  ,'Y' -- subquery_flag
  ,'N' -- gen_search_by_col_flag
  ,'A Pellew' -- created_by
  ,to_date('26-JUL-2011') -- creation_date
  ,'A Pellew' -- last_updated_by
  ,to_date('26-JUL-2011')) -- last_update_date
;


COMMIT;


@utlspoff


NOTE: Updated on the 27th July 2011 removing the "chr(13)" codes, this (ironically) seems to cause the column to not be added to the view. Not quite sure why (and neither are Noetix - as the column does appear in the help) but removing the additional code solves the problem.

Friday, July 22, 2011

SSRS: Deployment Problems With Large Data Models

This blog post describes how to solve the "Maximum request length exceeded" error when deploying large data models; the "maximum" size of the XML file the Report Server is expecting.


The Problem
The problem is easily sumarised by the actual error message;

The text of the message reads;

"There was an exception running the extensions specified in the config file. ---> Maximum request length exceeded."

What this actually means is that you've tried to pass an XML file (Report Model?) to the server which is larger than the maximum size allowed.

The Background/ Duplicating The Problem
The test file that I used to run into this problem has a Data Source View (DSV) that contains about 35 objects. It's actually based on views in an Oracle e-Business Suite schema. The DSV diagram is;

 Apologies for this being a little small but the point is to show you the complexity, not to go into details of exactly what I'm doing. If I look into the project directory I can see that that the two files (the DSV and the Report Model) are 1MB and 3MB respectively;

When I attempt to deploy the project onto the Report Server (Windows 2008R2 running SQL Server 2008R2) I get the error message displayed above.

Fixing the Problem
This isn't actually that hard it just involves a change in the web.config file on the Report Server.

Open explorer and go to;

C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer

Of course if you're installed your software into some strange local directory you'll need to change the above path so that it works for your setup. But then you'll be used to doing that.

Open the file web.config in a text editor (i.e. Notepad);

The bit I've highlighted reads;
httpRuntime executionTimeout="9000"

Change this bit to read;
httpRuntime executionTimeout="9000" maxRequestLength="10240"

This will give you a 10MB size limit. If you need a different value then you can just change the 10240 to something else. 10MB seems a good size but if you have a highly controlled environment you might want to set a value only slighly larger than your largest model.

Once you've mode this change re-boot the server and you will be able to deploy the large model without any issues.

Thursday, July 14, 2011

SSRS: Dynamically Linking Reports Together

This blog post provides a step-by-step guide with a worked example of how to link together two reports without hard-coding report paths (allowing you to migrate reports from Development > Testing > Live without having to worry about changing code to make sure, for example, your Live report is not linking to a Development report).


By far the easiest way to work through this is to look at a specific example.

Background
Let us assume we have two Reports "Journal Lines" (General Ledger) and "Invoice Details" (Accounts Payable). The user has defined a link between the "Journal Lines" report that, if the Journal is the result of an invoice, the user can click on the Invoice Number in the Journal Lines report and be taken to all Invoices that match that Invoice Number in the Invoice Details report.

Our Reporting Services server is structured so that at the Root there is a series of "Live" folders as well as hidden DEV (Development) and TST (Testing) folders which contain reports being worked on with the same folder structure as the Live folders;

What we need to be able to do is code the link between the two reports in the DEV folder in such a way so that when the reports are moved to the TST folder the links automatically re-point themselves.

Linking The Reports
Open the main report (in this case Journal Lines) and select the cell you wish to make clickable to perform the link. Right click it and select "Text Box Properties ...";

Select the "Action" item on the left panel (bottom entry), and then select "Go to URL"

Click on the function button next to the "Select URL" entry box and enter the formula;

=Globals!ReportServerUrl + "?" + Replace(Replace(Globals!ReportFolder, "General Ledger", "Accounts Payable") + "/Invoices Between Two Dates&rs:Command=Render", "/", "%2f")

Click "OK" back through the dialogs to save the change.

This formula uses the global variables ReportServerUrl and ReportFolder to build a URL. The inner replace function swaps the "General Ledger" directory (see first image) with "Accounts Payable" while the outer one replaces all the "/" characters with their HTML equivalent.

Run the report, the link this creates will now map directly to the new report.

Councillors Right of Access to Information and Confidentiality


This blog post summarises the statutory right of access to information available to Councillors across the political spectrum in the UK. It is by no means exhaustive. I am by no means a legal expert! All Councillors should be aware of who is fulfilling the "Monitoring Officer" role at their Council and this is the best person to ask regarding access to information and confidentiality.

Hopefully this will be useful to Councillors (primarily opposition Councillors - of which I am one) across England.

(Of course if you are a member of the public and you want to know something then "asking a Councillor" might actually be useful!)


Executive Summary
Councillors have the right to access any information held by the Council to which they are a member. Some information may be labelled "Confidential" but if that information would be accessible under the Freedom of Information Act then the Councillor is freely able to publish the information.

Summary
A Councillors right of access to information held by the Council to which they belong is derived from statute and case-law as follows;

Applying specifically to Councillors;

  • S.100F LGA 1972 and the Local Authorities (Executive Arrangements) (Access to Information) (England) Regulations 2000
  • The common law ‘Need to Know’

Applying to all UK citizens;

  • The Freedom of Information Act 2000 and EI Regulations
  • S.17 Local Government and Finance Act 1982

COMMENT/NOTES: The right of access is NOT the same as the right to publish or otherwise make public. It is perfectly possible for a Councillor to be aware of something that they are unable to make public.

It is vitally important that when Councillors agree to be bound by Confidentiality Clauses in order to gain access to information they also make clear under what conditions the Confidentiality Clause comes to an end (typically the public disclosure of the information by the County Council or a third party where the County Council has publicly responded or is preparing to publicly respond to such a disclosure). The last thing Councillors need is to be effectively gagged by a confidentiality agreement when the information is already public!

Detailed Report
The Right of a Councillor to access information is enshrined in the Local Government Act 1972, specifically (S.100(F) LGA 1972). This provides that any document held by the council containing material relating to any business to be transacted at any meeting of the council, committee or sub-committee must be available for inspection by any member of the council unless it is deemed by the proper officer to fall within certain categories of ‘exempt’ information (under Sched 12A), with the exception of para 3 (except to the extent that the information relates to proposed terms of a contract), and para 6.

Additionally there is a feature of Common Law called the ‘Need to Know’. Under common law principles members of authorities have the right to access information held by the authority where it is reasonably necessary to enable the member to properly perform their duties as a councillor (Ex p Hook 1980). The House of Lords coined the phrase ‘need to know’ in a case involving a councillor who asked for access to a social services adoption file in order to assist in making an informed decision on a housing matter. The HL found that
even though the councillor wasn’t a member of the social service committee they had established a bone fide need to know the information due to their role as a councillor.

In common with all citizens Councillors can also use the Freedom of information Act 2000 (FOI) and EI Regulations to access information. The General presumption is that information should be disclosed unless one of the exceptions contained in the act applies. The various exceptions include things such as legal privileged or commercially sensitive information.

Councillors have a statutory right to inspect any books, deeds, contracts, bills, vouchers and receipts prior to the annual audit (Section 17, Local Government Finance Act, 1982). They also have a right to inspect accounts and to take copies throughout the year (Section 228(3), Local Government Act, 1972).

Confidentiality
Often adminstrations (of all political hues) will stamp the word "Confidential" on a document that for one reason or another they do not want to enter the public domain. Just because a document has the word "Confidential" on it it does not *always* mean that a Councillor in possession of the document is not able to make it public (of course some documents marked "Confidential" should remain confidential but it is based on the full content of the document, not just the use of the word Confidential!).

If the information is accessed using the FOI legislation, the information can be regarded as public i.e. the Councillor may share the information with others. In fact many Councils automatically disclose this information on their own websites.

However, if the Councillor has accessed information under the Common law 'Need to Know' power or under S.100F LGA 1972, in some cases the information will be 'confidential' in which case the Councillor will be bound by confidentiality.

In respect of information accessed under S.17 Loc Gov & Finance Act 1982, the position was considered recently by the Courts and the result is unclear and will depend upon the nature of the information.

If the Councillor accesses the information by any means other than FOI, they can check with the Monitoring Officer whether it is accessible by FOI. If the Monitoring Officer confirms that it is, then this supersedes any “confidential” markings on the papers, and the information can be used in public.