Showing posts with label based. Show all posts
Showing posts with label based. Show all posts

Thursday, March 29, 2012

Can we get the Next Row Value ?

In SSRS 2005 we have First,Last and Previous functions which get the related values based on the use. I want to compare with the NEXT row value and print it according to my requirement.

My question is How do I get the Next Row Value. Please Help.

Could be tricky, however try using a protected variable in the Code view... something like this (untested):

protected myprevValue as string

public function setString(myString as string) as string

myprevValue = myString
return ""

end function

public function getString() as string
return myprevValue

end function

Then you use a hidden text box with the expression =setString(myString)

If you have multiple values or want to lookup by row number you can use a dictionary object to store and retrieve them.

No guarantees on this and placement of the text boxes are key. I have not tried this with getting the Next value however it did work for doing things like lookups against data outside of the current dataset.

cheers,

Andrew

|||

Hello Andrew,

I tried the way you explained but I was able to get the previous row value only. Is there any other way wherein we can get the Next row's field value.

Please help,

|||

Looking into the future is tough.

You have to iterate through the set once to store the values in a lookup dictionary object, and then iterate again to retrieve. This becomes unmanageable with many fields... hopefully you're only looking up a couple of values here. I have not tried this rownumber method - I was using it to look up descriptive names for keys.

1st table - will contain the set function in a textbox expression passing in the row number and value. This table can be hidden.

=setValue(RowNumber(Nothing),myfield.value)

2nd table - will contain the get function passing in the row number.

=getValue(RowNumber(Nothing)

Code Below

public dictLookup as new System.Collections.Generic.Dictionary(Of String, String)

Function setValue(value as object, value2 as object) as object

dictLookup.Add(value, value2)

return value

End Function

Function getValue(value as object) as object

If dictLookup.ContainsKey(value)

return dictLookup(value)

else

return value

end if

End Function

Tuesday, March 27, 2012

Can we create free-form report in report builder?

I only can create reports based on three predefined templates. It is very
restricted.Jun Yuan,
Don't choose the Wizard or you will be forced to use the templates.
Right click on your project. Choose Add new item... then choose Report.
You should be given a blank report and asked to specify a data source.
"Jun Yuan" wrote:
> I only can create reports based on three predefined templates. It is very
> restricted.sql

Sunday, March 25, 2012

Can view accept parameters

Hi All ,
i wonder if a view can accept parameters becoz i only
want to show certain columns based on user's input.
if it's not possible, could i know is there other
alternative as to accept both the user's input as well as
restrict the column to be displayed as readonly
thks & rdgsWhat version are you running? Please always state that information.
If you are using SQL Server 2000, you can create a table valued function
that can be used EXACTLY like a view which accepts parameters. Please read
about CREATE FUNCTION in the Books Online.
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"maxzsim" <anonymous@.discussions.microsoft.com> wrote in message
news:056c01c47aae$ea2814d0$a501280a@.phx.gbl...
> Hi All ,
> i wonder if a view can accept parameters becoz i only
> want to show certain columns based on user's input.
> if it's not possible, could i know is there other
> alternative as to accept both the user's input as well as
> restrict the column to be displayed as readonly
> thks & rdgs|||Hi Kalen ,
my appologies ..
btw i am using SQL 7.0 , is this possible then ?
thks
>--Original Message--
>What version are you running? Please always state that
information.
>If you are using SQL Server 2000, you can create a table
valued function
>that can be used EXACTLY like a view which accepts
parameters. Please read
>about CREATE FUNCTION in the Books Online.
>--
>HTH
>--
>Kalen Delaney
>SQL Server MVP
>www.SolidQualityLearning.com
>
>"maxzsim" <anonymous@.discussions.microsoft.com> wrote in
message
>news:056c01c47aae$ea2814d0$a501280a@.phx.gbl...
as[vbcol=seagreen]
>
>.
>|||No. In the relational model, a view is just like a table and a table doesn't
accept parameters.
In-line table values functions is what some call "a view that accepts parame
ters" but that feature was added
in 2000. Can you use a stored procedure instead?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"maxzsim" <anonymous@.discussions.microsoft.com> wrote in message
news:042d01c47ab0$eb6bcd80$a301280a@.phx.gbl...[vbcol=seagreen]
> Hi Kalen ,
> my appologies ..
> btw i am using SQL 7.0 , is this possible then ?
> thks
> information.
> valued function
> parameters. Please read
> message
> assql

Can view accept parameters

Hi All ,
i wonder if a view can accept parameters becoz i only
want to show certain columns based on user's input.
if it's not possible, could i know is there other
alternative as to accept both the user's input as well as
restrict the column to be displayed as readonly
thks & rdgs
What version are you running? Please always state that information.
If you are using SQL Server 2000, you can create a table valued function
that can be used EXACTLY like a view which accepts parameters. Please read
about CREATE FUNCTION in the Books Online.
HTH
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"maxzsim" <anonymous@.discussions.microsoft.com> wrote in message
news:056c01c47aae$ea2814d0$a501280a@.phx.gbl...
> Hi All ,
> i wonder if a view can accept parameters becoz i only
> want to show certain columns based on user's input.
> if it's not possible, could i know is there other
> alternative as to accept both the user's input as well as
> restrict the column to be displayed as readonly
> thks & rdgs
|||Hi Kalen ,
my appologies ..
btw i am using SQL 7.0 , is this possible then ?
thks
>--Original Message--
>What version are you running? Please always state that
information.
>If you are using SQL Server 2000, you can create a table
valued function
>that can be used EXACTLY like a view which accepts
parameters. Please read
>about CREATE FUNCTION in the Books Online.
>--
>HTH
>--
>Kalen Delaney
>SQL Server MVP
>www.SolidQualityLearning.com
>
>"maxzsim" <anonymous@.discussions.microsoft.com> wrote in
message[vbcol=seagreen]
>news:056c01c47aae$ea2814d0$a501280a@.phx.gbl...
as
>
>.
>
|||No. In the relational model, a view is just like a table and a table doesn't accept parameters.
In-line table values functions is what some call "a view that accepts parameters" but that feature was added
in 2000. Can you use a stored procedure instead?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"maxzsim" <anonymous@.discussions.microsoft.com> wrote in message
news:042d01c47ab0$eb6bcd80$a301280a@.phx.gbl...[vbcol=seagreen]
> Hi Kalen ,
> my appologies ..
> btw i am using SQL 7.0 , is this possible then ?
> thks
> information.
> valued function
> parameters. Please read
> message
> as

Thursday, March 22, 2012

Can view accept parameters

Hi All ,
i wonder if a view can accept parameters becoz i only
want to show certain columns based on user's input.
if it's not possible, could i know is there other
alternative as to accept both the user's input as well as
restrict the column to be displayed as readonly
thks & rdgsWhat version are you running? Please always state that information.
If you are using SQL Server 2000, you can create a table valued function
that can be used EXACTLY like a view which accepts parameters. Please read
about CREATE FUNCTION in the Books Online.
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"maxzsim" <anonymous@.discussions.microsoft.com> wrote in message
news:056c01c47aae$ea2814d0$a501280a@.phx.gbl...
> Hi All ,
> i wonder if a view can accept parameters becoz i only
> want to show certain columns based on user's input.
> if it's not possible, could i know is there other
> alternative as to accept both the user's input as well as
> restrict the column to be displayed as readonly
> thks & rdgs|||Hi Kalen ,
my appologies ..
btw i am using SQL 7.0 , is this possible then ?
thks
>--Original Message--
>What version are you running? Please always state that
information.
>If you are using SQL Server 2000, you can create a table
valued function
>that can be used EXACTLY like a view which accepts
parameters. Please read
>about CREATE FUNCTION in the Books Online.
>--
>HTH
>--
>Kalen Delaney
>SQL Server MVP
>www.SolidQualityLearning.com
>
>"maxzsim" <anonymous@.discussions.microsoft.com> wrote in
message
>news:056c01c47aae$ea2814d0$a501280a@.phx.gbl...
>> Hi All ,
>> i wonder if a view can accept parameters becoz i only
>> want to show certain columns based on user's input.
>> if it's not possible, could i know is there other
>> alternative as to accept both the user's input as well
as
>> restrict the column to be displayed as readonly
>> thks & rdgs
>
>.
>|||No. In the relational model, a view is just like a table and a table doesn't accept parameters.
In-line table values functions is what some call "a view that accepts parameters" but that feature was added
in 2000. Can you use a stored procedure instead?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"maxzsim" <anonymous@.discussions.microsoft.com> wrote in message
news:042d01c47ab0$eb6bcd80$a301280a@.phx.gbl...
> Hi Kalen ,
> my appologies ..
> btw i am using SQL 7.0 , is this possible then ?
> thks
> >--Original Message--
> >What version are you running? Please always state that
> information.
> >
> >If you are using SQL Server 2000, you can create a table
> valued function
> >that can be used EXACTLY like a view which accepts
> parameters. Please read
> >about CREATE FUNCTION in the Books Online.
> >
> >--
> >HTH
> >--
> >Kalen Delaney
> >SQL Server MVP
> >www.SolidQualityLearning.com
> >
> >
> >"maxzsim" <anonymous@.discussions.microsoft.com> wrote in
> message
> >news:056c01c47aae$ea2814d0$a501280a@.phx.gbl...
> >> Hi All ,
> >>
> >> i wonder if a view can accept parameters becoz i only
> >> want to show certain columns based on user's input.
> >>
> >> if it's not possible, could i know is there other
> >> alternative as to accept both the user's input as well
> as
> >> restrict the column to be displayed as readonly
> >>
> >> thks & rdgs
> >
> >
> >.
> >

Can Triggers inititate an SSIS package run?

All:

I have a need to initiate an SSIS package based upon additions/changes that would be made to a db table. Can this be done and if so how?

Thanks!

Sure. Use xp_cmdshell to call dtexec.exe. Or, set up a SQLAgent job and call it using sp_start_job.

-Jamie

|||

Thanks Jamie! I have never worked with Triggers before but will give your solution a shot.

|||

Begin: (Stupid Question)

Where do I find sp_start_job

End;

|||Found it in msdb database. Thanks!

Monday, March 19, 2012

Can this be done in the reporting services (SQL 2005)

Based on the data in the SQL server table (Customers address table) I
want to print letters (with individual customers address) as a pdf
file?
This is similar to Form Letters in Word document and use mail merge but
my requirements is letters needed as a pdf file and the whole process
should be an automated scheduled task?I thing that you would be better served looking at using Word, form letters,
and getting a PDF print driver. And of course, you can automate Word on a
scheduled basis using either VBA or VB/C# .NET code.
--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"c_shah" <shah.chirag@.netzero.net> wrote in message
news:1165090517.937723.144090@.16g2000cwy.googlegroups.com...
> Based on the data in the SQL server table (Customers address table) I
> want to print letters (with individual customers address) as a pdf
> file?
> This is similar to Form Letters in Word document and use mail merge but
> my requirements is letters needed as a pdf file and the whole process
> should be an automated scheduled task?
>|||Thank you.

Thursday, February 16, 2012

Can Report Manager be accessed as an Internet application?

Is Report Manager designed to be accessed over the Internet, and if so, is
there a forms based login that can be enabled?
-- Chris, SSSIhttp://msdn.microsoft.com/library/?url=/library/en-us/dnsql2k/html/ufairs.asp?frame=true#ufairs_topic3
"Chris G." wrote:
> Is Report Manager designed to be accessed over the Internet, and if so, is
> there a forms based login that can be enabled?
> -- Chris, SSSI|||Mark,
Will that sample run against 2005 Reporting Services with little or no
modification?
-- Chris, SSSI
"Mark" wrote:
> http://msdn.microsoft.com/library/?url=/library/en-us/dnsql2k/html/ufairs.asp?frame=true#ufairs_topic3
> "Chris G." wrote:
> > Is Report Manager designed to be accessed over the Internet, and if so, is
> > there a forms based login that can be enabled?
> >
> > -- Chris, SSSI|||I couldn't say, to be honest. I was never even able to get it working with
2000, although that doesn't mean you'd have the same luck (or lack thereof).
If this doesn't work with 2005, then I'm pretty sure there must be resources
online--by Microsoft or somebody else--for implementing the forms
authentication custom extension.
Hope this helps,
Mark
"Chris G." wrote:
> Mark,
> Will that sample run against 2005 Reporting Services with little or no
> modification?
> -- Chris, SSSI
>
> "Mark" wrote:
> > http://msdn.microsoft.com/library/?url=/library/en-us/dnsql2k/html/ufairs.asp?frame=true#ufairs_topic3
> >
> > "Chris G." wrote:
> >
> > > Is Report Manager designed to be accessed over the Internet, and if so, is
> > > there a forms based login that can be enabled?
> > >
> > > -- Chris, SSSI|||Hi Chris,
Thank you for you post and thanks Marks' help.
In the SQL Server 2005 Books online, there is a section about the Forms
Authentication in Reporting Services 2005.
Authentication in Reporting Services
http://msdn2.microsoft.com/en-us/library/ms152899.aspx
Also there is a sample in the SQL Server if you install the samples.
Security Extension Sample
http://msdn2.microsoft.com/en-us/library/ms160724.aspx
Hope this will be helpful!
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.

Can parameters be optional?

I have a report where when a user selects parameter1, parameter2 becomes
available because parameter2 is based on parameter1. My problem is, if the
user wishes to only run the report using parameter1, they will not select any
value from parameter2. Even though I have set parameter2 to be a sting that
allows nulls and blanks, when the user clicks on view report, nothing happens
untill a value for parameter2 is chosen. The source for parameter2 is a
stored procedure (query).
I would like the user to be able to only select the variables desired (even
though each is based off the previous selection). When the user clicks the
preview button, the source for the report should be able to determine the
exact query string (same columns always returned, just filtered depending on
parameters).
Any suggestions?
Thanks in advance.
BenTry creating a default value for Parameter2. That way, Parameter2 should be
valid.
Kaisa M. LIndahl Lervik
"Ben" <ben_1_ AT hotmail DOT com> wrote in message
news:E32843CD-548E-4D82-AA7B-A93E3B826971@.microsoft.com...
>I have a report where when a user selects parameter1, parameter2 becomes
> available because parameter2 is based on parameter1. My problem is, if
> the
> user wishes to only run the report using parameter1, they will not select
> any
> value from parameter2. Even though I have set parameter2 to be a sting
> that
> allows nulls and blanks, when the user clicks on view report, nothing
> happens
> untill a value for parameter2 is chosen. The source for parameter2 is a
> stored procedure (query).
> I would like the user to be able to only select the variables desired
> (even
> though each is based off the previous selection). When the user clicks
> the
> preview button, the source for the report should be able to determine the
> exact query string (same columns always returned, just filtered depending
> on
> parameters).
> Any suggestions?
> Thanks in advance.
> Ben|||Thank you for your reply.
I have tried that and Parameter2, even with a default value of NULL still
prevents the report from being viewed.
Any other suggestions?
I heard that if i UNION the query list with a record that uses a null value
that it might default to selecting that one.. any thoughts?
Thanks.
"Kaisa M. Lindahl Lervik" wrote:
> Try creating a default value for Parameter2. That way, Parameter2 should be
> valid.
> Kaisa M. LIndahl Lervik
> "Ben" <ben_1_ AT hotmail DOT com> wrote in message
> news:E32843CD-548E-4D82-AA7B-A93E3B826971@.microsoft.com...
> >I have a report where when a user selects parameter1, parameter2 becomes
> > available because parameter2 is based on parameter1. My problem is, if
> > the
> > user wishes to only run the report using parameter1, they will not select
> > any
> > value from parameter2. Even though I have set parameter2 to be a sting
> > that
> > allows nulls and blanks, when the user clicks on view report, nothing
> > happens
> > untill a value for parameter2 is chosen. The source for parameter2 is a
> > stored procedure (query).
> >
> > I would like the user to be able to only select the variables desired
> > (even
> > though each is based off the previous selection). When the user clicks
> > the
> > preview button, the source for the report should be able to determine the
> > exact query string (same columns always returned, just filtered depending
> > on
> > parameters).
> >
> > Any suggestions?
> > Thanks in advance.
> > Ben
>
>|||I haven't tried the UNION approach, but it sounds good to me.
Can you try it out, and just add it to a test section of Report Manager?
Kaisa M. Lindahl Lervik
"Ben" <ben_1_ AT hotmail DOT com> wrote in message
news:931631BD-C376-4374-9407-B329E073D67A@.microsoft.com...
> Thank you for your reply.
> I have tried that and Parameter2, even with a default value of NULL still
> prevents the report from being viewed.
> Any other suggestions?
> I heard that if i UNION the query list with a record that uses a null
> value
> that it might default to selecting that one.. any thoughts?
> Thanks.
> "Kaisa M. Lindahl Lervik" wrote:
>> Try creating a default value for Parameter2. That way, Parameter2 should
>> be
>> valid.
>> Kaisa M. LIndahl Lervik
>> "Ben" <ben_1_ AT hotmail DOT com> wrote in message
>> news:E32843CD-548E-4D82-AA7B-A93E3B826971@.microsoft.com...
>> >I have a report where when a user selects parameter1, parameter2 becomes
>> > available because parameter2 is based on parameter1. My problem is, if
>> > the
>> > user wishes to only run the report using parameter1, they will not
>> > select
>> > any
>> > value from parameter2. Even though I have set parameter2 to be a sting
>> > that
>> > allows nulls and blanks, when the user clicks on view report, nothing
>> > happens
>> > untill a value for parameter2 is chosen. The source for parameter2 is
>> > a
>> > stored procedure (query).
>> >
>> > I would like the user to be able to only select the variables desired
>> > (even
>> > though each is based off the previous selection). When the user clicks
>> > the
>> > preview button, the source for the report should be able to determine
>> > the
>> > exact query string (same columns always returned, just filtered
>> > depending
>> > on
>> > parameters).
>> >
>> > Any suggestions?
>> > Thanks in advance.
>> > Ben
>>