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,090

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 

  • Suggested answer
    SaverioT Profile Picture
    328 on at
    RE: Finding a Report from Class

    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();

  • Martin Dráb Profile Picture
    231,758 Most Valuable Professional on at
    RE: Finding a Report from Class

    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.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,884 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,758 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans