Hi Experts,
I want to find this Report but i didn't how can i i open this class as well but were this Report is please check the below code:
class RSReportsLauncher extends RunBase
{
str s_reportsRelativePathOnServer;
str s_reportServerUrl;
str s_reportParameters;
}
public static void BrowseReport(str _reportExecutionUrl)
{
infoLog.urlLookup(_reportExecutionUrl);
}
public static str ExportReport(str _reportName,
str _reportParameters = '',
str _expToFileName = '',
str _exportPath = WinAPI::getTempPath())
{
str ret;
str relativePath = RSReportsLauncher::GetReportsPath();
str serverUrl = RSReportsLauncher::GetServerUrl();
RightSolutions.SSRSReports.ReportViewer ReportViewer ;
RightSolutions.SSRSReports.ExportFileTypes expFileType = RightSolutions.SSRSReports.ExportFileTypes::PDF;
//str tempFolder = WinApi::getTempPath();
System.Exception ex;
str fullFileName = _exportPath + _reportName + '.pdf';
List parametersList = strSplit(_reportParameters, ',');
ListEnumerator pLe;
List paramPairs;
ListEnumerator pvLe;
str pName, pValue;
;
if (_expToFileName)
{
fullFileName = _exportPath + _expToFileName + '.pdf';
}
else
{
fullFileName = _exportPath + _reportName + '.pdf';
}
try
{
new InteropPermission(InteropKind::ClrInterop).assert();
reportViewer = new RightSolutions.SSRSReports.ReportViewer(_exportPath);
reportViewer.WriteToLog(true);
reportViewer.ServerUrl(serverUrl);
reportViewer.RelativePathOnServer(relativePath);
reportViewer.ReportName(_reportName);
pLe = parametersList.getEnumerator();
while (pLe.moveNext())
{
paramPairs = strSplit(ple.current(), '=');
pvLe = paramPairs.getEnumerator();
pvLe.moveNext();
if (pvLe.current())
{
pName = strLTrim(strRTrim(pvLe.current()));
pValue = '';
if (pvLe.moveNext())
{
pValue = strLTrim(strRTrim(pvLe.current()));
}
ReportViewer.AddParameterWithValue(pName, pValue);
}
}
ret = reportViewer.ExportReportToFile(expFileType,
fullFileName,
'');
reportViewer = null;
CodeAccessPermission::revertAssert();
}
catch(Exception::CLRError)
{
CodeAccessPermission::revertAssert();
new InteropPermission(InteropKind::ClrInterop).assert();
ex = ClrInterop::getLastException();
CodeAccessPermission::revertAssert();
if (ex != null)
{
ex = ex.get_InnerException();
if (ex != null)
{
error(ex.ToString());
}
}
}
catch (Exception::Error)
{
Box::stop("@RPF1817");
}
return ret;
public static str GetReportExecutionUrl(str _reportFullName,
str _reportServerUrl = '',
str _reportParameters = '')
{
str retValue = '';
;
if (!_reportServerUrl)
{
_reportServerUrl = RSReportsLauncher::GetServerUrl();
}
retValue = strFmt('%1?%2&rs:Command=Render', _reportServerUrl, _reportFullName);
if (_reportParameters)
{
if (strStartsWith(_reportParameters, "&"))
{
retValue = strfmt("%1%2", retValue, _reportParameters);
}
else
{
retValue = strfmt("%1&%2", retValue, _reportParameters);
}
}
return retValue;
public static str GetReportsPath(str _reportName = '')
{
str retValue = '';
str rootReportsPath;
;
rootReportsPath = strFmt('/%1/PeopleFirst/', RSReportsLauncher::GetReportsRootPath());
retValue = rootReportsPath + _reportName;
return retValue;
}
public static str GetReportsRootPath()
{
str retValue = '';
SRSServers reportServersTable;
;
select firstOnly *
from reportServersTable
where reportServersTable.IsDefaultReportLibraryServer == true;
if (reportServersTable)
{
retValue = reportServersTable.AxaptaReportFolder;
}
return retValue;
public static str GetServerUrl()
{
str retValue = '';
SRSServers reportServersTable;
;
select firstOnly *
from reportServersTable
where reportServersTable.IsDefaultReportLibraryServer == true;
if (reportServersTable)
{
retValue = reportServersTable.ServerUrl;
}
return retValue;
}
}
}
}
public static void main(Args args)
{
str reportName;
str reportFullName;
str reportParameters;
str currentCompany = curext();
str viewerCaption;
MenuFunction callerMenu;
;
if(args!=null)
{
reportName = args.parm();
reportFullName = RSReportsLauncher::GetReportsPath(reportName);
callerMenu = new MenuFunction(args.menuItemName(), args.menuItemType());
viewerCaption = callerMenu.label();
if (reportFullName)
{
reportParameters = 'CompId=' + strUpr(currentCompany);
//url = RSReportsLauncher::GetReportExecutionUrl(reportFullName, reportServerUrl, reportParameters);
//RSReportsLauncher::BrowseReport(url);
RSReportsLauncher::ViewReport(reportName, viewerCaption, reportParameters);
}
}
}
public static void ViewReport(str _reportName,
str _viewerCaption = '',
str _reportParameters = '',
boolean _showParametersSection = true,
boolean _expandParametersSection = true)
{
str relativePath = RSReportsLauncher::GetReportsPath();
str serverUrl = RSReportsLauncher::GetServerUrl();
RightSolutions.SSRSReports.ReportViewer reportViewer;
str tempFolder = WinApi::getTempPath();
System.Exception ex;
;
try
{
new InteropPermission(InteropKind::ClrInterop).assert();
reportViewer = new RightSolutions.SSRSReports.ReportViewer(tempFolder);
reportViewer.WriteToLog(true);
reportViewer.ServerUrl(serverUrl);
reportViewer.RelativePathOnServer(relativePath);
reportViewer.ReportName(_reportName);
reportViewer.Paramters(_reportParameters);
reportViewer.Caption(_viewerCaption);
reportViewer.ShowParametersSection(_showParametersSection);
reportViewer.ExpandParametersSection(_expandParametersSection);
reportViewer.ShowReport();
reportViewer = null;
CodeAccessPermission::revertAssert();
}
catch(Exception::CLRError)
{
CodeAccessPermission::revertAssert();
new InteropPermission(InteropKind::ClrInterop).assert();
ex = ClrInterop::getLastException();
CodeAccessPermission::revertAssert();
if (ex != null)
{
ex = ex.get_InnerException();
if (ex != null)
{
error(ex.ToString());
}
}
}
catch (Exception::Error)
{
Box::stop("@RPF1817");
}
}
Best Regards,
Shabir