Vijay Peram

Friday, May 16, 2008

Exploring Actuate Reporting Tool

Q: Build the logic to display Summary Report or Detail Report or Both Reports?

A: Override following method on sequential section with holds all the report sections.

Function NewContent( index As Integer ) As AcReportComponent
'*****************************************************************************'
' Build the logic to display Summary Report or Detail Report or Both Reports. '
'*****************************************************************************'
Select Case UCase(pstrReportType)
Case "B"
Select Case Index
Case 1
Set NewContent = Super::NewContent(1)
Case 2
Set NewContent = Super::NewContent(2)
Case 3
Set NewContent = Super::NewContent(3)
Case 4
Set NewContent = Super::NewContent(4)
End Select
Case "S"
Select Case Index
Case 1
Set NewContent = Super::NewContent(1)
Case 2
Set NewContent = Super::NewContent(2)
Case 3
Set NewContent = Super::NewContent(4)
Case 4
Set NewContent = Nothing
End Select
Case "D"
Select Case Index
Case 1
Set NewContent = Super::NewContent(1)
Case 2
Set NewContent = Super::NewContent(3)
Case 3
Set NewContent = Super::NewContent(4)
Case 4
Set NewContent = Nothing
End Select
End Select
End Function

Q: How to format collection of comma delimited strings into a SQL in list format?
A: Create the following function in a library and call this library in the report and pass parametr values to the function.


Function strInListFormat(strParmString) as String
'------------------------------------------------------------------------------------------------'
' This function returns a SQL formatted comma delimited in list with parentheses and single quotes. You must pass a comma delimited string '
' with even length values for this function to work properly. - '
'------------------------------------------------------------------------------------------------'
Dim intStrLength as integer
Dim intPrevPos as integer
Dim intNextPos as integer
Dim strInList as String
'------------------------------------------------------------------------------------------------'
' Get overall parameter string length '
'------------------------------------------------------------------------------------------------'
intStrLength = len(Trim(strParmString))
'------------------------------------------------------------------------------------------------'
'------------------------------------------------------------------------------------------------'
' Get first comma postion '
'------------------------------------------------------------------------------------------------'
intPrevPos = inStr(1,Trim(strParmString),",")
'------------------------------------------------------------------------------------------------'
'------------------------------------------------------------------------------------------------'
' Set opening parentheses '
'------------------------------------------------------------------------------------------------'
strInList = "("
'------------------------------------------------------------------------------------------------'
'------------------------------------------------------------------------------------------------'
' If there is only one parameter value then finish the string
'------------------------------------------------------------------------------------------------'
If intPrevPos = 0 then
strInListFormat = strInList & "'" & Trim(strParmString) & "')"
'------------------------------------------------------------------------------------------------'
'------------------------------------------------------------------------------------------------'
' If there is more than one parameter value then Loop through parameters building the string until one is left '
'------------------------------------------------------------------------------------------------'
Else
'------------------------------------------------------------------------------------------------'
intPrevPos = 1
intNextPos = 1
Do While intNextPos <> 0
intNextPos = inStr(intPrevPos,Trim(strParmString),",")
If intNextPos <> 0 then
strInList = strInList & "'" & Trim(Mid(Trim(strParmString),intPrevPos,intNextPos - intPrevPos)) & "',"
intPrevPos = intNextPos + 1
End If
Loop
'------------------------------------------------------------------------------------------------'
' If there is more than one parameter value finish the string '
'------------------------------------------------------------------------------------------------'
strInListFormat = strInList & "'" & Trim(Mid(Trim(strParmString),intPrevPos,intStrLength + 1 - intPrevPos)) & "')"
End If
'------------------------------------------------------------------------------------------------'
End Function


'-----------------------------------------------------------------------------------------------
'This function replaces the commas in a delimited string with a carriage return.
'-----------------------------------------------------------------------------------------------
Function strReplaceComma(strParmString) as String
'------------------------------------------------------------------------------------------------'
' This function returns a string where the commas separating the values is replaced by a carriage return. You must pass a comma delimited
' string as the parameter.
'------------------------------------------------------------------------------------------------'
Dim intStrLength as integer
Dim intPrevPos as integer
Dim intNextPos as integer
Dim strInList as String
'------------------------------------------------------------------------------------------------'
' Get overall parameter string length '
'------------------------------------------------------------------------------------------------'
intStrLength = len(strParmString)
'------------------------------------------------------------------------------------------------'
'------------------------------------------------------------------------------------------------'
' Get first comma postion '
'------------------------------------------------------------------------------------------------'
intPrevPos = inStr(1,strParmString,",")
'------------------------------------------------------------------------------------------------'
'------------------------------------------------------------------------------------------------'
' If there is only one parameter value then finish the string
'------------------------------------------------------------------------------------------------'
If intPrevPos = 0 then
strReplaceComma = strParmString
'------------------------------------------------------------------------------------------------'
'------------------------------------------------------------------------------------------------'
' If there is more than one parameter value then Loop through parameters building the string until one is left '
'------------------------------------------------------------------------------------------------'
Else
'------------------------------------------------------------------------------------------------'
intPrevPos = 1
intNextPos = 1
Do While intNextPos <> 0
intNextPos = inStr(intPrevPos,strParmString,",")
If intNextPos <> 0 then
strInList = strInList & Mid(strParmString,intPrevPos,intNextPos - intPrevPos) & Chr(10) & Chr(13)
intPrevPos = intNextPos + 1
End If
Loop
'------------------------------------------------------------------------------------------------'
' If there is more than one parameter value finish the string '
'------------------------------------------------------------------------------------------------'
strReplaceComma = strInList & Mid(strParmString,intPrevPos,intStrLength + 1 - intPrevPos)
End If
'------------------------------------------------------------------------------------------------'
End Function

Wednesday, August 8, 2007

My Family - Mother

Prabhavathi Peram

My Family - Father

Venkata Veera Sambasiva Rao Peram

My Family - Daughter

Kovida Sai Peram

My Family - Wife

Rani Peram

Me - Vijay Subhash Roy Peram