Changing report design via code SSRS – Print Management

  • Added a new design in report on SSRS and redeployed report
  • Override method OutputReport on report controller class, with code as under
  • Wrote following code for testing
protected void outputReport()
{
SRSCatalogItemName          reportDesign;
Dialog                      smcdialog;
DialogField                 dfNewDesign;
NoYesId                     getDecision = NoYes::No;

;

smcdialog = new Dialog('Test dialog');
dfNewDesign =  smcdialog.addField(extendedTypeStr(NoYesId),"Should i run new design??? Mark me if you want so, elase leave me as it is.");
    
if(smcdialog.run())
{
    getDecision = dfNewDesign.value();
}

if(getDecision == NoYes::Yes)
{
    reportDesign = 'SalesPackingSlip.NewDesign1';
}
else
{
    reportDesign = this.parmReportName();
}
    
this.parmReportName(reportDesign);
this.parmReportContract().parmReportName(reportDesign);

formLetterReport.parmReportRun().settingDetail().parmReportFormatName(reportDesign);
    
super();
    
}
  • Generated incremental CIL
  • Run testing

    It worked perfectly

    Despite of all the discussion and providing step by step, if you cannot do it, sorry I cannot help you anymore. There is another option to contact Microsoft support. You may opt for that.


Link 2:

It is one of the normal development requirements you may came across where you want to change the report design name on the basis of some logic. The following example shows you how to achieve this.

The modification is done in Controller class “outputReport” method, before “super” call you need to set the updated design name based on some condition and its done.

/// <summary>
///    Executes the report for the print management setting that is currently loaded.
/// </summary>
/// <remarks>
///    The <c>outReports</c> method loops over print management settings and calls this method for each
///    print management setting loaded.
/// </remarks>
/// <exception cref=”M:Exception::Error”>
///    The print management object has not been initialized.
/// </exception>
public void outputReport()
{
reportDesign = ‘MyReport.Report_DesignA’;
this.parmReportName(reportDesign);
this.parmReportContract().parmReportName(reportDesign);
formLetterReport.parmReportRun().settingDetail().parmReportFormatName(reportDesign);
super();
}


Link 3:

Use the following code in outputReport() method in your controller class.

public void outputReport()

{

reportDesign = ‘MyReport.Report_DesignA’;

this.parmReportName(reportDesign);

this.parmReportContract().parmReportName(reportDesign);

formLetterReport.parmReportRun().settingDetail().parmReportFormatName(reportDesign);

super();

}

For details please check out the following link:

thinkinginax.blogspot.com/…/changing-report-design-via-code-ssrs.html

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s