Showing posts with label header. Show all posts
Showing posts with label header. Show all posts

Thursday, March 29, 2012

Dynamic Report Title and keeping it centered

I have a text box in a header for my report title, its reads something like this:

=RTRIM( Parameters!state.Value) + " Summary of Total Trust Assets - Sorted by Industry"

Although I have the textbox centered in the page, since the state.value is dynamic the lenght of the state name could be different than throwing off how centered the title appears? I am pulling my hair out trying to figure out a solution and would greatly appreciate any help or knowledge people might pass on.

Thanks

Duane

Center the textbox horizontally on the page, and also center the text inside the textbox (center justified). It should work.

dynamic report header and detail

I am building a report which has 7 columns. Mon thru Sun. The header and data columns are dynamic

For ex the report looks like

Mon Tue Wed Thu Fri Sat Sun

-- - -- - --

2 2 4 2 4 5 6

0 7 6 7 9 4 2

The report header and data are dynamic. The seq of columns,data is not always the same. It could be Tue thru Mon., or Fri thru Thru...etc...

Please advice how to program this dynamic nature of the report

This is a matrix report with a group on day of the week.

Tuesday, March 27, 2012

dynamic report header and detail

I am building a report which has 7 columns. Mon thru Sun. The header and data columns are dynamic

For ex the report looks like

Mon Tue Wed Thu Fri Sat Sun

-- - -- - --

2 2 4 2 4 5 6

0 7 6 7 9 4 2

The report header and data are dynamic. The seq of columns,data is not always the same. It could be Tue thru Mon., or Fri thru Thru...etc...

Please advice how to program this dynamic nature of the report

This is a matrix report with a group on day of the week.sql

Dynamic report

Dear all,
I want to create a dynamic report so that I can change some field quickly.
For example: in future, if Field {Report ID} on report header is replaced by {Running User ID}. How can I do once for all reports.
Many thanksWill this work? The idea is to only maintain data in the table.

1. setup a database table that contains user-id and names etc.
2. create a string variable in the report for display.
3. write a routine to detect for the requires condition and pull data off the table.
4. for each report, plug in the same codes created in step-2.

Hope it works for you.

Thursday, March 22, 2012

Dynamic Page Header Height...

Group,
Does anyone know how to set the height of the Page Header dynamically, it's
not letting me set the Height property of the Page Header to an Expression
[something like = IIf(Globals!PageNumber = 1, 1.5in, 1in)?
Or is there any other way to achieve the following:
I want a certain page header on page 1 and then a different one (shorter in
height) to appear on all subsequent pages without the extra header
whitespace.
Thanks group.As far as I know report header is static - I think it is on the wish list for
the next release. [I saw a post on this from msft - search around & you will
see it]
"Terry Mulvany" wrote:
> Group,
> Does anyone know how to set the height of the Page Header dynamically, it's
> not letting me set the Height property of the Page Header to an Expression
> [something like = IIf(Globals!PageNumber = 1, 1.5in, 1in)?
> Or is there any other way to achieve the following:
> I want a certain page header on page 1 and then a different one (shorter in
> height) to appear on all subsequent pages without the extra header
> whitespace.
> Thanks group.
>
>

Monday, March 19, 2012

Dynamic image in my header

HI ,

I need to change the image in my header and footer depending on the sectionid. Is it possible ? how ?

thanks in advance

Chk out this blog on loading images

http://technoblab.blogspot.com

.........................................................................................

remember to "Mark As Answer" if the post helped you

|||

you do this easily in reporting service bu IIf statement check this article for complete example

http://blog.toddtaylor.com/PermaLink,guid,b1517702-ad4b-48e1-a6e3-b736e8a982cb.aspx

Dynamic header column names in Excel

Folks,

I am running into an issue while trying to export data to a spreadsheet. I actually don't know how to do it... Considering I only know the column names by the time I execute my procedure, I can't use the Excel Destination to export data.

With DTSs I would create an ActiveX script to execute the procedure which loads the results into a temp table. After that I would select everything from this temp table and load the results into a record set, looping through this record set to create the destination spreadsheet with the dynamic column names.

When it comes to SSIS we are advised to write vb.net scripts instead of ActiveX... These ones do not have records set's but dataset's, which at first glance are only applicable to xml and not xls files (when I try to define a variable as a dataset in my vb.net code, I face a message saying: Missing reference required to assembly System.Xml...).

How I would create this spreadsheet using a vb.net code in SSIS packages? Please, help...

Thank you.

I am afraid that is something that is not that easy in SSIS. Jamie, has a serie of posts that talk about some differences with DTS:

http://blogs.conchango.com/jamiethomson/archive/2006/06/28/4156.aspx

In SSIS the data flow needs to know the column metadata at design time. One option could be to generate packages programatically. Books on line has a chapter about that.

|||

Hi:

I have a related problem. I have multiple packages, but only a single table structure, and so I worked around by making a template XLS file, and using a filesystem task to make copies. The template has the required col headers.

Now the problem is that when a data structure changes, I have to re-do all my packages to incorporate the changed metadata.

Your problem description gave me an idea, and I am planning to try out the following:

1. Execute SQL task to call a stored procedure that drops my temp_table, and then inserts my resultset into temp_table (which now has all the columns required).

2. Have a script task that makes a ADO.net connection, gets a dataset, saves my data from temp_table to an XML file, creates a new XLS file, and calls the OpenXML method to open my data in the excel.

This will probably need VSTO installed on the same machine as BIDS. Since the Script Task only allows reference to managed assemblies from a particular path(s), I would need to create a custom .net DLL and store in those paths. The .net DLL will internally use Office Interop COM if I have office 2003 or lower.

Else I could simply save XML files and associate XML files with Excel by default.

I had done something similar in VB.net, and the only problem I see is that the XLS files thus created are bloated. Opening them and saving them again can compress the file to around half its size.

Does this approach look feasible? Maybe the gurus on this forum can point out flaws in this?

HTH

Kar

|||

Rafael and Karfast -

I really appreciate your replies. I took a look at Jamie's post mentioned by Rafael and I am just speechless. My concern in this migration from DTS to SSIS is all what we had in DTS and we are not having in SSIS. I truly understand some losses are needed towards a better final result but this case for an example (dynamic header column names) really seems not to be possible to be implemented in SSIS, or at least will require a lot of code intelligence versus something that was really simple in DTS.

I work for EDS and DBAs here are saying we will migrate soon for the next SQL Server 2005 version (which does not support DTS) and I am just deadly scared of what is gonna happen when we truly have to migrate all our packages.

I wonder why Microsoft still has these surprises for us and maybe this is something that they were willing to change in SSIS? As Karfast said, I guess I will wait for our SSIS gurus to discuss this a little bit more.

Thanks to all.

|||

Gabriel,

Perhaps few functionalities have been changed from DTS, but personally SSIS has a lot more potential to become an Enterprise ETL platform. How familiar are you with SSIS at this point? perhaps you should look a little bit into the all other features it offers. I never used DTS, but I cerntarly understand how surprising is to find out that something like that is missing.

Dynamic Grouping Group Header Problem

Hi, I am currently trying to create a report the dynamicaly groups from parameters. The grouping part works fine but I need to show the parameter label name or the field referenced by a parameter.

=iif(Parameters!Param1.Value="P",Parameters!Param2.Label,Fields(Parameters!Param1.Value).Value)

This is the expression I have written to do this. The problem seems to be is with the true part of the iif statement. The false displays fine in the group header. The Parameters!Param2.Label also displays if used on its own.

This is the error that is fires back when I run the report.

The Value expression for the textbox ‘textbox4’ contains an error: The expression referenced a non-existing field in the fields collection.

I am quite new to SSRS and I am using VS2005 pro.

Thanks


D

D,

Try

iif(Parameters!Param1.Value="P",Fields(Parameters!Param2.Label).Value,Fields(Parameters!Param1.Value).Value)

I believe this should work for you.

Ham

Sunday, March 11, 2012

dynamic field value

Hello,
In the page header I have a textbox whose value I want to change based on
the parameter. If param=1 then I want the value of the textbox to be Invoice
otherwise I want it to be 'B/S'.
How can I change the value of the textbox?
Thankstry setting the value property of the textbox to something like
=IIF(Parameters!Param_1.Value=1,"Invoice ","B\S")
inova. SOLUTIONS
Peter Jacobs MCSE MCDBA MCT
Güterstrasse 5/7
CH-3072 Ostermundigen
"collie" <collie@.discussions.microsoft.com> wrote in message
news:110178DB-C794-414C-B8FF-6E4448714494@.microsoft.com...
> Hello,
> In the page header I have a textbox whose value I want to change based on
> the parameter. If param=1 then I want the value of the textbox to be
> Invoice
> otherwise I want it to be 'B/S'.
> How can I change the value of the textbox?
> Thanks|||You can use report parameters for doing this. Add a report parameter to your
report. Then refer the report parameter in your jump to url option as
=Parameters!WebServerPath.Value + "?Id=" + Trim( Fields!ID.Value)
Where "WebServerPath" is ur report parameter and "Id" is your row value
which u want to pass it to the new page.
Hope this helps.
"collie" wrote:
> Hello,
> In the page header I have a textbox whose value I want to change based on
> the parameter. If param=1 then I want the value of the textbox to be Invoice
> otherwise I want it to be 'B/S'.
> How can I change the value of the textbox?
> Thanks|||Thanks guys
"Rajan" wrote:
> You can use report parameters for doing this. Add a report parameter to your
> report. Then refer the report parameter in your jump to url option as
> =Parameters!WebServerPath.Value + "?Id=" + Trim( Fields!ID.Value)
> Where "WebServerPath" is ur report parameter and "Id" is your row value
> which u want to pass it to the new page.
> Hope this helps.
>
> "collie" wrote:
> > Hello,
> >
> > In the page header I have a textbox whose value I want to change based on
> > the parameter. If param=1 then I want the value of the textbox to be Invoice
> > otherwise I want it to be 'B/S'.
> > How can I change the value of the textbox?
> >
> > Thanks

Friday, March 9, 2012

Dynamic Expression

I would like to display calculated field on a group header.
The nature of the calculation must be passed as a parameter to the report.
For example lets assume that my report lists X,Y pairs.
On the break I would like to display the value of
Sum(X)/Sum(Y) or Sum(X/Y) or Sum(X*Y) or Sum(X)*SUM(Y).
It is not practical to prepare an expression for every possible option and
use a selector as X,Y are also dynamically selected values from the query.
So I need a dynamic way to define the expression based on input parameters.
Is Custom code is the way to go ? How do I access the Parameters collection,
and the Report's data from Custom code ?
Any Ideas ?
Thanks.I think that custom code will be needed. You can pass the values you need
(Parameters, Report Data) in as parameters to a function.
"NL" wrote:
> I would like to display calculated field on a group header.
> The nature of the calculation must be passed as a parameter to the report.
> For example lets assume that my report lists X,Y pairs.
> On the break I would like to display the value of
> Sum(X)/Sum(Y) or Sum(X/Y) or Sum(X*Y) or Sum(X)*SUM(Y).
> It is not practical to prepare an expression for every possible option and
> use a selector as X,Y are also dynamically selected values from the query.
> So I need a dynamic way to define the expression based on input parameters.
> Is Custom code is the way to go ? How do I access the Parameters collection,
> and the Report's data from Custom code ?
> Any Ideas ?
> Thanks.
>
>
>
>
>
>|||How does one create a custom function that manipulates the headers of a
report based on parameter values?
"John W" wrote:
> I think that custom code will be needed. You can pass the values you need
> (Parameters, Report Data) in as parameters to a function.
> "NL" wrote:
> > I would like to display calculated field on a group header.
> > The nature of the calculation must be passed as a parameter to the report.
> >
> > For example lets assume that my report lists X,Y pairs.
> > On the break I would like to display the value of
> > Sum(X)/Sum(Y) or Sum(X/Y) or Sum(X*Y) or Sum(X)*SUM(Y).
> >
> > It is not practical to prepare an expression for every possible option and
> > use a selector as X,Y are also dynamically selected values from the query.
> > So I need a dynamic way to define the expression based on input parameters.
> >
> > Is Custom code is the way to go ? How do I access the Parameters collection,
> > and the Report's data from Custom code ?
> >
> > Any Ideas ?
> >
> > Thanks.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >|||The previous question was asking about display a calculated field on a group
header. You can do this by adding a field to the group header that references
a function defined in VB.NET code in the Report Properties Code tab.
Code sample:
Public Function GetDoubledValue(ByVal NumToDouble As Int) As String
Return CStr(NumToDouble * 2)
End Function
Field Reference:
=Code.GetDoubledValue(4)
"Leneise44" wrote:
> How does one create a custom function that manipulates the headers of a
> report based on parameter values?
> "John W" wrote:
> > I think that custom code will be needed. You can pass the values you need
> > (Parameters, Report Data) in as parameters to a function.
> >
> > "NL" wrote:
> >
> > > I would like to display calculated field on a group header.
> > > The nature of the calculation must be passed as a parameter to the report.
> > >
> > > For example lets assume that my report lists X,Y pairs.
> > > On the break I would like to display the value of
> > > Sum(X)/Sum(Y) or Sum(X/Y) or Sum(X*Y) or Sum(X)*SUM(Y).
> > >
> > > It is not practical to prepare an expression for every possible option and
> > > use a selector as X,Y are also dynamically selected values from the query.
> > > So I need a dynamic way to define the expression based on input parameters.
> > >
> > > Is Custom code is the way to go ? How do I access the Parameters collection,
> > > and the Report's data from Custom code ?
> > >
> > > Any Ideas ?
> > >
> > > Thanks.
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >

Sunday, February 26, 2012

Dynamic Data in Page Header?

Hi all,
is there's a way to add fields to the Page Header?
We have to display dynamic data on each page...
Thanks
ThomasThomas,
What kind of data is this? If its a calculation, global parameter,
date, or parameters passed in, this is very easy by adding an
expression(Somehting like: Parameters!Param1.Value).
If its Fields, then you can create a group, and place that field in the
group header - but you must group it by some field.
Then Left Click on that row(the group header) and set
theRepeatOnEveryPage property to true.
I hope this helps.
regards,
Stas K.|||Hi Thomas
No, you cannot add data fields to the Page Header, because it cannot have a
defined dataset. However, depending on the your data and how you want to
display it, here is a another solution:
1) get rid of the page header section of the report,
2) in the body of the report, use a table as the main container and make it
as wide as the width of the report, and make the table top start at the very
top of the report.
3) define the dataset for that table in the properties
4) add a table header row, and use that as the "page header". Make sure to
check the "Repeat on New page" option for the header row properties.
5) select all cells in the header row, and merge them.
6) drop a rectangle in the newly merged header cell, and voila, you have a
freeform container for your cell, so you can drop textboxes in there, etc...
In most of my reports, I have done that, instead of using a page header,
since in most cases I need to use a datafield as part of the header anyways.
You can have several header rows defined for each section in a table kinda
like this:
<table>
<tblHeader1>
<tblHeader2>
<tbleHeader3>
<group1Header1>
<group1Header2>
<group2Header1>
<group2Header2>
<detailRow>
<group2Footer1>
<group2Footer2>
<group1Footer1>
<group1Footer2>
<tblFooter1>
<tblFooter2>
</table>
Hope that helps ya.
--
Regards,
Thiago Silva
"Thomas" wrote:
> Hi all,
> is there's a way to add fields to the Page Header?
> We have to display dynamic data on each page...
> Thanks
> Thomas
>
>

Friday, February 17, 2012

Dynamic Column header in CASE statement

Hello,
Can you dynamically change the header name in a CASE statement? In the
following, I would like to be able to change the column header depending on
what the value of @.Actual is.
Thanks in advance, Steven
DECLARE @.strParm02 VARCHAR(20), @.strParm03 VARCHAR(20)
DECLARE @.Actual VARCHAR(20), @.Forecast VARCHAR(20)
SET @.strParm03 = 'Direct'
SET @.Actual = 'Actual-' + @.strParm03
SET @.Forecast = 'Forecast-' + @.strParm03
SELECT SUM(CASE WHEN RevType = @.Actual THEN AnnRev ELSE 0 END) AS @.Actual
From MyTable
"sck10" <sck10@.online.nospam> wrote in message
news:emwZ%231IRGHA.3972@.TK2MSFTNGP10.phx.gbl...
> Hello,
> Can you dynamically change the header name in a CASE statement? In the
> following, I would like to be able to change the column header depending
> on
> what the value of @.Actual is.
> Thanks in advance, Steven
>
> DECLARE @.strParm02 VARCHAR(20), @.strParm03 VARCHAR(20)
> DECLARE @.Actual VARCHAR(20), @.Forecast VARCHAR(20)
> SET @.strParm03 = 'Direct'
> SET @.Actual = 'Actual-' + @.strParm03
> SET @.Forecast = 'Forecast-' + @.strParm03
> SELECT SUM(CASE WHEN RevType = @.Actual THEN AnnRev ELSE 0 END) AS @.Actual
> From MyTable
>
No. Column names are determined at compile time. Why not just display a name
dynamically in your client application?
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
|||Hi sck,
Welcome to use MSDN Managed Newsgroup Support. And thanks David's great
reply.
From your description, my understanding of this issue is: You want to
dynamically change the header name. If I misunderstood your concern, please
feel free to point it out.
As David mentioned, you can not change the column name directly in a sql
statement. But there is a way to do it.
For example:
DECLARE @.colname as varchar(50)
DECLARE @.cmd as varchar(8000)
SET @.cmd = 'select columnName as '+ @.colname + ' from Mytable'
EXEC (@.cmd)
If you chagne the @.colname , the sql statement you execute will change. I
think this might meet your request.
Hope this will be helpful!
Wei Lu
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
================================================== ===
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.

Dynamic Column header in CASE statement

Hello,
Can you dynamically change the header name in a CASE statement? In the
following, I would like to be able to change the column header depending on
what the value of @.Actual is.
Thanks in advance, Steven
DECLARE @.strParm02 VARCHAR(20), @.strParm03 VARCHAR(20)
DECLARE @.Actual VARCHAR(20), @.Forecast VARCHAR(20)
SET @.strParm03 = 'Direct'
SET @.Actual = 'Actual-' + @.strParm03
SET @.Forecast = 'Forecast-' + @.strParm03
SELECT SUM(CASE WHEN RevType = @.Actual THEN AnnRev ELSE 0 END) AS @.Actual
From MyTable"sck10" <sck10@.online.nospam> wrote in message
news:emwZ%231IRGHA.3972@.TK2MSFTNGP10.phx.gbl...
> Hello,
> Can you dynamically change the header name in a CASE statement? In the
> following, I would like to be able to change the column header depending
> on
> what the value of @.Actual is.
> Thanks in advance, Steven
>
> DECLARE @.strParm02 VARCHAR(20), @.strParm03 VARCHAR(20)
> DECLARE @.Actual VARCHAR(20), @.Forecast VARCHAR(20)
> SET @.strParm03 = 'Direct'
> SET @.Actual = 'Actual-' + @.strParm03
> SET @.Forecast = 'Forecast-' + @.strParm03
> SELECT SUM(CASE WHEN RevType = @.Actual THEN AnnRev ELSE 0 END) AS @.Actual
> From MyTable
>
No. Column names are determined at compile time. Why not just display a name
dynamically in your client application?
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--|||Hi sck,
Welcome to use MSDN Managed Newsgroup Support. And thanks David's great
reply.
From your description, my understanding of this issue is: You want to
dynamically change the header name. If I misunderstood your concern, please
feel free to point it out.
As David mentioned, you can not change the column name directly in a sql
statement. But there is a way to do it.
For example:
DECLARE @.colname as varchar(50)
DECLARE @.cmd as varchar(8000)
SET @.cmd = 'select columnName as '+ @.colname + ' from Mytable'
EXEC (@.cmd)
If you chagne the @.colname , the sql statement you execute will change. I
think this might meet your request.
Hope this will be helpful!
Wei Lu
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
========================================
=============
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.

Dynamic Column header in CASE statement

Hello,
Can you dynamically change the header name in a CASE statement? In the
following, I would like to be able to change the column header depending on
what the value of @.Actual is.
Thanks in advance, Steven
DECLARE @.strParm02 VARCHAR(20), @.strParm03 VARCHAR(20)
DECLARE @.Actual VARCHAR(20), @.Forecast VARCHAR(20)
SET @.strParm03 = 'Direct'
SET @.Actual = 'Actual-' + @.strParm03
SET @.Forecast = 'Forecast-' + @.strParm03
SELECT SUM(CASE WHEN RevType = @.Actual THEN AnnRev ELSE 0 END) AS @.Actual
From MyTable"sck10" <sck10@.online.nospam> wrote in message
news:emwZ%231IRGHA.3972@.TK2MSFTNGP10.phx.gbl...
> Hello,
> Can you dynamically change the header name in a CASE statement? In the
> following, I would like to be able to change the column header depending
> on
> what the value of @.Actual is.
> Thanks in advance, Steven
>
> DECLARE @.strParm02 VARCHAR(20), @.strParm03 VARCHAR(20)
> DECLARE @.Actual VARCHAR(20), @.Forecast VARCHAR(20)
> SET @.strParm03 = 'Direct'
> SET @.Actual = 'Actual-' + @.strParm03
> SET @.Forecast = 'Forecast-' + @.strParm03
> SELECT SUM(CASE WHEN RevType = @.Actual THEN AnnRev ELSE 0 END) AS @.Actual
> From MyTable
>
No. Column names are determined at compile time. Why not just display a name
dynamically in your client application?
--
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--|||Hi sck,
Welcome to use MSDN Managed Newsgroup Support. And thanks David's great
reply.
From your description, my understanding of this issue is: You want to
dynamically change the header name. If I misunderstood your concern, please
feel free to point it out.
As David mentioned, you can not change the column name directly in a sql
statement. But there is a way to do it.
For example:
DECLARE @.colname as varchar(50)
DECLARE @.cmd as varchar(8000)
SET @.cmd = 'select columnName as '+ @.colname + ' from Mytable'
EXEC (@.cmd)
If you chagne the @.colname , the sql statement you execute will change. I
think this might meet your request.
Hope this will be helpful!
Wei Lu
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
=====================================================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.