I got an interesting task – add variable VERSION specifying the service pack to about 50 webi documents. I had to invent something more clever then going through all them manually.
The following function can be used to add a dimension variable with name name and value value to webi document widoc.
public static boolean addReplaceVariable(DocumentInstance widoc, String name, String value) { ReportDictionary dic = widoc.getDictionary(); VariableExpression[] variables = dic.getVariables(); boolean found = false; for (VariableExpression e : variables) { if (e.getName().equalsIgnoreCase(name)) { System.out.println("variable " + name + " expression " + e.getFormula().getValue() + " was replaced with " + value); e.setValue(value); found = true; break; } } if (!found) { try { dic.createVariable(name, ObjectQualification.DIMENSION, value); System.out.println("variable " + name + " with value " + value + " has been created"); } catch (Exception e) { System.out.println("ERROR: the variable " + name + " cannot be created"); return false; } } return true; }
It can be executed
if (addReplaceVariable(widoc, "VERSION", "=\"12.00.18.00\"")) { widoc.save(); }
Hi, is it possible to overwrite/ replace the SQL in a WebI query using the JAVA SDK?
LikeLike
yep. https://bukhantsov.org/2012/02/how-to-change-sql-in-webi-document-via-java-re-sdk/
LikeLike
Hi,
I have a similar requirement. I have nearly 500 reports, each report having logo on the right up corner in all tabs, in a cell having formula “boimg://logo.bmp” and read as image URL. Now i have come up with change in logo format. Now the same formula is to be changed to “boimg://logo.jpg”.
Env:BOXI 3.1 SP3
Please suggest me java code for the same.
Regards,
Raghu
LikeLike
https://bukhantsov.org/2012/09/how-to-change-expression-in-report-cells-using-bo-java-sdk/
LikeLike
Hi Dmytro,
Your posts have been very helpful for me. I really appreciate the effort which you put in to explain everything.
I have a requirement where I have to allow the customer to create New Web intelligence Report with default Header layout and Footer layout with logo.
Another requuirement is that the Customer should be able to change the table Column header color, fonts etc. in all webi reports which have been already created and saved by specifying the values at only 1 file location.
Can this be done?
Thanks,
Subodh
LikeLike
Hi Subodh
Yes – this can be done with Java SDK (at least in XI 3.1)
LikeLike
Hi Dmytro,
Thanks for responding so fast. Can you please give me a brief Idea of how to achieve the above requirement.I am using XI 3.1 .
Thanks !!
Subodh
LikeLike