Showing posts with label parameters. Show all posts
Showing posts with label parameters. Show all posts

Friday, March 30, 2012

Print Multi table report with a range of parameters.

We have a work order print that is called from a web page using a URL. The
print consists of 4 tables. All of the recordsets use the same parameters
but come from different data sets. I have a request to make it print
multiple work orders at a time.
When I use a select for multiple work orders it prints it all in one set of
tables but I want a seperate set of tables for each work order. Is there a
way to group the tables together?
Any other ideas?You need to use a list control, and if your reports are in RS 2000, you need
to do some hand editing of the xml.
First create your list, then add the table which displays the actual data +
any textboxes for headings and such.
Then you mark your list, and set the Grouping property to the Work Order ID.
If you're working with RS 2005, right click on the list in the report,
choose Properties. Click on the "Edit Details Group" Button. Select "Page
Break at end". (Or start, if you want.)
If you're working with RS 2000, you need to hand edit your RDL like this:
Open the code version of the report
Find your list
In the Grouping section, add <PageBreakAtEnd>true</PageBreakAtEnd>
Your code should look something like this:
<List Name="List1">
<Style>
<FontFamily>Times New Roman</FontFamily>
<FontSize>18pt</FontSize>
<Color>Maroon</Color>
<FontWeight>900</FontWeight>
</Style>
<Top>0.875in</Top>
<Grouping Name="ListGrouping">
<GroupExpressions>
<GroupExpression>=Fields(Parameters!PageGroupingParameter1.Value).Value</GroupExpression>
<GroupExpression>=Fields(Parameters!PageGroupingParameter2.Value).Value</GroupExpression>
</GroupExpressions>
<PageBreakAtEnd>true</PageBreakAtEnd>
</Grouping>
Save the code, and test the report. Did it work?
Kaisa M. Lindahl Lervik
"msc" <matt@.dontspam.com> wrote in message
news:6C0D2B4C-DCED-4559-A849-18B260FA7C03@.microsoft.com...
> We have a work order print that is called from a web page using a URL.
> The
> print consists of 4 tables. All of the recordsets use the same parameters
> but come from different data sets. I have a request to make it print
> multiple work orders at a time.
> When I use a select for multiple work orders it prints it all in one set
> of
> tables but I want a seperate set of tables for each work order. Is there
> a
> way to group the tables together?
> Any other ideas?
>sql

Monday, March 26, 2012

PrimeOutput : difference between 'Output' and 'output buffer'

When overriding the PrimeOutput method in a custom component, you get as parameters the outputIDs and the output buffers (of type PipelineBuffer). using the outputIDs you can get IDTSOutput90 outputs.

As I interpret things, each output is associated with one output buffer. When you want to output rows, you add rows to the buffer. But what do you use the output (IDTSOutput90) for?

Regards,
HenkGood question. I'm keen to know the answer to this too.

-Jamie|||If you have more than one output on your component then you can use the order of the IDs and buffers (they are in the same order) to determine which buffer goes with which output. Obviously, there are other ways to do this but this makes it simple.

HTH,
Matt|||That was clear to me Matt, but what do you need an output for?|||Henk,

Maybe you have already come up with a answer, since there was no proper answer in the Thread, I will mention what I think.

IDTSOutput90 is used to Specify the MetaData of that particular output, using that Interface its possible to give the output columns' {Field}Name , Description, DataType, Length , etc..... which are the metadata of that Output.

The metadata will have to be specified if you are adding new columns to the Output, or else the metadata will be retrived by the earlier component.

When adding to the output buffer, the values will have to adhere to the metadata in the IDTSOutput90.

Hope this is the answer to your Question

Nilushan,sql

PrimeOutput : difference between 'Output' and 'output buffer'

When overriding the PrimeOutput method in a custom component, you get as parameters the outputIDs and the output buffers (of type PipelineBuffer). using the outputIDs you can get IDTSOutput90 outputs.

As I interpret things, each output is associated with one output buffer. When you want to output rows, you add rows to the buffer. But what do you use the output (IDTSOutput90) for?

Regards,
HenkGood question. I'm keen to know the answer to this too.

-Jamie|||If you have more than one output on your component then you can use the order of the IDs and buffers (they are in the same order) to determine which buffer goes with which output. Obviously, there are other ways to do this but this makes it simple.

HTH,
Matt|||That was clear to me Matt, but what do you need an output for?|||Henk,

Maybe you have already come up with a answer, since there was no proper answer in the Thread, I will mention what I think.

IDTSOutput90 is used to Specify the MetaData of that particular output, using that Interface its possible to give the output columns' {Field}Name , Description, DataType, Length , etc..... which are the metadata of that Output.

The metadata will have to be specified if you are adding new columns to the Output, or else the metadata will be retrived by the earlier component.

When adding to the output buffer, the values will have to adhere to the metadata in the IDTSOutput90.

Hope this is the answer to your Question

Nilushan,

Wednesday, March 7, 2012

previous week date parameters

Hope someone can help.
What i am trying to achieve is to bring in results from the previous Monday
to Friday into my report through the default paramters.
This would mean that any day this week that that i run the report, it would
bring in results for Monday to Friday last week.
Does anybody know of a way to achieve this using the default parameters.
ThanksThanks for your reply.
The code works well. It brings in the correct dates i.e. Monday to Friday
last week but the time comes in as the current time i.e. whenever the report
was run. Is there any way for it to ignore the time.
Thanks again
"Ameet" wrote:
> Try This
> Put this code in the Code Tab of Report Properties...
> ---
> Public Shared Function GetDate(Byval value as Double)
> value=(value)- Weekday(Now)
> GetDate=DateAdd("d", value, Now)
> End Function
> ----
> Now
> Create Two Parameters named 'StartDate' and 'EndDate'
> Change Datatype to DateTime
> Select 'Non-Queried' in Available Values Option and leave it blank
> Go to Default Values and select Non-Queried...
> for 'StartDate' Parameter put this value
> ---
> =Code.GetDate(-5)
> ---
> and for 'EndDate' Parameter use this
> ---
> =Code.GetDate(-1)
> ---
> I guess, this will solve your problem. Play around with the code and see if
> its possible using one parameter.. I am bit busy today...
>
> "pcalv" wrote:
> > Hope someone can help.
> >
> > What i am trying to achieve is to bring in results from the previous Monday
> > to Friday into my report through the default paramters.
> >
> > This would mean that any day this week that that i run the report, it would
> > bring in results for Monday to Friday last week.
> >
> > Does anybody know of a way to achieve this using the default parameters.
> >
> > Thanks|||I've not got any code example, but I've got an idea that might work.
Use code to find out what day of the week today is. Then subtract the
appropriate number of days from today to get last Monday. You would have
only 7 possibilities. For example, if today was Tuesday you would subtract
8, if today is Wednesday you would subtract 9. That would be your begin
date for the report, then add 5 to get your end date.
Hope this helps. Maybe?
"pcalv" <pcalv@.discussions.microsoft.com> wrote in message
news:E07BC00D-D05C-4E86-9462-252AEB95A3B1@.microsoft.com...
> I still haven't found a solution to this so if anyone could help out that
> would be great.
> Thanks Paul
>
> "Ameet" wrote:
> > Well I dont think you can go with only date having parameter data type
to
> > datetime. I am not sure though.. I would appreciate if someone could
help me
> > here..
> >
> > workaround is if you could use string datatype... change parameter
> > datatype to string .. and then add this line to the code function
> > ---
> > GetDate=FormatDateTime(GetDate,vbShortDate)
> > ---
> >
> > Actually it gave me error with parameter datatype to datetime.
> >
> > "REPORT PARAMETER DOES NOT HAVE THE EXPECTED VALUE"
> >
> > soo...this is what i could find out..
> >
> > anyhelp on this .. more than appreciated..
> >
> > "pcalv" wrote:
> >
> > > Thanks for your reply.
> > >
> > > The code works well. It brings in the correct dates i.e. Monday to
Friday
> > > last week but the time comes in as the current time i.e. whenever the
report
> > > was run. Is there any way for it to ignore the time.
> > >
> > > Thanks again
> > >
> > >
> > > "Ameet" wrote:
> > >
> > > > Try This
> > > >
> > > > Put this code in the Code Tab of Report Properties...
> > > > ---
> > > > Public Shared Function GetDate(Byval value as Double)
> > > > value=(value)- Weekday(Now)
> > > > GetDate=DateAdd("d", value, Now)
> > > > End Function
> > >
> ----
> > > >
> > > > Now
> > > >
> > > > Create Two Parameters named 'StartDate' and 'EndDate'
> > > >
> > > > Change Datatype to DateTime
> > > >
> > > > Select 'Non-Queried' in Available Values Option and leave it blank
> > > >
> > > > Go to Default Values and select Non-Queried...
> > > >
> > > > for 'StartDate' Parameter put this value
> > > > ---
> > > > =Code.GetDate(-5)
> > > > ---
> > > >
> > > > and for 'EndDate' Parameter use this
> > > > ---
> > > > =Code.GetDate(-1)
> > > > ---
> > > >
> > > > I guess, this will solve your problem. Play around with the code and
see if
> > > > its possible using one parameter.. I am bit busy today...
> > > >
> > > >
> > > > "pcalv" wrote:
> > > >
> > > > > Hope someone can help.
> > > > >
> > > > > What i am trying to achieve is to bring in results from the
previous Monday
> > > > > to Friday into my report through the default paramters.
> > > > >
> > > > > This would mean that any day this week that that i run the report,
it would
> > > > > bring in results for Monday to Friday last week.
> > > > >
> > > > > Does anybody know of a way to achieve this using the default
parameters.
> > > > >
> > > > > Thanks|||You can get the previous week's date using this expression:
=DateAdd(DateInterval.WeekOfYear, -1, Fields!Date.Value). From there, you
can derive the first and last day of the week. Check
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvbadev/html/findingbeginningorendofweek.asp
for details.
--
Ravi Mumulla (Microsoft)
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"pcalv" <pcalv@.discussions.microsoft.com> wrote in message
news:E07BC00D-D05C-4E86-9462-252AEB95A3B1@.microsoft.com...
> I still haven't found a solution to this so if anyone could help out that
> would be great.
> Thanks Paul
>
> "Ameet" wrote:
> > Well I dont think you can go with only date having parameter data type
to
> > datetime. I am not sure though.. I would appreciate if someone could
help me
> > here..
> >
> > workaround is if you could use string datatype... change parameter
> > datatype to string .. and then add this line to the code function
> > ---
> > GetDate=FormatDateTime(GetDate,vbShortDate)
> > ---
> >
> > Actually it gave me error with parameter datatype to datetime.
> >
> > "REPORT PARAMETER DOES NOT HAVE THE EXPECTED VALUE"
> >
> > soo...this is what i could find out..
> >
> > anyhelp on this .. more than appreciated..
> >
> > "pcalv" wrote:
> >
> > > Thanks for your reply.
> > >
> > > The code works well. It brings in the correct dates i.e. Monday to
Friday
> > > last week but the time comes in as the current time i.e. whenever the
report
> > > was run. Is there any way for it to ignore the time.
> > >
> > > Thanks again
> > >
> > >
> > > "Ameet" wrote:
> > >
> > > > Try This
> > > >
> > > > Put this code in the Code Tab of Report Properties...
> > > > ---
> > > > Public Shared Function GetDate(Byval value as Double)
> > > > value=(value)- Weekday(Now)
> > > > GetDate=DateAdd("d", value, Now)
> > > > End Function
> > >
> ----
> > > >
> > > > Now
> > > >
> > > > Create Two Parameters named 'StartDate' and 'EndDate'
> > > >
> > > > Change Datatype to DateTime
> > > >
> > > > Select 'Non-Queried' in Available Values Option and leave it blank
> > > >
> > > > Go to Default Values and select Non-Queried...
> > > >
> > > > for 'StartDate' Parameter put this value
> > > > ---
> > > > =Code.GetDate(-5)
> > > > ---
> > > >
> > > > and for 'EndDate' Parameter use this
> > > > ---
> > > > =Code.GetDate(-1)
> > > > ---
> > > >
> > > > I guess, this will solve your problem. Play around with the code and
see if
> > > > its possible using one parameter.. I am bit busy today...
> > > >
> > > >
> > > > "pcalv" wrote:
> > > >
> > > > > Hope someone can help.
> > > > >
> > > > > What i am trying to achieve is to bring in results from the
previous Monday
> > > > > to Friday into my report through the default paramters.
> > > > >
> > > > > This would mean that any day this week that that i run the report,
it would
> > > > > bring in results for Monday to Friday last week.
> > > > >
> > > > > Does anybody know of a way to achieve this using the default
parameters.
> > > > >
> > > > > Thanks

previous week date parameters

Hi,
Hope someone can help. I am trying to get the default value date parameters
for the previous working week. I then want to use these values while running
the report during the following week until the next Monday. I have almost got
it working with the following:
I put the following code in 'Report Properties>Code':
Public Shared Function GetDate(Byval value as Double)
value=(value)- Weekday(Now)
GetDate=DateAdd("d", value, Now)
End Function
and then the following parameters:
Date from: =Code.GetDate(-5)
Date to: =Code.GetDate(-1)
The only issue i have with this is that it brings in the following:
Date from: 08/11/2004 14:40:54
Date to: 12/11/2004 14:40:54
I don't want it to include the time though. Just the following:
Date from: 08/11/2004 00:00:00
Date to: 12/11/2004 00:00:00
Does anybody know how to get around this?
Any help would be appreciated.
PaulTo convert the date I use .ToShortDateString()
Example:
=Today.AddDays(-1).ToShortDateString()
"pcalv" wrote:
> Hi,
> Hope someone can help. I am trying to get the default value date parameters
> for the previous working week. I then want to use these values while running
> the report during the following week until the next Monday. I have almost got
> it working with the following:
> I put the following code in 'Report Properties>Code':
> Public Shared Function GetDate(Byval value as Double)
> value=(value)- Weekday(Now)
> GetDate=DateAdd("d", value, Now)
> End Function
> and then the following parameters:
> Date from: =Code.GetDate(-5)
> Date to: =Code.GetDate(-1)
> The only issue i have with this is that it brings in the following:
> Date from: 08/11/2004 14:40:54
> Date to: 12/11/2004 14:40:54
> I don't want it to include the time though. Just the following:
> Date from: 08/11/2004 00:00:00
> Date to: 12/11/2004 00:00:00
> Does anybody know how to get around this?
> Any help would be appreciated.
> Paul
>|||Thanks for the reply. Unfortunately this does not work with the custom code i
am using.
Any other help would be appreciated.
Paul
"datobin1" wrote:
> To convert the date I use .ToShortDateString()
> Example:
> =Today.AddDays(-1).ToShortDateString()
>
> "pcalv" wrote:
> > Hi,
> >
> > Hope someone can help. I am trying to get the default value date parameters
> > for the previous working week. I then want to use these values while running
> > the report during the following week until the next Monday. I have almost got
> > it working with the following:
> >
> > I put the following code in 'Report Properties>Code':
> >
> > Public Shared Function GetDate(Byval value as Double)
> > value=(value)- Weekday(Now)
> > GetDate=DateAdd("d", value, Now)
> > End Function
> >
> > and then the following parameters:
> >
> > Date from: =Code.GetDate(-5)
> > Date to: =Code.GetDate(-1)
> >
> > The only issue i have with this is that it brings in the following:
> >
> > Date from: 08/11/2004 14:40:54
> > Date to: 12/11/2004 14:40:54
> >
> > I don't want it to include the time though. Just the following:
> >
> > Date from: 08/11/2004 00:00:00
> > Date to: 12/11/2004 00:00:00
> >
> > Does anybody know how to get around this?
> >
> > Any help would be appreciated.
> >
> > Paul
> >
> >

Saturday, February 25, 2012

Previous Business Day

At the moment, I have a report that's using "=Today.AddDays(-1)" to return
yesterday's date in the date range parameters, but the client has now come
back and requested that they would prefer not to use weekends...e.g.: loading
the report on Monday should show last Friday's date.
Can this be done?
Thanks in advance.
Jadranka Krapic
DBA
Stargate Technologies
(www.stargatetech.com.au)Hi,
Write simple custom code function
Function GetDate() As Date
Select Case Today.DayOfWeek
Case DayOfWeek.Monday
GetDate = Today.Date.AddDays(-3)
Case Else
GetDate = Today.Date.AddDays(-1)
End Select
End Function
And as parameter label and value put
=Code.GetDate()
Hope this help.
Best regards,
Dejan Lukovic
"Jadranka" <Jadranka@.discussions.microsoft.com> escribió en el mensaje
news:03C3F8BF-1EC8-420B-81D9-106D94D608A1@.microsoft.com...
> At the moment, I have a report that's using "=Today.AddDays(-1)" to return
> yesterday's date in the date range parameters, but the client has now come
> back and requested that they would prefer not to use weekends...e.g.:
loading
> the report on Monday should show last Friday's date.
> Can this be done?
> Thanks in advance.
> Jadranka Krapic
> DBA
> Stargate Technologies
> (www.stargatetech.com.au)

Preview is better than web browser in this case

I like the functionality in the preview - that if all the parameters
have a valid value... it starts the query without pressing 'View
Report'.
Whereas in a published report in a browser, I always have to press the
'view report'.
In some cases one is better than the other - specially if the query is
small... but navigation needs to be faster.
I have repeatedly asked this question - without any answers.
But if it works in Preview... why not in the browser...'
Seems like there is setting... but no documentation...
I think we need both the options.Yes, we have struggled to answer this questions ourselves. We keep coming
back to this and will take your comments into consideration for sure. To
explain:
The problem is that on the server, there is really no way to stop the
execution of the query that was spawned by requesting a particular report.
So if you have all the defaults specified, then (for a live report) the
server will immediately kick off a report execution. This will inturn
execute the query. That query could take some time to run. Now, if the
user wants to change the values from default before the report finishes
executing, s/he might just click stop on the browser, change the paramters,
and click view report. Now due to how the browser works, the server
doesn't know the user has changed their minds. To the server it is just
another request. So now you have 2 report executions occuring for the same
user. The orignal request eventually will be killed on the report server
(once we realize the connection is closed/stale) but that still leaves the
long running query on the DB server.
So in effect by automatically running the report with the default parameters
you're increasing load significantly on the server. Now imagine how this
affects the system when you scale to 1000's of users.
In the designer, you don't have the same problem so you're more free to do
increase responsivness.
-Lukasz
This posting is provided "AS IS" with no warranties, and confers no rights.
"Harsh" <creative@.mailcity.com> wrote in message
news:fa671a26.0407221045.28cb83ac@.posting.google.com...
>I like the functionality in the preview - that if all the parameters
> have a valid value... it starts the query without pressing 'View
> Report'.
> Whereas in a published report in a browser, I always have to press the
> 'view report'.
> In some cases one is better than the other - specially if the query is
> small... but navigation needs to be faster.
> I have repeatedly asked this question - without any answers.
> But if it works in Preview... why not in the browser...'
> Seems like there is setting... but no documentation...
> I think we need both the options.|||I would say - give those controls to the designer.
Let him/her decide -
1. On Default parameters - should execute immediately or not
2. On Change selection - should execute immediately or not
- parameter wise control. I.e. decide whether a particular
parameter should execute the report immediately or not
Provide with a control with each parameter.
Cascading parameters should have that option also - Specially if
selection of Parameter 1 leads to default of Parameter 2.
- In which case - first of all the "dependency" should be explicitly
defined.
- And then - whether to execute the report immediately or not - could
also be a designers choice.
Just some thoughts...

Preview bug with default params

I have a bunch of reports with four parameters, two integers and two
datetimes. They don't have defaults. I have gone through them and added
another parameter, a string, nullable, with a default of =String.Empty (the
purpose of this is to have a parameter in which I can pass a unique ID, to
avoid caching). When I go to the preview tab in Report Designer, I enter
one of the default-less integer parameters. The parameter section flickers
once. Then I enter the next parameter value. The parameter section now
flickers endlessly, and Visual Studio stops responding. I have to have
Windows forcibly close it down.
If I go to http://localhost/Reports and navigate to the report, I enter the
first parameter value in the textbox, but when I try to move to the next
(hit Tab or click the mouse in the second parameter's input box), I get an
error page: "Reporting Services Error The value provided for the report
parameter <second parameter name here> is not valid for its type.
(rsReportParameterTypeMismatch)". I can hit the browser's Back button and
the value I've entered for the first parameter is still there, so I go to
enter the next parameter value, and then try to move to the third. New
error message about the third parameter, click Back, enter third parameter.
New error message about the fourth parameter, click Back, enter parameter.
What's interesting is up until this point, the text box for the new, default
parameter is disabled. But when I enter the fourth default-less parameter,
the browser clicks and the page refreshes, and now I can enter a value for
the last parameter if I want.DJM,
Sounds like the subsequent param appear dependent on the previous param.
This could lead to the error message being generated, and also the last param
box being disabled prior to the fourth param entry.
I have not suffered this particular problem as I have no linked params.
Hope this assists,
Tony
"DJM" wrote:
> I have a bunch of reports with four parameters, two integers and two
> datetimes. They don't have defaults. I have gone through them and added
> another parameter, a string, nullable, with a default of =String.Empty (the
> purpose of this is to have a parameter in which I can pass a unique ID, to
> avoid caching). When I go to the preview tab in Report Designer, I enter
> one of the default-less integer parameters. The parameter section flickers
> once. Then I enter the next parameter value. The parameter section now
> flickers endlessly, and Visual Studio stops responding. I have to have
> Windows forcibly close it down.
> If I go to http://localhost/Reports and navigate to the report, I enter the
> first parameter value in the textbox, but when I try to move to the next
> (hit Tab or click the mouse in the second parameter's input box), I get an
> error page: "Reporting Services Error The value provided for the report
> parameter <second parameter name here> is not valid for its type.
> (rsReportParameterTypeMismatch)". I can hit the browser's Back button and
> the value I've entered for the first parameter is still there, so I go to
> enter the next parameter value, and then try to move to the third. New
> error message about the third parameter, click Back, enter third parameter.
> New error message about the fourth parameter, click Back, enter parameter.
> What's interesting is up until this point, the text box for the new, default
> parameter is disabled. But when I enter the fourth default-less parameter,
> the browser clicks and the page refreshes, and now I can enter a value for
> the last parameter if I want.
>
>|||How so? It's a brand-new parameter; the existing ones don't reference it in
any way. In fact, *nothing* references this parameter.
"Logicalman" <tony9scott45us@.com7cast.net34> wrote in message
news:E96EC3A4-7308-4AD6-A2C3-F11ADD818D71@.microsoft.com...
> DJM,
> Sounds like the subsequent param appear dependent on the previous param.
> This could lead to the error message being generated, and also the last
> param
> box being disabled prior to the fourth param entry.
> I have not suffered this particular problem as I have no linked params.
> Hope this assists,
> Tony
>
> "DJM" wrote:
>> I have a bunch of reports with four parameters, two integers and two
>> datetimes. They don't have defaults. I have gone through them and added
>> another parameter, a string, nullable, with a default of =String.Empty
>> (the
>> purpose of this is to have a parameter in which I can pass a unique ID,
>> to
>> avoid caching). When I go to the preview tab in Report Designer, I enter
>> one of the default-less integer parameters. The parameter section
>> flickers
>> once. Then I enter the next parameter value. The parameter section now
>> flickers endlessly, and Visual Studio stops responding. I have to have
>> Windows forcibly close it down.
>> If I go to http://localhost/Reports and navigate to the report, I enter
>> the
>> first parameter value in the textbox, but when I try to move to the next
>> (hit Tab or click the mouse in the second parameter's input box), I get
>> an
>> error page: "Reporting Services Error The value provided for the report
>> parameter <second parameter name here> is not valid for its type.
>> (rsReportParameterTypeMismatch)". I can hit the browser's Back button
>> and
>> the value I've entered for the first parameter is still there, so I go to
>> enter the next parameter value, and then try to move to the third. New
>> error message about the third parameter, click Back, enter third
>> parameter.
>> New error message about the fourth parameter, click Back, enter
>> parameter.
>> What's interesting is up until this point, the text box for the new,
>> default
>> parameter is disabled. But when I enter the fourth default-less
>> parameter,
>> the browser clicks and the page refreshes, and now I can enter a value
>> for
>> the last parameter if I want.
>>