I have set up some (three to be exact) parameters in a report that I want to
be able to print. Before I set the parameters everything worked just fine. I
set the datasource and the printout worked great. Now I add parameters to the
report and it seems that no matter what I do, I get an exception indicating
that I have not set the parameters. Here is the latest try (this is Winform
code):
Dim rpt As New QuoteDetail
Dim disVal As New CrystalDecisions.Shared.ParameterDiscreteValue()
disVal.Value = "Net 30"
rpt.Parameter_Terms.CurrentValues.Add(disVal)
disVal = New CrystalDecisions.Shared.ParameterDiscreteValue()
disVal.Value = q.FileName
rpt.Parameter_QuoteFile.CurrentValues.Add(disVal)
disVal = New CrystalDecisions.Shared.ParameterDiscreteValue()
disVal.Value = "Me"
rpt.Parameter_PreparerName.CurrentValues.Add(disVal)
rpt.SetDataSource(ds)
rpt.PrintToPrinter(1, False, 0, 0)
rpt.Dispose()
One interesting thing that I learned from several sessions in the debugger.
Before the SetDataSource there are current values for each of the parameters.
After the call to SetDataSource it seems that the current values go away.
I would like to just be able to set values for these parameters and print,
like a function call. Any suggestions on what I am doing wrong?
Thank you.
KevinThis forum is for Reporting Services, the reporting product from MS that
competes with Crystal. I know Crystal is still bundled with VS. I would
suggest a Visual Studio newsgroup. Not really sure where the best place is
for you to go for an answer.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Kevin Burton" <KevinBurton@.discussions.microsoft.com> wrote in message
news:F3EA2C93-0DB0-4CB4-9A65-815EBAD105C4@.microsoft.com...
>I have set up some (three to be exact) parameters in a report that I want
>to
> be able to print. Before I set the parameters everything worked just fine.
> I
> set the datasource and the printout worked great. Now I add parameters to
> the
> report and it seems that no matter what I do, I get an exception
> indicating
> that I have not set the parameters. Here is the latest try (this is
> Winform
> code):
> Dim rpt As New QuoteDetail
> Dim disVal As New
> CrystalDecisions.Shared.ParameterDiscreteValue()
> disVal.Value = "Net 30"
> rpt.Parameter_Terms.CurrentValues.Add(disVal)
> disVal = New CrystalDecisions.Shared.ParameterDiscreteValue()
> disVal.Value = q.FileName
> rpt.Parameter_QuoteFile.CurrentValues.Add(disVal)
> disVal = New CrystalDecisions.Shared.ParameterDiscreteValue()
> disVal.Value = "Me"
> rpt.Parameter_PreparerName.CurrentValues.Add(disVal)
> rpt.SetDataSource(ds)
> rpt.PrintToPrinter(1, False, 0, 0)
> rpt.Dispose()
> One interesting thing that I learned from several sessions in the
> debugger.
> Before the SetDataSource there are current values for each of the
> parameters.
> After the call to SetDataSource it seems that the current values go away.
> I would like to just be able to set values for these parameters and print,
> like a function call. Any suggestions on what I am doing wrong?
> Thank you.
>
> Kevin
No comments:
Post a Comment