question

krishna-5407 avatar image
0 Votes"
krishna-5407 asked krishna-5407 commented

How to pass parameters from VB.NET To SSRS Report without using Report.SetParameters()

I have an SSRS report with english and arabic content ,i convert the report in VB.NET to stream of bytes and then send it to printer to print report ,without using report viewer.When i pass parameters from vb.net to ssrs using Report.SetParameters() the arabic content in the report reverses in some cases and it behaves abnormally (some letters in few words are reversed ,some are in correct order.Some words are reversed completely).The report prints correctly if i use report viewer and click on view report and print the report and it works fine on the report server however when i use VB.NET and pass parameters to SSRS the arabic content coming from database (AS400) behaves abnormally.I wanted to know if there is a way to pass parameters without using ReportViewer.SetParameters()

What i tried and why i came to this conclusion 1)I manually set parameters IN ssrs report with values ,and printed the report from vb.net application and didnt pass any parameters from VB.NET To SRRS .Report was printing correctly

2)I ran the report in report server in browser and passed the parameters in query string and the arabic content was printing correctly on report server .

 rptPrinting.ServerReport.ReportPath = http://ServerName/ReportServer/UT
 %20Documents/VHRSSALEPDU001&prsFRANCHISE=W&prsBRAN=00150&prsDEPT=10&prsPRNO=38578&prsCopy=Test&prsBanner=Y" 

i also tried setting

 report.ReportServerUrl = New System.Uri("http://ServerName/ReportServer?/UT+Documents/VHRSSALEPDU001&prsFRANCHISE=W&prsBRAN=00150&prsDEPT=10&prsPRNO=38578&prsCopy=Test&prsBanner=Y")

I wanted to know if there is some way other than Report.SetParameters() to send parameters like through query string from VB.NET to SSRS .So that i dont get the abnormal behaviour with arabic content .

My code where i pass parameters

 report.ReportServerUrl = New System.Uri(ldtReportParameter.Rows(0).Item("RMREPTSERV").ToString.Trim)
         report.ReportPath = ldtReportParameter.Rows(0).Item("RMREPTPATH").ToString.Trim
    
             laIndividualParameters(0) = New ReportParameter("prsFRANCHISE", row.Cells(4).Text.ToString().Trim(), False)
             laIndividualParameters(1) = New ReportParameter("prsBRAN", row.Cells(5).Text.ToString().Trim(), False)
             laIndividualParameters(2) = New ReportParameter("prsDEPT", row.Cells(6).Text.ToString().Trim(), False)
             laIndividualParameters(3) = New ReportParameter("prsPRNO", row.Cells(3).Text.ToString().Trim(), False)
             laIndividualParameters(4) = New ReportParameter("prsCopy", row.Cells(2).Text.ToString().Trim(), False)
             laIndividualParameters(5) = New ReportParameter("prsBanner", row.Cells(7).Text.ToString().Trim(), False)
    
              report.SetParameters(laIndividualParameters)
             ServerExport(report)//Function to convert report to stream of bytes and send to printer


When i copy paste this url directly in broswer i am getting the report
http://ServerName/ReportServer?/UT+Documents/VHRSSALEPDU001&prsFRANCHISE=W&prsBRAN=00150&prsDEPT=10&prsPRNO=38578&prsCopy=Test&prsBanner=Y



sql-server-reporting-services
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

LukasYu-msft avatar image
0 Votes"
LukasYu-msft answered krishna-5407 commented

How have you used VB.NET to render or print the report ? From my limited experience, I have not seen any official support of this particular approach. I doubt this is not officially supported, we would normally suggest developers to use Report Viewer. Also we don't have much experience with arabic content, sorry we cannot replicate your issue.
If you find this issue really bothering, I would suggest you to open ticket with microsoft. The engineer there could have more experience of this kind of issue or can use remote desktop or email to understand your issue better.

Lukas

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,
I followed this link https://docs.microsoft.com/en-us/previous-versions/ms252091(v=vs.140)?redirectedfrom=MSDN to print SSRS report with out print preview .We contacted Microsoft support and had some calls ,but they said it is not an issue with SSRS and there is no support for .NET code from their side.

0 Votes 0 ·