CS0103 Error

Stimulsoft Reports.WEB discussion
eric_stimulsoft
Posts: 25
Joined: Tue Feb 25, 2014 5:14 am
Location: Jupiter

CS0103 Error

Post by eric_stimulsoft »

Good Day!

I'm using Q3 release of Stimulsoft MVC/Web. And I tried to add a parameter to my report. But whenever I try to reload the report with the parameter I always get this error:
Stimulsoft Filter Error.PNG
Stimulsoft Filter Error.PNG (11.87 KiB) Viewed 5268 times
I've implemented a custom filter that enables user to type a value that they want to use as a filter. In this case ASY was the filter value.


Thanks.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: CS0103 Error

Post by HighAley »

Hello.

How did you add this parameter?
How do you set the value of this parameter?
Please, try to set the type of Filter to expression and write your expression there.

Thank you.
eric_stimulsoft
Posts: 25
Joined: Tue Feb 25, 2014 5:14 am
Location: Jupiter

Re: CS0103 Error

Post by eric_stimulsoft »

I programmatically set the value then add the parameter using c#.NET.
I also set its data type and size based on what I've used in SQL table.

I tried to use Expression as the type of filter but still, it redirects me to this error.

But when I use integers as my filter, the report loads with the data I needed.
And every time I use filters that requires string value this error persists.

Thanks.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: CS0103 Error

Post by HighAley »

Hello.

Please, send us sample project which reproduces your issue for analysis.

Thank you.
eric_stimulsoft
Posts: 25
Joined: Tue Feb 25, 2014 5:14 am
Location: Jupiter

Re: CS0103 Error

Post by eric_stimulsoft »

Reports Sample.zip
(3.61 KiB) Downloaded 527 times
Above is the sample mrt file and sample database query file (for SQL Server).

By the way, before we upgraded to Q3 2013 release we were using Q1 2013 release and it's working.

We just upgraded because we were about to buy your product but there are some other bugs encountered after the update and one of these bug is this CS0103 Error, and we're still fixing these bugs before we buy a license so that we are sure that there won't be any problem when we buy your license.

Hopefully we can fix these bugs as soon as possible.

Thanks.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: CS0103 Error

Post by HighAley »

Hello.

You wrote ASY in the expression of the SQL query parameter.
This expression cause the error.
asy.png
asy.png (23.46 KiB) Viewed 5250 times
Thank you.
eric_stimulsoft
Posts: 25
Joined: Tue Feb 25, 2014 5:14 am
Location: Jupiter

Re: CS0103 Error

Post by eric_stimulsoft »

Hi, I've tried changing expression from ASY to ToString("ASY") and it worked.

I checked profiler and it executed this:

exec sp_reset_connection

Code: Select all

go
declare @p1 int
set @p1=-1
exec sp_prepexec @p1 output,N'@a_um_abbreviation nvarchar(6)',N'select * from tb_measure AS a
WHERE a.um_abbreviation = @a_um_abbreviation',@a_um_abbreviation=N'ASY'
select @p1
go
But in my case I add parameters programmatically. And when I put value to StiDataParameter.Expression and it executed this one:

Code: Select all

declare @p1 int
set @p1=1
exec sp_prepexec @p1 output,N'@a_um_abbreviation nvarchar(8)',N'SELECT a.um_id, a.um_description,
          a.um_abbreviation
          FROM u_unit_of_measure AS a WITH (NOLOCK) 
          WHERE a.[um_abbreviation] = @a_um_abbreviation',@a_um_abbreviation=N'ToString'
select @p1
Is there any sample code that I can use as a pattern for adding Parameters with Expressions?

Thanks.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: CS0103 Error

Post by Alex K. »

Hello,

Please try to simplify your solution. Try to use the variables or parameters only.

Thank you.
eric_stimulsoft
Posts: 25
Joined: Tue Feb 25, 2014 5:14 am
Location: Jupiter

Re: CS0103 Error

Post by eric_stimulsoft »

Hi,

Is there any changes that I need to apply in adding variables/parameters for it to work?

Because in Q1 2013 version it works. but after I used Q3 2013 version the error showed up.

Thanks.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: CS0103 Error

Post by Alex K. »

Hello,

Please try to set the Size property for the parameter.

Thank you.
Attachments
Capture.png
Capture.png (52.99 KiB) Viewed 5233 times
Post Reply