domingo, 17 de novembro de 2013

SpagoBI e Mondrian

Em caso de erros do tipo: com.tonbeller.jpivot.olap.model.OlapException: ERROR: function upper(integer) does not exist

adicione o tipo de dados à descrição do cubo Olap (por padrão o editor do SpagoBI Studio não o faz), para que o Mondrian / JPivot saiba que o atributo em questão não é do tipo String e sim um Integer, Numeric, etc...

vide exemplo da descrição da dimensão abaixo (extrato da descrição de um Cubo Mondrian) - note o atributo type = "Integer" deixando claro que nrsetor na tabela lote era do tipo Inteiro e não String:





allMemberName="Todos_SetorLote"
primaryKey="idlote" 
>


ordinalColumn="nrsetor"
uniqueMembers="false"
/>

uniqueMembers="false"
/>


 

quinta-feira, 14 de novembro de 2013

Workarounds para problemas entre SpagoBI 4 e JasperReports


Usando SpagoBI 4, alguns problemas apareceram ao usar relatórios com JasperReports. Tais relatórios estavam sendo preparados com a versão 5.1 do iReports. Para solucionar os problemas os seguintes workarounds foram utilizados:
- Para o bug do UUID não aparecer, evitar importar as configurações de versões anteriores do iReports
- Nas configurações do iReport, solicitar modo de compatibilidade para a versão 4.0.1 e com isso o bug do (Invalid content was found starting with element 'paragraph'. No child element is expected at this point.) deixou de aparecer
- Para corrigir erros do tipo: Cannot cast from Date to String
                value = (java.lang.String)(new java.util.Date()); //$JR_EXPR_ID=13$
que apareciam nos textFields, bastou em cada TextField marcar o tipo de dado que ele deveria exibir (o mesmo do campo a que ele estava relacionado)
- Para trabalhar com imagens no relatório e poder especificar o caminho relativo para as imagens, criar o parâmetro SBI_RESOURCE_PATH. Tal parâmetro estará apontando para o diretório resources da pasta do SpagoBI. Assim, para referenciar um certa imagem, usar o exemplo: $P{SBI_RESOURCE_PATH} + "logo1_peq.jpg"

sábado, 12 de outubro de 2013

SpagoBI - Uso de caracteres especiais como parâmetros (LOV)

Caso seja necessário o uso de caracteres especiais nos parâmetros dos LOV, como por exemplo um LOV para meses: Janeiro, Fevereiro, MARÇO, etc... e quando o valor MARÇO for selecionado, seu SpagoBI deixa de funcionar, siga as dicas abaixo:



the url string pattern is blocked by the spagobi's validator. You can find the pattern used by spagobi to validate the parameter's value in file SpagoBI/WEBINF/conf/tools/datasources/validation.xml In particular this is the block of configuration that specify the pattern... <field label="URL_CONNECTION" name="URL_CONNECTION"> <validator arg0="^([a-zA-Z0-9.:@\s\-\_\(\)\\\/])*$" validatorname="REGEXP"> <validator arg0="50" validatorname="MAXLENGTH"> </validator></validator></field> as you can see char ';' and '=' are not included in the pattern. For this reason your url parameter value is considered not valid. You can modify this block of configuration in order to include also ';' &amp; '=' chars in the pattern and then restart the server. With this work around you should be able to save your db url.

Contributed by Andrea Gioia (SpagoBI Team)

sexta-feira, 11 de outubro de 2013

SpagoBI - Localization



Rough SpagoBI Translation Guide. Suppose adding pt_BR language:

========================
1) Configure the new language
• Log into SpagoBI as Administrator
• Go to Tools - Manage Configurations
• In the Select Category combo box, select "LANGUAGE_SUPPORTED"
• Add the language at the end of the existing string as follows: ,[pt,BR]
• Add the icon of the related flag into the file: SpagoBI\themes\sbi_default\css\analiticalmodel\execution\main.css , by
adding the following lines:
.icon-pl {
 background- url('../../../img/pt_BR.gif') !important;
}
• The image containing the new flag shall be added into the folder SpagoBI\themes\sbi_default\img .


2) Translate the titles, messages and labels
At this point, translate all the titles, messages and labels included in SpagoBI packages:
• SpagoBI\WEB-INF\classes\MessageFiles\
• SpagoBI\js\src\ext\sbi\messages e SpagoBI\js\src\ext\sbi\formats
• SpagoBIQbeEngine\js\spagobi\messages e SpagoBIQbeEngine\js\spagobi\formats
• SpagoBIGeoReportEngine\js\src\ext\sbi\messages e SpagoBIGeoReportEngine\js\src\ext\sbi\formats
• SpagoBIConsoleEngine\js\spagobi\messages e SpagoBIConsoleEngine\js\spagobi\formats
All .properties files must be copied and renamed as xxxxxx_pt_BR.properties, before making any changes inside.
Repeat the steps above to all engines you want to use


3) Translate the messages in the files above to your locale language and if the language uses non-latin characters run native2ascii on each file: (e.g. native2ascii messages_pt_BR.properties messages_pt_BR.properties)

4) Copy webapps/SpagoBI/js/src/ext/sbi/locale/en.js & webapps/SpagoBI/js/src/ext/sbi/locale/commons/en.js to your language code e.g. br.js and translate the messages in the files, run native2ascii if required.

5) Restart SpagoBI and you should see your language. Also clear browser cache to see the new modifications.

6) Contribute the message files etc back to SpagoBI


contribution from Hesham Ahmed (SpagoBI jira user)