.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Melody Anderson
Eminent IT
Sandeep Singh

Home >> Forum >> VB.Net >> Post New QuestionBookmark and Share Subscribe to Forum

How to set parameters of crystal reports in vb.net

Posted By: Raymond     Posted Date: May 27, 2011    Points:5   Category :VB.Net
Dear all,

I am using below code. But find it does not work??

Dim rd As New ReportDocument
rd.Load(Path + "\Reports\StockTakeException.rpt")
rd.SetParameterValue("Printed By", printedby)
rd.SetParameterValue("frmLoc", fromLoc)
rd.SetParameterValue("toLoc", toLoc)


rd.PrintOptions.PrinterName = LaserPrinter
rd.PrintToPrinter(1, False, 0, 0) // throw exception here : Missing Parameters

Author: Sunil Yadav       [Moderator]      
Posted Date: May 27, 2011     Points: 20   
Author: Ravi Ranjan Kumar             
Posted Date: May 30, 2011     Points: 20   

Try to get PrinterName properly as
Dim instance As PrinterSettings
Dim value As String
value = instance.PrinterName
instance.PrinterName = value
and then try to pass this value as
rd.PrintOptions.PrinterName = LaserPrinter

and to pass Crystal Report Parameters Programmatically take a look at given link

Thanks & Regards
Ravi Ranjan Kumar

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend