"Chris" <no@spam.com> wrote in message
news:Ow*************@TK2MSFTNGP14.phx.gbl...
Chubbly Geezer wrote: Now I've done this before but can't remember how.
I want to pass a string into a procedure and then use that string in a
Dim statement.
i.e.
Public Function PrintReports(ByVal strDel As String, ByVal strSQL As
String, ByVal strSelect As String, ByVal ReportName As Object) As Integer
Dim myReport As CrystalDecisions.CrystalReports.Engine.ReportDocum ent =
ReportName
But I am getting a conversion error in that I cannot convert a string to
this object type.
Any ideas please.?
Chubbly
You can not convert a string to a ReportDocument. Now in your function
you are passing an object. What type is this object you are passing in.
Where is your Report stored? Is it a file or an embedded resource?
Chris
I am passing in a string (was initially declared as a string) which equates
to the report name of rhe report that I want to run. i.e. StandardStatement
This relates to StandardStatement.rpt which is a crystal report which has
been created and resides in my VB 2005 app.
I realise that I can not convert a string to a ReportDocument but do not
know how to use the strings value the way I want.
I am trying to execute a line as below:
Dim myReport As CrystalDecisions.CrystalReports.Engine.ReportDocum ent =
StandardStatement
I previously used
Dim myReport As StandardStatement
but now find I need to pass in the report name.
Thanks
Chubbly