Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

SSRS report to PDF error

Posted on by 715

HI,

I get below error when I try to save a SSRS report as a file in AX365 on a click with the below code.

Please help me out!!

[FormControlEventHandler(formControlStr(InventQualityOrderTable, ExportToPdf), FormControlEventType::Clicked)]
public static void ExportToPdf_OnClicked(FormControl sender, FormControlEventArgs e)
{
FormRun fr = sender.formRun();
FormDataSource fds = fr.dataSource(formDataSourceStr(InventQualityOrderTable, InventQualityOrderTable));
InventQualityOrderTable inventQualityOrderTable = fds.cursor();
SrsReportRunController controller = new SrsReportRunController();
SRSPrintDestinationSettings srsPrintDestinationSettings;
Args args = new Args();

args.record(inventQualityOrderTable);

controller.parmReportName(ssrsReportStr(XX_InventQualityOrder,QualityOrder));
controller.parmArgs(args);

srsPrintDestinationSettings = controller.parmReportContract().parmPrintSettings();
srsPrintDestinationSettings.printMediumType(SRSPrintMediumType::File);

srsPrintDestinationSettings.fileFormat(SRSReportFileFormat::PDF);
srsPrintDestinationSettings.overwriteFile(true);
srsPrintDestinationSettings.fileName(@"C:\InventQualityOrder.pdf");

controller.parmShowDialog(false);

controller.startOperation();

}

Unable to connect to the remote server at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext) at Microsoft.WindowsAzure.Storage.Table.CloudTable.Exists(Boolean primaryOnly, TableRequestOptions requestOptions, OperationContext operationContext) at Microsoft.WindowsAzure.Storage.Table.CloudTable.CreateIfNotExists(TableRequestOptions requestOptions, OperationContext operationContext) at Microsoft.DynamicsOnline.Infrastructure.Components.TableAccessor.TableStorageAccessor.PerformOperation(CloudStorageAccount storageAccount, String tableName, Func`1 operation) at Microsoft.DynamicsOnline.Infrastructure.Components.TableAccessor.TableStorageAccessor.AddRecord[T](CloudStorageAccount storageAccount, String tableName, T record) at Microsoft.DynamicsOnline.Infrastructure.Components.SharedServiceUnitStorage.SharedServiceUnitStorage.UploadData(SharedServiceUnitStorageData data, Stream stream) at Dynamics.AX.Application.SRSFileUploadTempStorageStrategy.completeUpload(Boolean _blobAlreadyExists, String _uniqueFileName, String _originalFilename, String _fileId, Stream _stream, String _contentType, Boolean @_contentType_IsDefaultSet) in xppSource://Source/ApplicationFoundation\AxClass_SRSFileUploadTempStorageStrategy.xpp:line 177

*This post is locked for comments

  • Pradeep_Prakash Profile Picture
    Pradeep_Prakash 715 on at
    RE: SSRS report to PDF error

    Thanks Ievgen. Now I understand.

  • Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: SSRS report to PDF error

    Simplest way to find this out is to try, but it has nothing to do with your laptop it uses Azure Emulator installed on the VM and it does not matter where you are connecting from.

  • Pradeep_Prakash Profile Picture
    Pradeep_Prakash 715 on at
    RE: SSRS report to PDF error

    Hi,

    It works fine in my machine since I’m running azure emulator.

    If I try to do the same operation on an azure hosted machine connected from a different laptop where my azure emulator is not running.

    I would get an error right? How should I handle in this case?

    Regards,

    Pradeep

  • Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: SSRS report to PDF error

    You don't need to an approach, it should just work. Do you have same issue with Tier 1 or Tier 2 VM ?

  • Pradeep_Prakash Profile Picture
    Pradeep_Prakash 715 on at
    RE: SSRS report to PDF error

    Thanks Ievgen.

    What should be my approach for an Azure hosted machine? 

    Regards,

    Pradeep

  • Verified answer
    Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: SSRS report to PDF error

    Hi Pradeep Prakash,

    If you use dev VM check that Azure Storage Emulator is running.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans