Generate SSRS report PDF file automatically in AX 2009

static void Jinn_GeneralSSRSPDFByCode(Args _args)
{
    System.Net.WebRequest       request;
    System.Net.WebResponse      response;
    System.IO.Stream            stream;
    System.IO.FileStream        fileStream;
    System.Byte[]               buffer = new System.Byte[1024]();

    str                         m_URL      = @"http://******/ReportServer/Pages/ReportViewer.aspx?%2fDynamics

%2fCustSalesOrderReportSRS.CustSalesConfirmSRS.RDS&rs:Command=Render&rs:Format=pdf";
    str                         m_FileName = @"\\****\MailAttachment\SalesConfirmation.pdf";
    int                         m_ByteRead;
    ;

    request = System.Net.WebRequest::Create(m_URL);
    request.set_Credentials(System.Net.CredentialCache::get_DefaultNetworkCredentials());

    response = request.GetResponse();
    stream   = response.GetResponseStream();

    fileStream = new System.IO.FileStream(m_FileName, System.IO.FileMode::Create);

    m_ByteRead = stream.Read(buffer, 0, buffer.get_Length());
    while (m_ByteRead)
    {
        fileStream.Write(buffer, 0, m_ByteRead);

        m_ByteRead = stream.Read(buffer, 0, buffer.get_Length());
    }

    fileStream.Close();
}

  

时间: 2024-10-29 05:06:45

Generate SSRS report PDF file automatically in AX 2009的相关文章

How to get a datatable from AX to SSRS report

We can easily get a datatable from AX to SSRS report. All the business logic can be written in AX, and the SSRS is the data showing platform. [DataMethod(), AxSessionPermission(SecurityAction.Assert)] public static DataTable GetData(string _PurchaseO

AX SSRS report data helper

While we develop a ax ssrs report often using 'Business Logic' rather than 'AX Queries'. The 'Business Logic' is base on a AX class, there is a static method return a data type as 'System.Data.DataTable'.  While using the 'DataTable' type, we need to

Upgrading AX 2009 SSRS Report To AX 2012 SSRS Report

In AX 2012, the old SSRS reports for AX 2009 is stored in the AOT node "Report Libraries". We can find it all in the view 'Application Explorer' of visual studio,  but we can't modify it as usual. Refer to the MSDN's essay, if we want to modify

Deploy SSRS Report In AX 2012

1.The SSRS report has only one design: Use the menuitem of 'Output', select the object type 'SSRSReport' and assign the right SSRS report name and design. 2.The SSRS report has mutiple designs: Create a new class extending the class 'SrsReportRunCont

How to deploy SSRS report from AX

To deploy reports from within Microsoft Dynamics AX 1.In the AOT, expand the Report Libraries node. 2.Right-click the report library that you want to deploy, and then click Deploy. This launches the deployment utility. 3.In the dialog box, select any

Dynamics AX 2012 R2 从代码中调用SSRS Report

    平时,我们制作SSRS Report的方法主要有两种:使用Query或RDP.如果需要为报表传递参数,就要在代码中为报表参数赋值,然后在代码中调用报表.下面我总结下这两种报表在代码中传参和调用的方式: 1.使用Query作为报表数据源 1.1.Dynamic Filters属性     在VS中,需要注意Report DataSource的Dynamic Filters属性. 1.1.1.如果Dynamic Filters属性为True的话,会在Report Parameter中生成一个

Freebie - Utility Form: Generate Excel Report From SQL Query In Oracle Forms 6i And 11g

Sharing a form to generate Excel file report from SQL query in Oracle Forms. This form can be used in Oracle Forms 6i and 10g / 11g. Below is the screen shot of this form and could be download from the following link: Excel_Rep.Fmb A procedure Create

Displaying East Asian Characters in Report PDF Output

http://community.jaspersoft.com/wiki/displaying-east-asian-characters-report-pdf-output In order to correctly display East Asian Characters such as Chinese and Japanese in report PDF output, user needs to make sure: Use a font type that is capable of

Report processing of Microsoft Dynamic AX

Report processing of Microsoft Dynamic AX The implementation of a general electronic report usually has four classes. Contract: Comment: Contract class is data contract class for SSRS report . Intent: Gets or sets the value of the data contract param