Hi all,
I have a report localized in many languages and it works well when I request the contents from a report viewer and I set the threat to match the report's localized language.
Now, I would like to download the report without having to change the current threat or using the report viewer. The code below generates the PDF file directly and presents the document ready for download to the browser, this is what I would like to have but I cannot get it translated. I was trying to use the report parameters with the report's code behind to set the language in the report but unfortunately the report must be initialized before I can work with the parameters.
Is that possible?
The code looks like this:
I have a report localized in many languages and it works well when I request the contents from a report viewer and I set the threat to match the report's localized language.
Now, I would like to download the report without having to change the current threat or using the report viewer. The code below generates the PDF file directly and presents the document ready for download to the browser, this is what I would like to have but I cannot get it translated. I was trying to use the report parameters with the report's code behind to set the language in the report but unfortunately the report must be initialized before I can work with the parameters.
Is that possible?
The code looks like this:
Dim instanceReportSource As New Telerik.Reporting.InstanceReportSource()
instanceReportSource.ReportDocument = New Reporting_Service.doc_PO_ShippingInstructions
instanceReportSource.Parameters.Add(New Telerik.Reporting.Parameter("Id", 31))
instanceReportSource.Parameters.Add(New Telerik.Reporting.Parameter("LanguageID", 1))
Dim reportProcessor As New ReportProcessor()
Dim result As RenderingResult = reportProcessor.RenderReport("PDF", instanceReportSource, Nothing)
Dim fileName As String = result.DocumentName + ".pdf"
Response.Clear()
Response.ContentType = result.MimeType
Response.Cache.SetCacheability(HttpCacheability.Private)
Response.Expires = -1
Response.Buffer = True
Response.AddHeader("Content-Disposition", String.Format("{0};FileName=""{1}""", "attachment", fileName))
Response.BinaryWrite(result.DocumentBytes)
Response.End()