Wednesday, March 28, 2012
Passing Multiple GUIDs
contacts.
SELECT ContactExtensionBase.ContactId, ContactBase.LastName,
FROM ContactExtensionBase INNER JOIN
ContactBase ON ContactExtensionBase.ContactId = ContactBase.ContactId
WHERE (ContactBase.ContactId = @.cid)
where @.cid is the guid's
But with it like this i can't pass more than one guid into the
statement.Try using the "IN" clause so your WHERE statement looks like:
WHERE ContactBase.ContactId IN(@.cid)
If your parameter is set to accept multiple values then this will retrun ALL
values you select.
Michael
"flowk1337@.gmail.com" wrote:
> Trying to build a report that will return information on many
> contacts.
> SELECT ContactExtensionBase.ContactId, ContactBase.LastName,
> FROM ContactExtensionBase INNER JOIN
> ContactBase ON ContactExtensionBase.ContactId => ContactBase.ContactId
> WHERE (ContactBase.ContactId = @.cid)
>
> where @.cid is the guid's
>
> But with it like this i can't pass more than one guid into the
> statement.
>|||On Apr 27, 4:02 pm, Michael C <Michael C...@.discussions.microsoft.com>
wrote:
> Try using the "IN" clause so your WHERE statement looks like:
> WHERE ContactBase.ContactId IN(@.cid)
> If your parameter is set to accept multiple values then this will retrun ALL
> values you select.
> Michael
>
> "flowk1...@.gmail.com" wrote:
> > Trying to build a report that will return information on many
> > contacts.
> > SELECT ContactExtensionBase.ContactId, ContactBase.LastName,
> > FROM ContactExtensionBase INNER JOIN
> > ContactBase ON ContactExtensionBase.ContactId => > ContactBase.ContactId
> > WHERE (ContactBase.ContactId = @.cid)
> > where @.cid is the guid's
> > But with it like this i can't pass more than one guid into the
> > statement.- Hide quoted text -
> - Show quoted text -
I've already tried that actually. It gives an error that a I can't
convert from a guid to a string.|||Is the convertion error a matter of Collation? If so you may want to try and
COLLATE your join statement. I just can't see why a guid couldn't convert to
a string.
INNER JOIN
ContactBase ON ContactExtensionBase.ContactId COLLATE
SQL_Latin1_General_CP1_CI_AS = ContactBase.ContactId
have you tried to CAST or CONVERT the guid?
"flowk1337@.gmail.com" wrote:
> On Apr 27, 4:02 pm, Michael C <Michael C...@.discussions.microsoft.com>
> wrote:
> > Try using the "IN" clause so your WHERE statement looks like:
> >
> > WHERE ContactBase.ContactId IN(@.cid)
> >
> > If your parameter is set to accept multiple values then this will retrun ALL
> > values you select.
> >
> > Michael
> >
> >
> >
> > "flowk1...@.gmail.com" wrote:
> > > Trying to build a report that will return information on many
> > > contacts.
> >
> > > SELECT ContactExtensionBase.ContactId, ContactBase.LastName,
> > > FROM ContactExtensionBase INNER JOIN
> > > ContactBase ON ContactExtensionBase.ContactId => > > ContactBase.ContactId
> > > WHERE (ContactBase.ContactId = @.cid)
> >
> > > where @.cid is the guid's
> >
> > > But with it like this i can't pass more than one guid into the
> > > statement.- Hide quoted text -
> >
> > - Show quoted text -
> I've already tried that actually. It gives an error that a I can't
> convert from a guid to a string.
>|||On Apr 27, 5:56 pm, Michael C <Micha...@.discussions.microsoft.com>
wrote:
> Is the convertion error a matter of Collation? If so you may want to try and
> COLLATE your join statement. I just can't see why a guid couldn't convert to
> a string.
> INNER JOIN
> ContactBase ON ContactExtensionBase.ContactId COLLATE
> SQL_Latin1_General_CP1_CI_AS => ContactBase.ContactId
> have you tried to CAST or CONVERT the guid?
>
> "flowk1...@.gmail.com" wrote:
> > On Apr 27, 4:02 pm, Michael C <Michael C...@.discussions.microsoft.com>
> > wrote:
> > > Try using the "IN" clause so your WHERE statement looks like:
> > > WHERE ContactBase.ContactId IN(@.cid)
> > > If your parameter is set to accept multiple values then this will retrun ALL
> > > values you select.
> > > Michael
> > > "flowk1...@.gmail.com" wrote:
> > > > Trying to build a report that will return information on many
> > > > contacts.
> > > > SELECT ContactExtensionBase.ContactId, ContactBase.LastName,
> > > > FROM ContactExtensionBase INNER JOIN
> > > > ContactBase ON ContactExtensionBase.ContactId => > > > ContactBase.ContactId
> > > > WHERE (ContactBase.ContactId = @.cid)
> > > > where @.cid is the guid's
> > > > But with it like this i can't pass more than one guid into the
> > > > statement.- Hide quoted text -
> > > - Show quoted text -
> > I've already tried that actually. It gives an error that a I can't
> > convert from a guid to a string.- Hide quoted text -
> - Show quoted text -
I found out how to fix my problem. Thanks for your help Michael.
I created a stored procedure with the following:
DECLARE @.GUIDV VARCHAR(7000)
SELECT @.GUIDV = '''' + REPLACE(@.GUIDS , ',', '''' + ',' + '''')
+ ''''
EXECUTE('SELECT ContactExtensionBase.ContactId,
ContactExtensionBase.New_DLNumber, ContactBase.LastName,
ContactBase.MiddleName, ContactBase.FirstName, ContactBase.BirthDate,
ContactBase.MobilePhone, ContactBase.Pager, ContactBase.Telephone1,
ContactBase.StateCode,ContactExtensionBase.New_ReferralName,
ContactBase.Telephone2, ContactBase.Telephone3 FROM
ContactExtensionBase INNER JOIN
ContactBase ON ContactExtensionBase.ContactId =ContactBase.ContactId WHERE ContactId IN (' + @.GUIDV + ')')
Friday, March 23, 2012
Passing dataset to ssrs
of data to SSRS at run time.
The work to build the dataset has to be done in my ASPX program. I figure I
could easily create a physical table containing the data at runtime with a
name made up of MyTable + Session number.
My SSRS report would have this exact table format defined but would not know
the table name.
Now I would like to find a way to dynamically pass the table name to SSRS
when I execute the report and find a way to modify the SQL in my SSRS report
when the parameter is received.
Is this feasible?
Thanks,
TTina,
Binding to datasets is not supported in version 1.0 so you need to write a
custom data extension to report off ADO.NET datasets or you can use mine
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=B8468707-56EF-4864-AC51-D83FC3273FE5.
In addition, you can use my AwReportViewer web control (extended version of
the HTML Viewer control) which makes generating reports on the server side
of a web app plus dataset binding easier (I hope). You can download it from
here
http://www.manning-sandbox.com/thread.jspa?threadID=10392&tstart=0
Please note that version 2005 of RS will include WinForm and ASP.NET
controls which will support binding to ADO.NET datasets.
--
Hope this helps.
---
Teo Lachev, MCSD, MCT
Author: "Microsoft Reporting Services in Action"
http://www.prologika.com
"Tina" <tinamseaburn@.removespamexcite.com> wrote in message
news:ObwTjOWgEHA.3932@.TK2MSFTNGP10.phx.gbl...
> I'm still seeking my holy grail to figure out a way to pass a dataset,
full
> of data to SSRS at run time.
> The work to build the dataset has to be done in my ASPX program. I figure
I
> could easily create a physical table containing the data at runtime with a
> name made up of MyTable + Session number.
> My SSRS report would have this exact table format defined but would not
know
> the table name.
> Now I would like to find a way to dynamically pass the table name to SSRS
> when I execute the report and find a way to modify the SQL in my SSRS
report
> when the parameter is received.
> Is this feasible?
> Thanks,
> T
>|||I've just posted a DPE this evening to
http://workspaces.gotdotnet.com/appworld that may help you or at least point
you in the right direction.
Regards
Toby
"Teo Lachev" <teo@.nospam.prologika.com> wrote in message
news:e2Sr6bWgEHA.1276@.TK2MSFTNGP09.phx.gbl...
> Tina,
> Binding to datasets is not supported in version 1.0 so you need to write a
> custom data extension to report off ADO.NET datasets or you can use mine
>
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=B8468707-56EF-4864-AC51-D83FC3273FE5.
> In addition, you can use my AwReportViewer web control (extended version
of
> the HTML Viewer control) which makes generating reports on the server side
> of a web app plus dataset binding easier (I hope). You can download it
from
> here
> http://www.manning-sandbox.com/thread.jspa?threadID=10392&tstart=0
> Please note that version 2005 of RS will include WinForm and ASP.NET
> controls which will support binding to ADO.NET datasets.
> --
> Hope this helps.
> ---
> Teo Lachev, MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> http://www.prologika.com
>
> "Tina" <tinamseaburn@.removespamexcite.com> wrote in message
> news:ObwTjOWgEHA.3932@.TK2MSFTNGP10.phx.gbl...
> > I'm still seeking my holy grail to figure out a way to pass a dataset,
> full
> > of data to SSRS at run time.
> >
> > The work to build the dataset has to be done in my ASPX program. I
figure
> I
> > could easily create a physical table containing the data at runtime with
a
> > name made up of MyTable + Session number.
> >
> > My SSRS report would have this exact table format defined but would not
> know
> > the table name.
> >
> > Now I would like to find a way to dynamically pass the table name to
SSRS
> > when I execute the report and find a way to modify the SQL in my SSRS
> report
> > when the parameter is received.
> >
> > Is this feasible?
> > Thanks,
> > T
> >
> >
>|||Teo,
Thanks for the quick help. I'll ramp up on data extentions and then look at
these links. Do you have any idea of how far off version 2005 of RS is?
thanks,
T
"Teo Lachev" <teo@.nospam.prologika.com> wrote in message
news:e2Sr6bWgEHA.1276@.TK2MSFTNGP09.phx.gbl...
> Tina,
> Binding to datasets is not supported in version 1.0 so you need to write a
> custom data extension to report off ADO.NET datasets or you can use mine
>
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=B8468707-56EF-4864-AC51-D83FC3273FE5.
> In addition, you can use my AwReportViewer web control (extended version
of
> the HTML Viewer control) which makes generating reports on the server side
> of a web app plus dataset binding easier (I hope). You can download it
from
> here
> http://www.manning-sandbox.com/thread.jspa?threadID=10392&tstart=0
> Please note that version 2005 of RS will include WinForm and ASP.NET
> controls which will support binding to ADO.NET datasets.
> --
> Hope this helps.
> ---
> Teo Lachev, MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> http://www.prologika.com
>
> "Tina" <tinamseaburn@.removespamexcite.com> wrote in message
> news:ObwTjOWgEHA.3932@.TK2MSFTNGP10.phx.gbl...
> > I'm still seeking my holy grail to figure out a way to pass a dataset,
> full
> > of data to SSRS at run time.
> >
> > The work to build the dataset has to be done in my ASPX program. I
figure
> I
> > could easily create a physical table containing the data at runtime with
a
> > name made up of MyTable + Session number.
> >
> > My SSRS report would have this exact table format defined but would not
> know
> > the table name.
> >
> > Now I would like to find a way to dynamically pass the table name to
SSRS
> > when I execute the report and find a way to modify the SQL in my SSRS
> report
> > when the parameter is received.
> >
> > Is this feasible?
> > Thanks,
> > T
> >
> >
>|||Tina,
I am sorry, but Microsoft will be in a better position to answer this
question.
--
Hope this helps.
---
Teo Lachev, MCSD, MCT
Author: "Microsoft Reporting Services in Action"
http://www.prologika.com
"Tina" <tinamseaburn@.removespamexcite.com> wrote in message
news:OnLF7JXgEHA.3632@.TK2MSFTNGP09.phx.gbl...
> Teo,
> Thanks for the quick help. I'll ramp up on data extentions and then look
at
> these links. Do you have any idea of how far off version 2005 of RS is?
> thanks,
> T
> "Teo Lachev" <teo@.nospam.prologika.com> wrote in message
> news:e2Sr6bWgEHA.1276@.TK2MSFTNGP09.phx.gbl...
> > Tina,
> >
> > Binding to datasets is not supported in version 1.0 so you need to write
a
> > custom data extension to report off ADO.NET datasets or you can use mine
> >
>
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=B8468707-56EF-4864-AC51-D83FC3273FE5.
> > In addition, you can use my AwReportViewer web control (extended version
> of
> > the HTML Viewer control) which makes generating reports on the server
side
> > of a web app plus dataset binding easier (I hope). You can download it
> from
> > here
> > http://www.manning-sandbox.com/thread.jspa?threadID=10392&tstart=0
> >
> > Please note that version 2005 of RS will include WinForm and ASP.NET
> > controls which will support binding to ADO.NET datasets.
> >
> > --
> > Hope this helps.
> >
> > ---
> > Teo Lachev, MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > http://www.prologika.com
> >
> >
> > "Tina" <tinamseaburn@.removespamexcite.com> wrote in message
> > news:ObwTjOWgEHA.3932@.TK2MSFTNGP10.phx.gbl...
> > > I'm still seeking my holy grail to figure out a way to pass a dataset,
> > full
> > > of data to SSRS at run time.
> > >
> > > The work to build the dataset has to be done in my ASPX program. I
> figure
> > I
> > > could easily create a physical table containing the data at runtime
with
> a
> > > name made up of MyTable + Session number.
> > >
> > > My SSRS report would have this exact table format defined but would
not
> > know
> > > the table name.
> > >
> > > Now I would like to find a way to dynamically pass the table name to
> SSRS
> > > when I execute the report and find a way to modify the SQL in my SSRS
> > report
> > > when the parameter is received.
> > >
> > > Is this feasible?
> > > Thanks,
> > > T
> > >
> > >
> >
> >
>|||Teo,
I'm going thru your documentation. I'm at "Setting the Report DataSource"
and am having some trouble.
I Deployed, and registered the dataset extension and adjusted the code
access security policy as per your instructions.
Upon running the query I was prompted for the parameter value of @.DataSource
where I entered the path to my dsResults.xsd. It displayed the button
columns but no fields on the left. Because there are no fields on the left,
I can't design the report.
What do you think might be wrong?
Thanks,
T
"Teo Lachev" <teo@.nospam.prologika.com> wrote in message
news:e2Sr6bWgEHA.1276@.TK2MSFTNGP09.phx.gbl...
> Tina,
> Binding to datasets is not supported in version 1.0 so you need to write a
> custom data extension to report off ADO.NET datasets or you can use mine
>
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=B8468707-56EF-4864-AC51-D83FC3273FE5.
> In addition, you can use my AwReportViewer web control (extended version
of
> the HTML Viewer control) which makes generating reports on the server side
> of a web app plus dataset binding easier (I hope). You can download it
from
> here
> http://www.manning-sandbox.com/thread.jspa?threadID=10392&tstart=0
> Please note that version 2005 of RS will include WinForm and ASP.NET
> controls which will support binding to ADO.NET datasets.
> --
> Hope this helps.
> ---
> Teo Lachev, MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> http://www.prologika.com
>
> "Tina" <tinamseaburn@.removespamexcite.com> wrote in message
> news:ObwTjOWgEHA.3932@.TK2MSFTNGP10.phx.gbl...
> > I'm still seeking my holy grail to figure out a way to pass a dataset,
> full
> > of data to SSRS at run time.
> >
> > The work to build the dataset has to be done in my ASPX program. I
figure
> I
> > could easily create a physical table containing the data at runtime with
a
> > name made up of MyTable + Session number.
> >
> > My SSRS report would have this exact table format defined but would not
> know
> > the table name.
> >
> > Now I would like to find a way to dynamically pass the table name to
SSRS
> > when I execute the report and find a way to modify the SQL in my SSRS
> report
> > when the parameter is received.
> >
> > Is this feasible?
> > Thanks,
> > T
> >
> >
>|||Tina,
Good job. Just hit the Refresh Fields toolbar button found on the Data tab.
--
Hope this helps.
---
Teo Lachev, MCSD, MCT
Author: "Microsoft Reporting Services in Action"
http://www.prologika.com
"Tina" <tinamseaburn@.removespamexcite.com> wrote in message
news:OLZsW1kgEHA.3016@.tk2msftngp13.phx.gbl...
> Teo,
> I'm going thru your documentation. I'm at "Setting the Report DataSource"
> and am having some trouble.
> I Deployed, and registered the dataset extension and adjusted the code
> access security policy as per your instructions.
> Upon running the query I was prompted for the parameter value of
@.DataSource
> where I entered the path to my dsResults.xsd. It displayed the button
> columns but no fields on the left. Because there are no fields on the
left,
> I can't design the report.
> What do you think might be wrong?
> Thanks,
> T
>
> "Teo Lachev" <teo@.nospam.prologika.com> wrote in message
> news:e2Sr6bWgEHA.1276@.TK2MSFTNGP09.phx.gbl...
> > Tina,
> >
> > Binding to datasets is not supported in version 1.0 so you need to write
a
> > custom data extension to report off ADO.NET datasets or you can use mine
> >
>
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=B8468707-56EF-4864-AC51-D83FC3273FE5.
> > In addition, you can use my AwReportViewer web control (extended version
> of
> > the HTML Viewer control) which makes generating reports on the server
side
> > of a web app plus dataset binding easier (I hope). You can download it
> from
> > here
> > http://www.manning-sandbox.com/thread.jspa?threadID=10392&tstart=0
> >
> > Please note that version 2005 of RS will include WinForm and ASP.NET
> > controls which will support binding to ADO.NET datasets.
> >
> > --
> > Hope this helps.
> >
> > ---
> > Teo Lachev, MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > http://www.prologika.com
> >
> >
> > "Tina" <tinamseaburn@.removespamexcite.com> wrote in message
> > news:ObwTjOWgEHA.3932@.TK2MSFTNGP10.phx.gbl...
> > > I'm still seeking my holy grail to figure out a way to pass a dataset,
> > full
> > > of data to SSRS at run time.
> > >
> > > The work to build the dataset has to be done in my ASPX program. I
> figure
> > I
> > > could easily create a physical table containing the data at runtime
with
> a
> > > name made up of MyTable + Session number.
> > >
> > > My SSRS report would have this exact table format defined but would
not
> > know
> > > the table name.
> > >
> > > Now I would like to find a way to dynamically pass the table name to
> SSRS
> > > when I execute the report and find a way to modify the SQL in my SSRS
> > report
> > > when the parameter is received.
> > >
> > > Is this feasible?
> > > Thanks,
> > > T
> > >
> > >
> >
> >
>|||Toby,
Thanks for the effort and credit :-) Your version wil be very useful in
cases when the data source needs to be configured during runtime.
"Toby" <toby.maillist@.exmlsystems.com> wrote in message
news:OIoYcmWgEHA.904@.TK2MSFTNGP09.phx.gbl...
> I've just posted a DPE this evening to
> http://workspaces.gotdotnet.com/appworld that may help you or at least
point
> you in the right direction.
> Regards
> Toby
> "Teo Lachev" <teo@.nospam.prologika.com> wrote in message
> news:e2Sr6bWgEHA.1276@.TK2MSFTNGP09.phx.gbl...
> > Tina,
> >
> > Binding to datasets is not supported in version 1.0 so you need to write
a
> > custom data extension to report off ADO.NET datasets or you can use mine
> >
>
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=B8468707-56EF-4864-AC51-D83FC3273FE5.
> > In addition, you can use my AwReportViewer web control (extended version
> of
> > the HTML Viewer control) which makes generating reports on the server
side
> > of a web app plus dataset binding easier (I hope). You can download it
> from
> > here
> > http://www.manning-sandbox.com/thread.jspa?threadID=10392&tstart=0
> >
> > Please note that version 2005 of RS will include WinForm and ASP.NET
> > controls which will support binding to ADO.NET datasets.
> >
> > --
> > Hope this helps.
> >
> > ---
> > Teo Lachev, MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > http://www.prologika.com
> >
> >
> > "Tina" <tinamseaburn@.removespamexcite.com> wrote in message
> > news:ObwTjOWgEHA.3932@.TK2MSFTNGP10.phx.gbl...
> > > I'm still seeking my holy grail to figure out a way to pass a dataset,
> > full
> > > of data to SSRS at run time.
> > >
> > > The work to build the dataset has to be done in my ASPX program. I
> figure
> > I
> > > could easily create a physical table containing the data at runtime
with
> a
> > > name made up of MyTable + Session number.
> > >
> > > My SSRS report would have this exact table format defined but would
not
> > know
> > > the table name.
> > >
> > > Now I would like to find a way to dynamically pass the table name to
> SSRS
> > > when I execute the report and find a way to modify the SQL in my SSRS
> > report
> > > when the parameter is received.
> > >
> > > Is this feasible?
> > > Thanks,
> > > T
> > >
> > >
> >
> >
>|||Theo,
After originally applying your changes I got security exceptions when ever I
tried to print any report. I then noticed that you had a strange double
quote character in your <codegroup changes where it says
...RS.Extensions.dll"/>. So, I changed it to a normal double quote. Now
whenever I try to print any report I get the exception clipped below. Can
you help?
Thanks,
T
Server Error in '/ReportServer' Application.
----
--
Configuration Error
Description: An error occurred during the processing of a configuration file
required to service this request. Please review the specific error details
below and modify your configuration file appropriately.
Parser Error Message: Assembly reportingserviceswebserver.dll security
permission grant set is incompatible between appdomains.
Source Error:
Line 26: <assemblies>
Line 27: <clear />
Line 28: <add assembly="ReportingServicesWebServer" />
Line 29: </assemblies>
Line 30: </compilation>
Source File: C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
Services\ReportServer\web.config Line: 28
"Teo Lachev" <teo@.nospam.prologika.com> wrote in message
news:uwTfyymgEHA.1972@.TK2MSFTNGP09.phx.gbl...
> Tina,
> Good job. Just hit the Refresh Fields toolbar button found on the Data
tab.
> --
> Hope this helps.
> ---
> Teo Lachev, MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> http://www.prologika.com
>
> "Tina" <tinamseaburn@.removespamexcite.com> wrote in message
> news:OLZsW1kgEHA.3016@.tk2msftngp13.phx.gbl...
> > Teo,
> > I'm going thru your documentation. I'm at "Setting the Report
DataSource"
> > and am having some trouble.
> >
> > I Deployed, and registered the dataset extension and adjusted the code
> > access security policy as per your instructions.
> >
> > Upon running the query I was prompted for the parameter value of
> @.DataSource
> > where I entered the path to my dsResults.xsd. It displayed the button
> > columns but no fields on the left. Because there are no fields on the
> left,
> > I can't design the report.
> >
> > What do you think might be wrong?
> > Thanks,
> > T
> >
> >
> > "Teo Lachev" <teo@.nospam.prologika.com> wrote in message
> > news:e2Sr6bWgEHA.1276@.TK2MSFTNGP09.phx.gbl...
> > > Tina,
> > >
> > > Binding to datasets is not supported in version 1.0 so you need to
write
> a
> > > custom data extension to report off ADO.NET datasets or you can use
mine
> > >
> >
>
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=B8468707-56EF-4864-AC51-D83FC3273FE5.
> > > In addition, you can use my AwReportViewer web control (extended
version
> > of
> > > the HTML Viewer control) which makes generating reports on the server
> side
> > > of a web app plus dataset binding easier (I hope). You can download it
> > from
> > > here
> > > http://www.manning-sandbox.com/thread.jspa?threadID=10392&tstart=0
> > >
> > > Please note that version 2005 of RS will include WinForm and ASP.NET
> > > controls which will support binding to ADO.NET datasets.
> > >
> > > --
> > > Hope this helps.
> > >
> > > ---
> > > Teo Lachev, MCSD, MCT
> > > Author: "Microsoft Reporting Services in Action"
> > > http://www.prologika.com
> > >
> > >
> > > "Tina" <tinamseaburn@.removespamexcite.com> wrote in message
> > > news:ObwTjOWgEHA.3932@.TK2MSFTNGP10.phx.gbl...
> > > > I'm still seeking my holy grail to figure out a way to pass a
dataset,
> > > full
> > > > of data to SSRS at run time.
> > > >
> > > > The work to build the dataset has to be done in my ASPX program. I
> > figure
> > > I
> > > > could easily create a physical table containing the data at runtime
> with
> > a
> > > > name made up of MyTable + Session number.
> > > >
> > > > My SSRS report would have this exact table format defined but would
> not
> > > know
> > > > the table name.
> > > >
> > > > Now I would like to find a way to dynamically pass the table name to
> > SSRS
> > > > when I execute the report and find a way to modify the SQL in my
SSRS
> > > report
> > > > when the parameter is received.
> > > >
> > > > Is this feasible?
> > > > Thanks,
> > > > T
> > > >
> > > >
> > >
> > >
> >
> >
>
Tuesday, March 20, 2012
Passing a WHERE clause
in a c# application and then pass them as parameters to a report that would
be used by a SQL Server stored procedure.
can anyone tell me how to do that?
Syntax for building it?
maybe a link to an example?
thanks
--
Lucas DargisYou have a very good sample available in samples. search for forms
authentication and open the custom security c# file and see the code you will
get good idea about how to write.
Amarnath
"akbikerboy" wrote:
> I want to build a SQL WHERE (and possibly ORDER BY) clause
> in a c# application and then pass them as parameters to a report that would
> be used by a SQL Server stored procedure.
> can anyone tell me how to do that?
> Syntax for building it?
> maybe a link to an example?
> thanks
> --
> Lucas Dargis|||could you be more specific?
Are you talking about MSDN or in VS?
I can't find what you are talking about
thanks
--
Lucas Dargis
"Amarnath" wrote:
> You have a very good sample available in samples. search for forms
> authentication and open the custom security c# file and see the code you will
> get good idea about how to write.
> Amarnath
> "akbikerboy" wrote:
> > I want to build a SQL WHERE (and possibly ORDER BY) clause
> > in a c# application and then pass them as parameters to a report that would
> > be used by a SQL Server stored procedure.
> >
> > can anyone tell me how to do that?
> > Syntax for building it?
> > maybe a link to an example?
> >
> > thanks
> > --
> > Lucas Dargis|||sql server online help samples
Amarnath
"akbikerboy" wrote:
> could you be more specific?
> Are you talking about MSDN or in VS?
> I can't find what you are talking about
>
> thanks
> --
> Lucas Dargis
>
> "Amarnath" wrote:
> > You have a very good sample available in samples. search for forms
> > authentication and open the custom security c# file and see the code you will
> > get good idea about how to write.
> >
> > Amarnath
> >
> > "akbikerboy" wrote:
> >
> > > I want to build a SQL WHERE (and possibly ORDER BY) clause
> > > in a c# application and then pass them as parameters to a report that would
> > > be used by a SQL Server stored procedure.
> > >
> > > can anyone tell me how to do that?
> > > Syntax for building it?
> > > maybe a link to an example?
> > >
> > > thanks
> > > --
> > > Lucas Dargis|||I looked all over and i can't find what your are talking about. do you have a
link to it?
--
Lucas Dargis
"Amarnath" wrote:
> sql server online help samples
> Amarnath
> "akbikerboy" wrote:
> > could you be more specific?
> > Are you talking about MSDN or in VS?
> > I can't find what you are talking about
> >
> >
> > thanks
> > --
> > Lucas Dargis
> >
> >
> > "Amarnath" wrote:
> >
> > > You have a very good sample available in samples. search for forms
> > > authentication and open the custom security c# file and see the code you will
> > > get good idea about how to write.
> > >
> > > Amarnath
> > >
> > > "akbikerboy" wrote:
> > >
> > > > I want to build a SQL WHERE (and possibly ORDER BY) clause
> > > > in a c# application and then pass them as parameters to a report that would
> > > > be used by a SQL Server stored procedure.
> > > >
> > > > can anyone tell me how to do that?
> > > > Syntax for building it?
> > > > maybe a link to an example?
> > > >
> > > > thanks
> > > > --
> > > > Lucas Dargis|||Just go to search in online help and search for forms authentication and if
you have installed the samples, go to the samples folder and see the forms
authentication example code.
Amarnath
"akbikerboy" wrote:
> I looked all over and i can't find what your are talking about. do you have a
> link to it?
> --
> Lucas Dargis
>
> "Amarnath" wrote:
> > sql server online help samples
> >
> > Amarnath
> >
> > "akbikerboy" wrote:
> >
> > > could you be more specific?
> > > Are you talking about MSDN or in VS?
> > > I can't find what you are talking about
> > >
> > >
> > > thanks
> > > --
> > > Lucas Dargis
> > >
> > >
> > > "Amarnath" wrote:
> > >
> > > > You have a very good sample available in samples. search for forms
> > > > authentication and open the custom security c# file and see the code you will
> > > > get good idea about how to write.
> > > >
> > > > Amarnath
> > > >
> > > > "akbikerboy" wrote:
> > > >
> > > > > I want to build a SQL WHERE (and possibly ORDER BY) clause
> > > > > in a c# application and then pass them as parameters to a report that would
> > > > > be used by a SQL Server stored procedure.
> > > > >
> > > > > can anyone tell me how to do that?
> > > > > Syntax for building it?
> > > > > maybe a link to an example?
> > > > >
> > > > > thanks
> > > > > --
> > > > > Lucas Dargis|||there are a million articles about forms authentication. and i don't see what
that has to do with passing a where clause from an application to RS...
thanks for trying though.
--
Lucas Dargis
"Amarnath" wrote:
> Just go to search in online help and search for forms authentication and if
> you have installed the samples, go to the samples folder and see the forms
> authentication example code.
> Amarnath
> "akbikerboy" wrote:
> > I looked all over and i can't find what your are talking about. do you have a
> > link to it?
> > --
> > Lucas Dargis
> >
> >
> > "Amarnath" wrote:
> >
> > > sql server online help samples
> > >
> > > Amarnath
> > >
> > > "akbikerboy" wrote:
> > >
> > > > could you be more specific?
> > > > Are you talking about MSDN or in VS?
> > > > I can't find what you are talking about
> > > >
> > > >
> > > > thanks
> > > > --
> > > > Lucas Dargis
> > > >
> > > >
> > > > "Amarnath" wrote:
> > > >
> > > > > You have a very good sample available in samples. search for forms
> > > > > authentication and open the custom security c# file and see the code you will
> > > > > get good idea about how to write.
> > > > >
> > > > > Amarnath
> > > > >
> > > > > "akbikerboy" wrote:
> > > > >
> > > > > > I want to build a SQL WHERE (and possibly ORDER BY) clause
> > > > > > in a c# application and then pass them as parameters to a report that would
> > > > > > be used by a SQL Server stored procedure.
> > > > > >
> > > > > > can anyone tell me how to do that?
> > > > > > Syntax for building it?
> > > > > > maybe a link to an example?
> > > > > >
> > > > > > thanks
> > > > > > --
> > > > > > Lucas Dargis|||dude, I didn't ask you to type it on google to get million option. By the way
I was mentioning that if you have sample installed, you can have a look at
the sample code, I repeat the code, so that you will get some idea for
writing code in c# or VB.net.
Amarnath
"akbikerboy" wrote:
> there are a million articles about forms authentication. and i don't see what
> that has to do with passing a where clause from an application to RS...
> thanks for trying though.
> --
> Lucas Dargis
>
> "Amarnath" wrote:
> > Just go to search in online help and search for forms authentication and if
> > you have installed the samples, go to the samples folder and see the forms
> > authentication example code.
> >
> > Amarnath
> >
> > "akbikerboy" wrote:
> >
> > > I looked all over and i can't find what your are talking about. do you have a
> > > link to it?
> > > --
> > > Lucas Dargis
> > >
> > >
> > > "Amarnath" wrote:
> > >
> > > > sql server online help samples
> > > >
> > > > Amarnath
> > > >
> > > > "akbikerboy" wrote:
> > > >
> > > > > could you be more specific?
> > > > > Are you talking about MSDN or in VS?
> > > > > I can't find what you are talking about
> > > > >
> > > > >
> > > > > thanks
> > > > > --
> > > > > Lucas Dargis
> > > > >
> > > > >
> > > > > "Amarnath" wrote:
> > > > >
> > > > > > You have a very good sample available in samples. search for forms
> > > > > > authentication and open the custom security c# file and see the code you will
> > > > > > get good idea about how to write.
> > > > > >
> > > > > > Amarnath
> > > > > >
> > > > > > "akbikerboy" wrote:
> > > > > >
> > > > > > > I want to build a SQL WHERE (and possibly ORDER BY) clause
> > > > > > > in a c# application and then pass them as parameters to a report that would
> > > > > > > be used by a SQL Server stored procedure.
> > > > > > >
> > > > > > > can anyone tell me how to do that?
> > > > > > > Syntax for building it?
> > > > > > > maybe a link to an example?
> > > > > > >
> > > > > > > thanks
> > > > > > > --
> > > > > > > Lucas Dargis|||Ok, to guide you precisly,
If you have samples installed in your m/c, go to
C:\Program Files\Microsoft SQL Server\90\Samples\Reporting
Services\Extension Samples\FormsAuthentication Sample\cs (change folder name
accordingly)
you can see a custom security solution file, click on that and open. search
for
"AuthenticationExtension.cs" file and click on view code and search for
"VerifyUser"
In that code you can see how it is defined for stored procedure using
commandtype
and parameter.add is used. instead of "@.username" build your where clause by
defining a variable and start adding all the conditions and pass it on using
parameter.add.
I think this should give some idea about how to write it.
Please let me know if you have any problems
Amarnath
"akbikerboy" wrote:
> there are a million articles about forms authentication. and i don't see what
> that has to do with passing a where clause from an application to RS...
> thanks for trying though.
> --
> Lucas Dargis
>
> "Amarnath" wrote:
> > Just go to search in online help and search for forms authentication and if
> > you have installed the samples, go to the samples folder and see the forms
> > authentication example code.
> >
> > Amarnath
> >
> > "akbikerboy" wrote:
> >
> > > I looked all over and i can't find what your are talking about. do you have a
> > > link to it?
> > > --
> > > Lucas Dargis
> > >
> > >
> > > "Amarnath" wrote:
> > >
> > > > sql server online help samples
> > > >
> > > > Amarnath
> > > >
> > > > "akbikerboy" wrote:
> > > >
> > > > > could you be more specific?
> > > > > Are you talking about MSDN or in VS?
> > > > > I can't find what you are talking about
> > > > >
> > > > >
> > > > > thanks
> > > > > --
> > > > > Lucas Dargis
> > > > >
> > > > >
> > > > > "Amarnath" wrote:
> > > > >
> > > > > > You have a very good sample available in samples. search for forms
> > > > > > authentication and open the custom security c# file and see the code you will
> > > > > > get good idea about how to write.
> > > > > >
> > > > > > Amarnath
> > > > > >
> > > > > > "akbikerboy" wrote:
> > > > > >
> > > > > > > I want to build a SQL WHERE (and possibly ORDER BY) clause
> > > > > > > in a c# application and then pass them as parameters to a report that would
> > > > > > > be used by a SQL Server stored procedure.
> > > > > > >
> > > > > > > can anyone tell me how to do that?
> > > > > > > Syntax for building it?
> > > > > > > maybe a link to an example?
> > > > > > >
> > > > > > > thanks
> > > > > > > --
> > > > > > > Lucas Dargis|||Well thanks for pointing that out precisely.
I guess I should have been more specific. I know how to create and pass a
parameter. Thatâ's not what I was asking. My question was how to write and
pass a 'where' clause specifically. What syntax to use.
For example: "WHERE EventDate = â'01/01/2007â' AND LocationCode = 'LA' AND zip
= 99874"
In that string, I have slashes, and quotes. When I try to pass this string
as a parameter, I get errors. Iâ've tried every type of â'escapeâ' technique
that I know and nothing works.
Thanks again.
--
Lucas Dargis
"Amarnath" wrote:
> Ok, to guide you precisly,
> If you have samples installed in your m/c, go to
> C:\Program Files\Microsoft SQL Server\90\Samples\Reporting
> Services\Extension Samples\FormsAuthentication Sample\cs (change folder name
> accordingly)
> you can see a custom security solution file, click on that and open. search
> for
> "AuthenticationExtension.cs" file and click on view code and search for
> "VerifyUser"
> In that code you can see how it is defined for stored procedure using
> commandtype
> and parameter.add is used. instead of "@.username" build your where clause by
> defining a variable and start adding all the conditions and pass it on using
> parameter.add.
> I think this should give some idea about how to write it.
> Please let me know if you have any problems
> Amarnath
>
> "akbikerboy" wrote:
> > there are a million articles about forms authentication. and i don't see what
> > that has to do with passing a where clause from an application to RS...
> >
> > thanks for trying though.
> > --
> > Lucas Dargis
> >
> >
> > "Amarnath" wrote:
> >
> > > Just go to search in online help and search for forms authentication and if
> > > you have installed the samples, go to the samples folder and see the forms
> > > authentication example code.
> > >
> > > Amarnath
> > >
> > > "akbikerboy" wrote:
> > >
> > > > I looked all over and i can't find what your are talking about. do you have a
> > > > link to it?
> > > > --
> > > > Lucas Dargis
> > > >
> > > >
> > > > "Amarnath" wrote:
> > > >
> > > > > sql server online help samples
> > > > >
> > > > > Amarnath
> > > > >
> > > > > "akbikerboy" wrote:
> > > > >
> > > > > > could you be more specific?
> > > > > > Are you talking about MSDN or in VS?
> > > > > > I can't find what you are talking about
> > > > > >
> > > > > >
> > > > > > thanks
> > > > > > --
> > > > > > Lucas Dargis
> > > > > >
> > > > > >
> > > > > > "Amarnath" wrote:
> > > > > >
> > > > > > > You have a very good sample available in samples. search for forms
> > > > > > > authentication and open the custom security c# file and see the code you will
> > > > > > > get good idea about how to write.
> > > > > > >
> > > > > > > Amarnath
> > > > > > >
> > > > > > > "akbikerboy" wrote:
> > > > > > >
> > > > > > > > I want to build a SQL WHERE (and possibly ORDER BY) clause
> > > > > > > > in a c# application and then pass them as parameters to a report that would
> > > > > > > > be used by a SQL Server stored procedure.
> > > > > > > >
> > > > > > > > can anyone tell me how to do that?
> > > > > > > > Syntax for building it?
> > > > > > > > maybe a link to an example?
> > > > > > > >
> > > > > > > > thanks
> > > > > > > > --
> > > > > > > > Lucas Dargis|||Oh Ok, so you meant this. the same way, how you have used in the example,
with double quotes and single quotes. if doesnt work try concatenating some
thing like this. e.g "Where aa = " + " ' " + "01/01/2007" + " ' "
Let me know whether it is working ?
Amarnath
"akbikerboy" wrote:
> Well thanks for pointing that out precisely.
> I guess I should have been more specific. I know how to create and pass a
> parameter. Thatâ's not what I was asking. My question was how to write and
> pass a 'where' clause specifically. What syntax to use.
> For example: "WHERE EventDate = â'01/01/2007â' AND LocationCode = 'LA' AND zip
> = 99874"
> In that string, I have slashes, and quotes. When I try to pass this string
> as a parameter, I get errors. Iâ've tried every type of â'escapeâ' technique
> that I know and nothing works.
> Thanks again.
> --
> Lucas Dargis
>
> "Amarnath" wrote:
> > Ok, to guide you precisly,
> >
> > If you have samples installed in your m/c, go to
> >
> > C:\Program Files\Microsoft SQL Server\90\Samples\Reporting
> > Services\Extension Samples\FormsAuthentication Sample\cs (change folder name
> > accordingly)
> >
> > you can see a custom security solution file, click on that and open. search
> > for
> > "AuthenticationExtension.cs" file and click on view code and search for
> > "VerifyUser"
> >
> > In that code you can see how it is defined for stored procedure using
> > commandtype
> > and parameter.add is used. instead of "@.username" build your where clause by
> > defining a variable and start adding all the conditions and pass it on using
> > parameter.add.
> >
> > I think this should give some idea about how to write it.
> > Please let me know if you have any problems
> >
> > Amarnath
> >
> >
> > "akbikerboy" wrote:
> >
> > > there are a million articles about forms authentication. and i don't see what
> > > that has to do with passing a where clause from an application to RS...
> > >
> > > thanks for trying though.
> > > --
> > > Lucas Dargis
> > >
> > >
> > > "Amarnath" wrote:
> > >
> > > > Just go to search in online help and search for forms authentication and if
> > > > you have installed the samples, go to the samples folder and see the forms
> > > > authentication example code.
> > > >
> > > > Amarnath
> > > >
> > > > "akbikerboy" wrote:
> > > >
> > > > > I looked all over and i can't find what your are talking about. do you have a
> > > > > link to it?
> > > > > --
> > > > > Lucas Dargis
> > > > >
> > > > >
> > > > > "Amarnath" wrote:
> > > > >
> > > > > > sql server online help samples
> > > > > >
> > > > > > Amarnath
> > > > > >
> > > > > > "akbikerboy" wrote:
> > > > > >
> > > > > > > could you be more specific?
> > > > > > > Are you talking about MSDN or in VS?
> > > > > > > I can't find what you are talking about
> > > > > > >
> > > > > > >
> > > > > > > thanks
> > > > > > > --
> > > > > > > Lucas Dargis
> > > > > > >
> > > > > > >
> > > > > > > "Amarnath" wrote:
> > > > > > >
> > > > > > > > You have a very good sample available in samples. search for forms
> > > > > > > > authentication and open the custom security c# file and see the code you will
> > > > > > > > get good idea about how to write.
> > > > > > > >
> > > > > > > > Amarnath
> > > > > > > >
> > > > > > > > "akbikerboy" wrote:
> > > > > > > >
> > > > > > > > > I want to build a SQL WHERE (and possibly ORDER BY) clause
> > > > > > > > > in a c# application and then pass them as parameters to a report that would
> > > > > > > > > be used by a SQL Server stored procedure.
> > > > > > > > >
> > > > > > > > > can anyone tell me how to do that?
> > > > > > > > > Syntax for building it?
> > > > > > > > > maybe a link to an example?
> > > > > > > > >
> > > > > > > > > thanks
> > > > > > > > > --
> > > > > > > > > Lucas Dargis|||so for the query i tried
select....
where @.where
parameter: LocationCode + "'" + LA + "'"
I am getting the following error
An error occurred whild executing the query
An expression of non-boolean type specified in a context where a condition
is expected, near @.where
error:4145
I am running the query in the report designed in the Data tab
thanks
--
Lucas Dargis
"akbikerboy" wrote:
> I want to build a SQL WHERE (and possibly ORDER BY) clause
> in a c# application and then pass them as parameters to a report that would
> be used by a SQL Server stored procedure.
> can anyone tell me how to do that?
> Syntax for building it?
> maybe a link to an example?
> thanks
> --
> Lucas Dargis|||For the query i use
SELECT...
WHERE @.where
parameter: declared as a string
LocationCode = + "'" + LA + "'"
and i got the following error:
An error occurred whild executing the query.
An expression of non-boolean type specified in a contex where a condition is
expected, near '@.where'.
Error: 4145
I am running the query in the Data tab in the Report Builder
thanks
--
Lucas Dargis
"Amarnath" wrote:
> Oh Ok, so you meant this. the same way, how you have used in the example,
> with double quotes and single quotes. if doesnt work try concatenating some
> thing like this. e.g "Where aa = " + " ' " + "01/01/2007" + " ' "
> Let me know whether it is working ?
> Amarnath
> "akbikerboy" wrote:
> > Well thanks for pointing that out precisely.
> >
> > I guess I should have been more specific. I know how to create and pass a
> > parameter. Thatâ's not what I was asking. My question was how to write and
> > pass a 'where' clause specifically. What syntax to use.
> >
> > For example: "WHERE EventDate = â'01/01/2007â' AND LocationCode = 'LA' AND zip
> > = 99874"
> >
> > In that string, I have slashes, and quotes. When I try to pass this string
> > as a parameter, I get errors. Iâ've tried every type of â'escapeâ' technique
> > that I know and nothing works.
> >
> > Thanks again.
> >
> > --
> > Lucas Dargis
> >
> >
> > "Amarnath" wrote:
> >
> > > Ok, to guide you precisly,
> > >
> > > If you have samples installed in your m/c, go to
> > >
> > > C:\Program Files\Microsoft SQL Server\90\Samples\Reporting
> > > Services\Extension Samples\FormsAuthentication Sample\cs (change folder name
> > > accordingly)
> > >
> > > you can see a custom security solution file, click on that and open. search
> > > for
> > > "AuthenticationExtension.cs" file and click on view code and search for
> > > "VerifyUser"
> > >
> > > In that code you can see how it is defined for stored procedure using
> > > commandtype
> > > and parameter.add is used. instead of "@.username" build your where clause by
> > > defining a variable and start adding all the conditions and pass it on using
> > > parameter.add.
> > >
> > > I think this should give some idea about how to write it.
> > > Please let me know if you have any problems
> > >
> > > Amarnath
> > >
> > >
> > > "akbikerboy" wrote:
> > >
> > > > there are a million articles about forms authentication. and i don't see what
> > > > that has to do with passing a where clause from an application to RS...
> > > >
> > > > thanks for trying though.
> > > > --
> > > > Lucas Dargis
> > > >
> > > >
> > > > "Amarnath" wrote:
> > > >
> > > > > Just go to search in online help and search for forms authentication and if
> > > > > you have installed the samples, go to the samples folder and see the forms
> > > > > authentication example code.
> > > > >
> > > > > Amarnath
> > > > >
> > > > > "akbikerboy" wrote:
> > > > >
> > > > > > I looked all over and i can't find what your are talking about. do you have a
> > > > > > link to it?
> > > > > > --
> > > > > > Lucas Dargis
> > > > > >
> > > > > >
> > > > > > "Amarnath" wrote:
> > > > > >
> > > > > > > sql server online help samples
> > > > > > >
> > > > > > > Amarnath
> > > > > > >
> > > > > > > "akbikerboy" wrote:
> > > > > > >
> > > > > > > > could you be more specific?
> > > > > > > > Are you talking about MSDN or in VS?
> > > > > > > > I can't find what you are talking about
> > > > > > > >
> > > > > > > >
> > > > > > > > thanks
> > > > > > > > --
> > > > > > > > Lucas Dargis
> > > > > > > >
> > > > > > > >
> > > > > > > > "Amarnath" wrote:
> > > > > > > >
> > > > > > > > > You have a very good sample available in samples. search for forms
> > > > > > > > > authentication and open the custom security c# file and see the code you will
> > > > > > > > > get good idea about how to write.
> > > > > > > > >
> > > > > > > > > Amarnath
> > > > > > > > >
> > > > > > > > > "akbikerboy" wrote:
> > > > > > > > >
> > > > > > > > > > I want to build a SQL WHERE (and possibly ORDER BY) clause
> > > > > > > > > > in a c# application and then pass them as parameters to a report that would
> > > > > > > > > > be used by a SQL Server stored procedure.
> > > > > > > > > >
> > > > > > > > > > can anyone tell me how to do that?
> > > > > > > > > > Syntax for building it?
> > > > > > > > > > maybe a link to an example?
> > > > > > > > > >
> > > > > > > > > > thanks
> > > > > > > > > > --
> > > > > > > > > > Lucas Dargis|||By two way you can solve this.
1. use stored proc to concatenate all the "select", includng the values
which comes from parameter ie where clause
2. By directly giving in the data tab..
e.g I have taken some samples from adventure... it goes like this..
paste this code in the data tab it executes successfully..
declare @.s as nvarchar(1000)
set @.s = 'SELECT ContactID, NameStyle, Title, FirstName, FROM
Person.Contact WHERE ' + @.w
exec sp_executesql @.s
the @.w is what I entered " as (Title = 'Mr.').
PS. "where", is the reserved word, so name @.where to some other name.
So basically what i meant here is to built using stored proc or use string
and concatenate with your parameter.
Amarnath
"akbikerboy" wrote:
> so for the query i tried
> select....
> where @.where
> parameter: LocationCode + "'" + LA + "'"
> I am getting the following error
> An error occurred whild executing the query
> An expression of non-boolean type specified in a context where a condition
> is expected, near @.where
> error:4145
> I am running the query in the report designed in the Data tab
> thanks
> --
> Lucas Dargis
>
> "akbikerboy" wrote:
> > I want to build a SQL WHERE (and possibly ORDER BY) clause
> > in a c# application and then pass them as parameters to a report that would
> > be used by a SQL Server stored procedure.
> >
> > can anyone tell me how to do that?
> > Syntax for building it?
> > maybe a link to an example?
> >
> > thanks
> > --
> > Lucas Dargis|||AWESOME! very clever.
well your second solution is just what i was looking for, however, it brings
up another problem.
Since the query is now created in a variable, RS doesn't recognize the
fields in the layout tab. how do i reference the fields so i can create the
report?
thanks again
--
Lucas Dargis
"Amarnath" wrote:
> By two way you can solve this.
> 1. use stored proc to concatenate all the "select", includng the values
> which comes from parameter ie where clause
> 2. By directly giving in the data tab..
> e.g I have taken some samples from adventure... it goes like this..
> paste this code in the data tab it executes successfully..
> declare @.s as nvarchar(1000)
> set @.s = 'SELECT ContactID, NameStyle, Title, FirstName, FROM
> Person.Contact WHERE ' + @.w
> exec sp_executesql @.s
> the @.w is what I entered " as (Title = 'Mr.').
> PS. "where", is the reserved word, so name @.where to some other name.
> So basically what i meant here is to built using stored proc or use string
> and concatenate with your parameter.
> Amarnath
>
> "akbikerboy" wrote:
> > so for the query i tried
> > select....
> > where @.where
> >
> > parameter: LocationCode + "'" + LA + "'"
> >
> > I am getting the following error
> >
> > An error occurred whild executing the query
> > An expression of non-boolean type specified in a context where a condition
> > is expected, near @.where
> >
> > error:4145
> >
> > I am running the query in the report designed in the Data tab
> >
> > thanks
> > --
> > Lucas Dargis
> >
> >
> > "akbikerboy" wrote:
> >
> > > I want to build a SQL WHERE (and possibly ORDER BY) clause
> > > in a c# application and then pass them as parameters to a report that would
> > > be used by a SQL Server stored procedure.
> > >
> > > can anyone tell me how to do that?
> > > Syntax for building it?
> > > maybe a link to an example?
> > >
> > > thanks
> > > --
> > > Lucas Dargis|||So you can forget my last question. I reread your last post and figured it out.
i put the sql code you provided me into a stored proc and called that proc
while sending the Where Clause as a parameter and it worked PERFECTLY!!!
i can't thank you enough. i've been stuck on this for a few weeks.
Lucas Dargis
"akbikerboy" wrote:
> AWESOME! very clever.
> well your second solution is just what i was looking for, however, it brings
> up another problem.
> Since the query is now created in a variable, RS doesn't recognize the
> fields in the layout tab. how do i reference the fields so i can create the
> report?
> thanks again
> --
> Lucas Dargis
>
> "Amarnath" wrote:
> > By two way you can solve this.
> > 1. use stored proc to concatenate all the "select", includng the values
> > which comes from parameter ie where clause
> > 2. By directly giving in the data tab..
> > e.g I have taken some samples from adventure... it goes like this..
> >
> > paste this code in the data tab it executes successfully..
> >
> > declare @.s as nvarchar(1000)
> > set @.s = 'SELECT ContactID, NameStyle, Title, FirstName, FROM
> > Person.Contact WHERE ' + @.w
> > exec sp_executesql @.s
> >
> > the @.w is what I entered " as (Title = 'Mr.').
> >
> > PS. "where", is the reserved word, so name @.where to some other name.
> > So basically what i meant here is to built using stored proc or use string
> > and concatenate with your parameter.
> >
> > Amarnath
> >
> >
> > "akbikerboy" wrote:
> >
> > > so for the query i tried
> > > select....
> > > where @.where
> > >
> > > parameter: LocationCode + "'" + LA + "'"
> > >
> > > I am getting the following error
> > >
> > > An error occurred whild executing the query
> > > An expression of non-boolean type specified in a context where a condition
> > > is expected, near @.where
> > >
> > > error:4145
> > >
> > > I am running the query in the report designed in the Data tab
> > >
> > > thanks
> > > --
> > > Lucas Dargis
> > >
> > >
> > > "akbikerboy" wrote:
> > >
> > > > I want to build a SQL WHERE (and possibly ORDER BY) clause
> > > > in a c# application and then pass them as parameters to a report that would
> > > > be used by a SQL Server stored procedure.
> > > >
> > > > can anyone tell me how to do that?
> > > > Syntax for building it?
> > > > maybe a link to an example?
> > > >
> > > > thanks
> > > > --
> > > > Lucas Dargis
Monday, March 12, 2012
Passing a schema to a cube via AMO
Oh, i'm using SQL Server 2k5.
When i build the cube through Dev Studio, it will process dimensions as expected. So, when pulling data, i can look at the SQL and see (for example):
"Select blah from Schema.TableName"
Which is what i want. However, when i build the cube using AMO i can not process the dimension, and it's failing because the SQL reads:
"Select blah from TableName"
A quick fix for me is to remove the Schema from my tables.. so, dbo.TableName works fine. But that's not exactly what i want. Or, i can create stored procs that pull the data from any table/schema, but that's not what i want either..
So, i guess i'm asking if there's a way to pass a schema to a dataset and have it read by the cube.
Any help would be appreciated..
Thanks,
Chris.
The following snippet is from the AMOAdventureWorks sample that is part of the SQL Server 2005 samples. It comes from the part of the program where they are building the DSV. Note that there are two points where the dbo schema is hard coded. I am hoping that by passing in your own schema name will resolve your issue.
|||excellent, thanks so much!staticvoid AddTable(DataSourceView dsv, OleDbConnection connection, String tableName)
{
OleDbDataAdapter adapter = newOleDbDataAdapter(
"SELECT * FROM [dbo].[" + tableName + "] WHERE 1=0",
connection);
DataTable[] dataTables = adapter.FillSchema(dsv.Schema,
SchemaType.Mapped, tableName);
DataTable dataTable = dataTables[0];
dataTable.ExtendedProperties.Add("TableType", "Table");
dataTable.ExtendedProperties.Add("DbSchemaName", "dbo");
dataTable.ExtendedProperties.Add("DbTableName", tableName);
dataTable.ExtendedProperties.Add("FriendlyName", tableName);
}
dataTable.ExtendedProperties.Add("DbSchemaName", "dbo"); worked exactly as i needed it to, by replacing it with my own schema name.
Passing a dataset as a parameter?
through the report viewer control and have reporting services use this
dataset as the binding dataset for your table in Reporting Services? IF so,
can you help me or direct me to some article that will show me how to do
this.RS (both 2000 and 2005) don't support binding to applcation datasets
natively. If you need to pass a dataset to a server-generated report, you
may find my custom extension useful
(http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=B8468707-56EF-4864-AC51-D83FC3273FE5).
If you RS 2005 and the Report Viewers, you can bind the dataset to a local
report.
--
HTH,
---
Teo Lachev, MVP, MCSD, MCT
"Microsoft Reporting Services in Action"
"Applied Microsoft Analysis Services 2005"
Home page and blog: http://www.prologika.com/
---
"dillig" <dillig@.discussions.microsoft.com> wrote in message
news:28CDC775-5FFA-4993-B9CF-D766B33A5DF3@.microsoft.com...
> Can you build a dataset in a web application and send it as a parameter
> through the report viewer control and have reporting services use this
> dataset as the binding dataset for your table in Reporting Services? IF
> so,
> can you help me or direct me to some article that will show me how to do
> this.|||The posts that I am seeing in your article looks like people are having
problems with doing this in Reporting Services 2005. At least the referencing
portion. Could you update with how this is done in 2005 or post where the
AWC.RS.Extensions.dll
is copied in 2005.
Thanks in advance
"Teo Lachev [MVP]" wrote:
> RS (both 2000 and 2005) don't support binding to applcation datasets
> natively. If you need to pass a dataset to a server-generated report, you
> may find my custom extension useful
> (http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=B8468707-56EF-4864-AC51-D83FC3273FE5).
> If you RS 2005 and the Report Viewers, you can bind the dataset to a local
> report.
> --
> HTH,
> ---
> Teo Lachev, MVP, MCSD, MCT
> "Microsoft Reporting Services in Action"
> "Applied Microsoft Analysis Services 2005"
> Home page and blog: http://www.prologika.com/
> ---
> "dillig" <dillig@.discussions.microsoft.com> wrote in message
> news:28CDC775-5FFA-4993-B9CF-D766B33A5DF3@.microsoft.com...
> > Can you build a dataset in a web application and send it as a parameter
> > through the report viewer control and have reporting services use this
> > dataset as the binding dataset for your table in Reporting Services? IF
> > so,
> > can you help me or direct me to some article that will show me how to do
> > this.
>
>|||I was also reading that someone was having trouble with using a dataset that
used SQL Query joins with multiple tables or is this not a problem?
"Teo Lachev [MVP]" wrote:
> RS (both 2000 and 2005) don't support binding to applcation datasets
> natively. If you need to pass a dataset to a server-generated report, you
> may find my custom extension useful
> (http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=B8468707-56EF-4864-AC51-D83FC3273FE5).
> If you RS 2005 and the Report Viewers, you can bind the dataset to a local
> report.
> --
> HTH,
> ---
> Teo Lachev, MVP, MCSD, MCT
> "Microsoft Reporting Services in Action"
> "Applied Microsoft Analysis Services 2005"
> Home page and blog: http://www.prologika.com/
> ---
> "dillig" <dillig@.discussions.microsoft.com> wrote in message
> news:28CDC775-5FFA-4993-B9CF-D766B33A5DF3@.microsoft.com...
> > Can you build a dataset in a web application and send it as a parameter
> > through the report viewer control and have reporting services use this
> > dataset as the binding dataset for your table in Reporting Services? IF
> > so,
> > can you help me or direct me to some article that will show me how to do
> > this.
>
>|||One day I will probably get to it :-) It shouldn't be that terribly
difficult to upgrade the changed interfaces.
--
HTH,
---
Teo Lachev, MVP, MCSD, MCT
"Microsoft Reporting Services in Action"
"Applied Microsoft Analysis Services 2005"
Home page and blog: http://www.prologika.com/
---
"dillig" <dillig@.discussions.microsoft.com> wrote in message
news:74683164-56A9-44BD-806D-7C9DBBCAA339@.microsoft.com...
> The posts that I am seeing in your article looks like people are having
> problems with doing this in Reporting Services 2005. At least the
> referencing
> portion. Could you update with how this is done in 2005 or post where the
> AWC.RS.Extensions.dll
> is copied in 2005.
> Thanks in advance
> "Teo Lachev [MVP]" wrote:
>> RS (both 2000 and 2005) don't support binding to applcation datasets
>> natively. If you need to pass a dataset to a server-generated report, you
>> may find my custom extension useful
>> (http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=B8468707-56EF-4864-AC51-D83FC3273FE5).
>> If you RS 2005 and the Report Viewers, you can bind the dataset to a
>> local
>> report.
>> --
>> HTH,
>> ---
>> Teo Lachev, MVP, MCSD, MCT
>> "Microsoft Reporting Services in Action"
>> "Applied Microsoft Analysis Services 2005"
>> Home page and blog: http://www.prologika.com/
>> ---
>> "dillig" <dillig@.discussions.microsoft.com> wrote in message
>> news:28CDC775-5FFA-4993-B9CF-D766B33A5DF3@.microsoft.com...
>> > Can you build a dataset in a web application and send it as a
>> > parameter
>> > through the report viewer control and have reporting services use this
>> > dataset as the binding dataset for your table in Reporting Services? IF
>> > so,
>> > can you help me or direct me to some article that will show me how to
>> > do
>> > this.
>>|||While the sky is the limit what your CDE can do, RS expects a
two-dimensional resultset.
--
HTH,
---
Teo Lachev, MVP, MCSD, MCT
"Microsoft Reporting Services in Action"
"Applied Microsoft Analysis Services 2005"
Home page and blog: http://www.prologika.com/
---
"dillig" <dillig@.discussions.microsoft.com> wrote in message
news:3CC6145C-449B-4C11-B5DF-A7A4F1275375@.microsoft.com...
>I was also reading that someone was having trouble with using a dataset
>that
> used SQL Query joins with multiple tables or is this not a problem?
> "Teo Lachev [MVP]" wrote:
>> RS (both 2000 and 2005) don't support binding to applcation datasets
>> natively. If you need to pass a dataset to a server-generated report, you
>> may find my custom extension useful
>> (http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=B8468707-56EF-4864-AC51-D83FC3273FE5).
>> If you RS 2005 and the Report Viewers, you can bind the dataset to a
>> local
>> report.
>> --
>> HTH,
>> ---
>> Teo Lachev, MVP, MCSD, MCT
>> "Microsoft Reporting Services in Action"
>> "Applied Microsoft Analysis Services 2005"
>> Home page and blog: http://www.prologika.com/
>> ---
>> "dillig" <dillig@.discussions.microsoft.com> wrote in message
>> news:28CDC775-5FFA-4993-B9CF-D766B33A5DF3@.microsoft.com...
>> > Can you build a dataset in a web application and send it as a
>> > parameter
>> > through the report viewer control and have reporting services use this
>> > dataset as the binding dataset for your table in Reporting Services? IF
>> > so,
>> > can you help me or direct me to some article that will show me how to
>> > do
>> > this.
>>
Friday, March 9, 2012
Passing & in the parametter
parameter value contains â'&â' then ReportViewer returns error. Any idea how I
can resolve this issue?
private string EmumProperties(Hashtable properties)
{
string paramsString = String.Empty;
// Enumerate properties and create report server specific string.
IDictionaryEnumerator customPropEnumerator = properties.GetEnumerator();
while ( customPropEnumerator.MoveNext() )
{
paramsString += "&"
+ customPropEnumerator.Key
+ "=" + customPropEnumerator.Value;
}
return paramsString;
}
/// <summary>
/// Add URL access command for rendering a report and any
/// additional parameters.
/// </summary>
public string BuildUrlString()
{
this._url = this._serverUrl + "?" + this._reportPath +
"&rs:Command=Render" + this.EmumProperties(this._properties);
return this._url;
}I resolved the issue by using urlencode.
"JIM.H." wrote:
> ReportViewer usese these two fuctions to build URL for the report. If the
> parameter value contains â'&â' then ReportViewer returns error. Any idea how I
> can resolve this issue?
> private string EmumProperties(Hashtable properties)
> {
> string paramsString = String.Empty;
> // Enumerate properties and create report server specific string.
> IDictionaryEnumerator customPropEnumerator => properties.GetEnumerator();
> while ( customPropEnumerator.MoveNext() )
> {
> paramsString += "&"
> + customPropEnumerator.Key
> + "=" + customPropEnumerator.Value;
> }
> return paramsString;
> }
> /// <summary>
> /// Add URL access command for rendering a report and any
> /// additional parameters.
> /// </summary>
> public string BuildUrlString()
> {
> this._url = this._serverUrl + "?" + this._reportPath +
> "&rs:Command=Render" + this.EmumProperties(this._properties);
> return this._url;
> }
>