Open a crystal report with Response.write-> with a number RRS feed

  • Question

  • User-1578974752 posted

    Dim disk As DiskFileDestinationOptions = New DiskFileDestinationOptions()

    disk.DiskFileName = String.Format("C:\inetpub\wwwroot\ABC\ABC\Reports\ADV\ADVReport{0}.pdf", Convert.ToString(Bsearch.Text))

    exp.ExportDestinationOptions = disk

    exp.ExportFormatOptions = New PdfRtfWordFormatOptions()


    Here I can ,insert the report in to the above folder with number ADVReportReport145678

    I want to write the report on clicking button.Below append header is showing correctly but how can I open ADVReportReport145678 (The number is from the textbox ie Bsearch.Text)

     Dim filePath As String

            Response.AppendHeader("Content-Disposition", ("attachment; filename=" + Path.GetFileName(String.Format("C:\inetpub\wwwroot\ABC\ABC\Reports\ADV\ADVReport.pdf", Convert.ToString(Bsearch.Text)))))


    What to type inside Response.WriteFile()  . Appreciate the Help

    Thursday, January 17, 2019 3:31 AM


  • User-893317190 posted

    Hi shsu,

    If you are sure  there is a pdf file: C:\inetpub\wwwroot\ABC\ABC\Reports\ADV\ADVReport145678.pdf , you should write  C:\inetpub\wwwroot\ABC\ABC\Reports\ADV\ADVReport145678.pdf in Response.WriteFile().

    in your code , you could write

    Response.WriteFile(String.Format("C:\inetpub\wwwroot\ABC\ABC\Reports\ADV\ADVReport{0}.pdf", Convert.ToString(Bsearch.Text))

    Best regards,

    Ackerly Xu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 17, 2019 5:56 AM