TechnologiesAIProductsAI & Analytics

Last Week in the Forums: Making the Month in a Date All Uppercase, Row Dimension Headers in a Crosstab

This blog series takes a look back at the past week in the forums, recalling how active they were and highlights some of the questions asked that seem to frequent the forums or other interesting topics. Halfway through the year in a little over a week and the forums are as busy as ever! As always, thanks to those members who are helping answer questions. It is a great help to the community!

The first topic I’ll discuss this week is about converting a month in a date to uppercase. The poster had a date and wanted it formatted a certain way and to get the month to be all uppercase. The solution given for this was to format the date, then convert the date to a string and use the uppercase function on the string. The code used in a dynamic textbox is below:

importClass(java.text.SimpleDateFormat) dateFormat =newSimpleDateFormat("MMMM, yyyy");
date = dateFormat.format(BirtDateTime.now());
date.toString().toUpperCase();


The next topic for this week is about adding a row dimension header in a crosstab. BIRT automatically creates a header row for the column dimensions in a crosstab, but doesn’t do the same for the row dimensions. In the earliest versions of BIRT, there wasn’t a great solution to this issue. Somewhere around BIRT 2.2, I think, you were able to start using the large block in the upper left corner of the crosstab to put in a header for the row dimensions. This is still the solution in the newest releases. What you do is add a grid to the top left cell and put your labels in the grid cells. You then size the row dimension cells and the grid cells the same so that they line up correctly.

The last topic from last week’s forums I’ll discuss is formatting a value in an expression. The poster was doing a calculation in script and wanted to be able to format the returned value how they wanted so they could just insert the calculated value into their string expression. The solution was to use the java NumberFormat package with something like the following:

"Net Due Company "+"("+dataSetRow["DISPLAY_NAME"]+") "+newPackages.java.text.NumberFormat.getCurrencyInstance().format(row["Aggregation_2"]-row["PreviousPayment"]+dataSetRow["QSE FEE"])


Again, this is just a small sample of what went through the forums this past week. For more questions and answers that have been posted, check out the forums. As always, if you have a question, feel free to ask it, and if you see a question you know the answer to or have a similar experience to, feel free to post an answer or comment.

Show More

OpenText

OpenText is the leader in Enterprise Information Management (EIM). Our EIM products enable businesses to grow faster, lower operational costs, and reduce information governance and security risks by improving business insight, impact and process speed.

Related Posts

Back to top button
Close