It is obvious that we customize many document reports e.g. Sales order, Purchase order, Quotation, Projects for a new report design and call the report from different journal accordingly. There are few ways to specify the new report design, using Print management document or setting this new report design as a system report in the table "PrintMgmtReportFormat".
In most of the cases, AX SSRS report controller class call for the system report from PrintMgmtReportFormat table using the following method:
PrintMgmtReportFormat::findSystem(this.getPrintMgmtDocumentType()).Name);
The controller class has a method "runPrintMgmt" which is responsible for defaulting the system report. In this method, the class object FormLetterReport does the actual job for calling and assigning system report with printer setting.
formLetterReport.loadPrintSettings(custQuotationJour, custQuotationJour.salesQuotationTable(), this.quoteLanguageId());
So here my code goes. I write a method and call this after the above line of code in the controller class. This custom method basically initializes the PrintMgmtPrintSettingDetail object and conditionally, I am passing my custom report design. In this way, it overrides the print setting with my new report design.
void customPrintSettings()
{
PrintMgmtDocInstanceType type;
PrintMgmtPrintSettingDetail printSettingDetail = new
PrintMgmtPrintSettingDetail();
SRSPrintDestinationSettings defaultSettings =
formLetterReport.parmReportRun().parmDefaultOriginalPrintJobSettings();
PrintMgmtReportFormatName reportFormatName =
ssrsReportStr(PSAQuotations, CustomReportSG); //Passing custom report design
if (formLetterReport.parmPrintType() == PrintCopyOriginal::Original)
{
type = PrintMgmtDocInstanceType::Original;
}
if (formLetterReport.parmPrintType() == PrintCopyOriginal::Copy)
{
type = PrintMgmtDocInstanceType::Copy;
}
printSettingDetail.parmReportFormatName(reportFormatName);
printSettingDetail.parmType(type);
printSettingDetail.parmInstanceName(enum2str(type));
// Since this will be reported to the screen, one copy is the only thing that makes sense
printSettingDetail.parmNumberOfCopies(1);
printSettingDetail.parmPrintJobSettings(defaultSettings);
if (!formLetterReport.parmUseUserDefinedDestinations())
{
printSettingDetail.parmPrintJobSettings().printMediumType(
SRSPrintMediumType::Screen);
}
formLetterReport.parmReportRun().loadSettingDetail(printSettingDetail);
}
Cheers !!!
Showing posts with label MS SQL. Show all posts
Showing posts with label MS SQL. Show all posts
Thursday, November 27, 2014
Wednesday, August 24, 2011
How to access MS SQL server 2008 default instance or named instance from SQL query analyser.
Step -1:
1. Go to MS SQL Server 2008 Configuration Manager.
2. Extends SQL server network configuration.
3. Select protocol for named instance.
4. Enable TCP/IP protocol
5. Double click on TCP/IP protocol or right click to open property window.
6. In property windows, go to “IP Addresses” tab page
7. Go to node – IP ALL
8. Note down TCP Dynamic Ports number.
Step -2:
1. Open MS SQL query analyser.
2. Enter SQL server details. For login to default instance, just type IP address of the server where MS SQL 2008 is installed. You can also specify default port number associated with default MS SQL instance like. The default port number 1433. For named instance, specify the named instance dynamic port number with SQL server IP address.
E.g. <137.40.68,56989>.
3. Enter user name and password to access the server.
1. Go to MS SQL Server 2008 Configuration Manager.
2. Extends SQL server network configuration.
3. Select protocol for named instance.
4. Enable TCP/IP protocol
5. Double click on TCP/IP protocol or right click to open property window.
6. In property windows, go to “IP Addresses” tab page
7. Go to node – IP ALL
8. Note down TCP Dynamic Ports number.
Step -2:
1. Open MS SQL query analyser.
2. Enter SQL server details. For login to default instance, just type IP address of the server where MS SQL 2008 is installed. You can also specify default port number associated with default MS SQL instance like
E.g. <137.40.68,56989>.
3. Enter user name and password to access the server.
Subscribe to:
Posts (Atom)

