web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Finding a Report from Class

(0) ShareShare
ReportReport
Posted on by 3,110

FindingReport.png

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 

I have the same question (0)
  • Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    Your code is very difficult to read, because blocks of code are not indented. Please paste your code again, this time using Insert > Insert Code (in the rich-formatting view), and use it for all code in future.

    Note that the class it's not a report at all.

  • Suggested answer
    SaverioT Profile Picture
    330 on at

    Search in cross reference (update that if not) the class RSReportsLauncher; seams that is called by a menuitem that pass the report name as parmeters property, inside main:

    reportName = args.parm();

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 611 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans