Showing posts with label columns. Show all posts
Showing posts with label columns. Show all posts

Wednesday, March 28, 2012

Report Page Width with Dynamic columns through parameters

I found the following paragraph while searching on here:

************************************************************************
You could easily set up a parameter for each column and then display that column conditionally based on the parameter.

For instance, if you have a column that displays First Name, you could have a parameter called DisplayFirstName. Then in design view you'd select the whole FirstName column and in the Visibility-Hidden property set it to :

=iif( Parameters!DisplayFirstName.Value = false, true, false )

This could easily become a big, unwieldy report, though, if you have a great number of dynamic columns. Also, The width of the report is set at design time, and it includes the width of all your columns, not just the visible ones. This could cause you some pagination problems.
************************************************************************

That is exactly my problem. I have lots of dynamic columns which causes the width of the report to be wide. Thus even though at run time the report only shows columns within a page, the report itself consists of a lot of white spaces after the selected columns. Does anyone know a solution to this? If not, I guess creating the rdl with code manually is the only way? Please advise. Thanks in advance.

- Will

I summarize your requirement that I have understood and based on that I given you my comment if my understanding is wrong then let me know.

Your requirement is to design a report in which columns are visible on some condition or dynamically. You have design the report and set the column property visible = ‘TRUE’ OR FALSE based on the condition. Let assume the problem is that when col1 is visible that time col2 is invisible due to this a white space is left in place of col2 and you want to remove that white space.

My comment:

Take the above scenario if col1 is visible and col2 is invisible and vice a versa then place the col2 over col1 so then col2 is visible then col1 will be invisible and if the col1 is visible then col2 is invisible. And you will not see any white pace in the report.

|||Hi mverma,

First let me thank you for replying to me. Let me clarify my requirements just to make sure what you are proposing would solve my problem.

I have a report, which at design time, would span 2 physical pages (17 inches), with each column being the same width.
Now, the columns' visibility is toggled by parameters passed to the report page during run time.

Now the problem.
Lets say for one of the report we pass in parameters to toggle on columns 1,3,5,7, so the total width would be 8.5 inches, which would fit exactly on one page. So when choosing to print, it would print one page with the 4 columns (with no spaces between the columns), and one blank page. The blank page is printed because, during design time, the report is set to be 17 inches wide, thus even only 8.5 inches of the report contains columns, the whole 17 inches are still printed.

You solution seems to solve the problem of white spaces in between columns that are visible and invisible, but my problem is that though all the columns are neatly next to each other, spaces are still accounted for the invisible columns are at the end of the table.

Now, if I misunderstood your solution and it actually does solve my problem, could you please provide more details or a link as to how to "stack" one column on top of another during runtime. Nevertheless, thanks again for your reply.

- Will

|||

I have another option suppose according to the passing parameter report generate value for 1,3,5,7 etc and for next parameter value it will generate report based on 2,4,6,8. Then you can take two table one is design for 1,3,5,7 and next one is designed used by 2,4,6,8 column when parameter passed for 1,3,5,7 then set visibile='true' for this table and set visibile= 'false' for another table that we don't want. Place table one over other so that you need not to worry about the white space.

Does this help you to achive your requirment ?

Regards

Manoj Verma.

|||Hi Manoj Verma,

Thanks for replying. I do not think your suggestion would work because my example was a watered downed one. Our actual need is a 40 columns dynamic report, where users can choose any of the 40 columns. Thanks again for your input.

- Will

Report Page Width with Dynamic columns through parameters

I found the following paragraph while searching on here:

************************************************************************
You could easily set up a parameter for each column and then display that column conditionally based on the parameter.

For instance, if you have a column that displays First Name, you could have a parameter called DisplayFirstName. Then in design view you'd select the whole FirstName column and in the Visibility-Hidden property set it to :

=iif( Parameters!DisplayFirstName.Value = false, true, false )

This could easily become a big, unwieldy report, though, if you have a great number of dynamic columns. Also, The width of the report is set at design time, and it includes the width of all your columns, not just the visible ones. This could cause you some pagination problems.
************************************************************************

That is exactly my problem. I have lots of dynamic columns which causes the width of the report to be wide. Thus even though at run time the report only shows columns within a page, the report itself consists of a lot of white spaces after the selected columns. Does anyone know a solution to this? If not, I guess creating the rdl with code manually is the only way? Please advise. Thanks in advance.

- Will

I summarize your requirement that I have understood and based on that I given you my comment if my understanding is wrong then let me know.

Your requirement is to design a report in which columns are visible on some condition or dynamically. You have design the report and set the column property visible = ‘TRUE’ OR FALSE based on the condition. Let assume the problem is that when col1 is visible that time col2 is invisible due to this a white space is left in place of col2 and you want to remove that white space.

My comment:

Take the above scenario if col1 is visible and col2 is invisible and vice a versa then place the col2 over col1 so then col2 is visible then col1 will be invisible and if the col1 is visible then col2 is invisible. And you will not see any white pace in the report.

|||Hi mverma,

First let me thank you for replying to me. Let me clarify my requirements just to make sure what you are proposing would solve my problem.

I have a report, which at design time, would span 2 physical pages (17 inches), with each column being the same width.
Now, the columns' visibility is toggled by parameters passed to the report page during run time.

Now the problem.
Lets say for one of the report we pass in parameters to toggle on columns 1,3,5,7, so the total width would be 8.5 inches, which would fit exactly on one page. So when choosing to print, it would print one page with the 4 columns (with no spaces between the columns), and one blank page. The blank page is printed because, during design time, the report is set to be 17 inches wide, thus even only 8.5 inches of the report contains columns, the whole 17 inches are still printed.

You solution seems to solve the problem of white spaces in between columns that are visible and invisible, but my problem is that though all the columns are neatly next to each other, spaces are still accounted for the invisible columns are at the end of the table.

Now, if I misunderstood your solution and it actually does solve my problem, could you please provide more details or a link as to how to "stack" one column on top of another during runtime. Nevertheless, thanks again for your reply.

- Will

|||

I have another option suppose according to the passing parameter report generate value for 1,3,5,7 etc and for next parameter value it will generate report based on 2,4,6,8. Then you can take two table one is design for 1,3,5,7 and next one is designed used by 2,4,6,8 column when parameter passed for 1,3,5,7 then set visibile='true' for this table and set visibile= 'false' for another table that we don't want. Place table one over other so that you need not to worry about the white space.

Does this help you to achive your requirment ?

Regards

Manoj Verma.

|||Hi Manoj Verma,

Thanks for replying. I do not think your suggestion would work because my example was a watered downed one. Our actual need is a 40 columns dynamic report, where users can choose any of the 40 columns. Thanks again for your input.

- Will

sql

Wednesday, March 7, 2012

Report Layout Troubles

I have created a tabular report that has four columns. Using the ruler at the top of the design page I have placed all columns inside my margins. When I view this report or print it the last column spills over to another page. I have designed this report to have portrait orientation. Is this an issue or am I doing something wrong. Does the ruler at the top signify a location on the page? Any help or ideas is greatly appreciated.
Thanks
-JWTake a look at my blog entry: http://blogs.msdn.com/bwelcker/archive/2005/08/19/454043.aspx. It covers logic and physical pagination rules.

Report Layout Troubles

I have created a tabular report that has four columns. Using the ruler at the top of the design page I have placed all columns inside my margins. When I view this report or print it the last column spills over to another page. I have designed this report to have portrait orientation. Is this an issue or am I doing something wrong. Does the ruler at the top signify a location on the page? Any help or ideas is greatly appreciated.
Thanks
-JWTake a look at my blog entry: http://blogs.msdn.com/bwelcker/archive/2005/08/19/454043.aspx. It covers logic and physical pagination rules.

Report layout matrix/dynamic columns...

Hello

Could someone please help me with how I can produce a report. I'm new to Reporting Services and I'm thinking this should be so easy, but it doesn't seem to be. A simplified version of my data is:

Table 1
=======
JobNumber Date Staff
123 01/01/06 5
444 01/03/06 6

Table 2
=======
JobNumber FieldName FieldValue
123 Apples $13.23
123 Deleted False
444 Deleted True
444 Oranges 23


I need to create a report with the following output:

Report
======
JobNumber Date Staff Apples Deleted Oranges
123 01/01/06 5 $13.23 False
444 01/03/06 6 True 23


The FieldNames in Table 2 are variable, any number of new field names could be added and I don't know what they are. I have tried using a matrix, a subreport and I cannot get either to produce the desired result.

Also I have control over the layout of table 2 if that helps. It was originally set up as:

JobNUmber Apples Deleted Oranges
123 $13.23 False Null
444 Null True 23

Thanks in advance.

Maybe you can join the tables together to get something like:

JobNumber FieldName FieldValue

123 Date 01/01/06
123 Staff 5
123 Apples $13.23
123 Deleted False
444 Date 01/03/06
444 Staff 6
444 Deleted True
444 Oranges 23

Then you can use a matrix, grouping by JobNumber on the rows and FieldName on the columns.

-Albert

|||

Cheers Albert. I think I can achieve that, but how do I get my Staff and Date columns into the matrix? If I add them to it then I can't get column headers for these fields? I end up with something like this

Report
======
Apples Deleted Oranges
123 01/01/06 5 $13.23 False
444 01/03/06 6 True 23

Cheers

|||

You need to do something like this:

SELECT JobNumber, FieldName, FieldValue FROM [Table 2]
UNION SELECT JobNumber, 'Date', Date FROM [Table 1]
UNION SELECT JobNumber, 'Staff', Staff FROM [Table 1]

Does that work for you?

-Albert

Saturday, February 25, 2012

Report in Multiple Columns

I have a report, let's say it has two table columns, Name and Phone. I need to format this report so that it will print Name and Phone top to bottom, and then start at the top of a second column instead of going to another page. Do I do this using body columns, and if so, can someone explain how. I have tried by changing the column property of the body to 2, but it just moved a table column over the the other body column. Am I heading down the wrong path? I am using VS 2003 to create the report.

Thanks

Setting the column property of the body is the right way to accomplish this. However, you need to check the page width value of the report. When Body.Column is 2, the report width is divided in half, if that is smaller than the body width/table width, your table'd get splitted.

Report Header woes

I am creating a report which consists of data in two columns. I've set the Body section to have 2 columns in it. This works fine until I start working with the report header. I do not want a page header that shows up on every page, I only want a header on the first page, a report header.

I first tried to hide the header by placing it in the Page Header section, then putting in the "page > 1" expression in the visibility property. This does what I want, except a large blank space is present at the top of my report (the header is about 1.2 "). This is unacceptable.

So my next test was to put the header into the Body section so that it only shows up in the beginning of the report. Because of this, I will need to remove the columns from the Body and make it only 1 column now. I decided to put the multi-column section into a subreport that has 2 columns and add this to the body of my report. But, this failed; the data appears in one column only. I can change the width the ensure it fits and set all other sorts of properties, nothing works.

I've researched both issues and found that these are both "bugs" in reporting services, although I cannot find thedocumented bugs.

Is there any workaround to putting a header onto only the first page of a multi-column report? Other reporting engines are able to handle this with ease, I'm suprised by Reporting Services lack of a "Report Header" section. I am an experienced .NET developer, so if there is a programmatic way through this, I am game.

Thanks,

Scott Steigerwald

I realize this thread is over a year and a half old. The point of this reply is to bring the issue back among the recent posts; a "bump" as it were.

I am struggling with a near identical problem, and have already tried all the workarounds proposed by Mr. Steigerwald, to no avail.

I hope that after 20 or so months, some solution has been discovered.

Thanks,

David Emigh

|||I am pretty confident there is still no solution to this.
I actually faked a multi column report by manipulating the dataset I was pulling across, but this was a failry specific situation where I knew approximately how many rows were always being returned.|||

Thanks.

Sadly, I rather suspected this. At least I know now to look for a solution outside of SQL Reporting Services.

|||

Um, folks... hold on a sec .

I saw the re-post on this question and I think I have succeeded in doing what you want. (Sorry I didn't get around to posting this last night.)

It's a little hacky and it probably won't work for *every* situation, but I did get the basic parameters down:

* -- I've got a Body section with two columns

* -- I have a header that appears to stretch over both areas

* -- it "collapses" after the first page.

Here is what I did:

I couldn't get it to work as a Page header, for reasons you've already discussed. So, instead, I worked out how you could have a Body header that disappeared properly and stretched across.

The first step is to figure out where to put it. In my example, and I am not sure how many other ways there might be to do it, it's a group header and I page breaked on group. I don't think this is relevant, but whatever your data region you need a body element that will be placed at the top of every column.

The background of this page header element should be transparent, because we're going to change its contents for the second column (or more, if it's > 2 cols) and we want it to look as seamless -across as possible.

For the same reason (making the header look seamless-across), you probably want to set the colum spacing as low as possible (you can add some extra padding on the right side by adding an extra blank column, and merge the layout element across, to compensate).

Note that, just as we'll make the contents different for each col, text alignment can be an expression, so using what I"m doing here you could (say) have the left col header left aligned and the right col header right aligned.

I set the expression for this header element to =Code.MyUDF().

You can see my code below. Notice that the ColNo var is incremented each time, so I can use it both for "which column am I in" and "which page am I on".

The tricky part was just figuring out when the Visibility of the element would be evaluated with respect to this function being invoked -- so that I could set the visibility properly. With how I'm doing it here, the visibility expression has to be =Code.ColNo > 1 (one less than you might think, IOW).

The visibility expression would be a little different if I invoked one function to increment earlier, say in an earlier no-height line, and a second function to figure out the expressions to show, but this combined design works okay as well.

I also set the CanShrink property of this element to True to and I set the Visibility of the row to the same expression as the layout element.

Here's the code I used:

Code Snippet

Public ColNo AS Integer = 0


Function MyUDF AS String
Dim myheadpart As String
ColNo = ColNo + 1
If ColNo = 1
myheadpart= "1st part of header"
ElseIf ColNo = 2
myheadpart= "2nd part"
Else
myheadpart = ""
End If
Return myheadpart
End Function

... HTH,

>L<

|||

Thank you!

I've bookmarked this thread for future reference, as this situation will almost certainly come up again.

Unfortunately, in my particular situation, it doesn't seem applicable. I have a requirement to include an image that is wider than the the sum of the widths of the first column and the space between it and the second. The image has a minimum size and a non-negotiable aspect ratio.

I wasn't the thread starter on this one, but if I were, I would mark this as "answered"

Thanks again,

David

|||

Hi David

I see what you mean about the image -- I know this whole idea is a bit dodgy but there might be some way to split the image up into two? First make a "full image" the full width of the page, I mean with a lot of filler-empty space on the right (or on both sides, if you're trying to center it horizontally on the page), and then split it down the middle for column one and column two. No guarantees that it will work, of course, but worth a shot?

>> I would mark it

Well, I can mark it as a moderator but I won't <g>. I won't do that with my own answers unless they prove out (actually help somebody) <g>.

>L<

|||

Maybe I am misundertanding things but generally when I want a first page only header I create a second dataset that returns a single record by using a statment like "select x=1". Then I just use a table set to the dummy header at the top of my body section. A typical example where I would use it is for invoices.

|||

Lisa,

Perhaps another moderator will come along and do the deed which modesty prevents you doing yourself

My manager has decided on a different approach to this problem, one which precludes any image editing, but I will keep that in mind also.

David

|||

Hi there,

Yeah, a first page header *alone* is not the problem here. (There are lots of ways to do that -- for example you can group on something that will never break as an outer group...)

The problem we're trying to solve here is the multi-column report and getting the page header to stretch across those columns without using a page header...

>L<

|||

Hi David,

If you don't mind my asking... what did you and your manager settle on? (It's always good to be able to remove the requirement if the requirement is a PITA <rofl>)

>L<

|||

Hey Lisa,

The requirement didn't go away, we just opted to generate the report header and report body separately, then merge them later (probably as an active .pdf via a web app).

|||

Ah.

Well, good to know. (I have posted about combining files in a PDF a couple of times, and recently found a nice utility for this to complement my usual low-level ghostcript PDF approach... give a shout if you have a difficulties.

FWIW there are many reasons to do this that have nothing to do with your current problem, for example different orientation of a cover page. Repeat after me: a report is a document section, not a document. Extended essay on this subject here: http://spacefold.com/lisa/post/Reporting-Convergences-Chapter-The-one-about-multiple-sets-of-printing-instructions.aspx.

>L<

Report Header woes

I am creating a report which consists of data in two columns. I've set the Body section to have 2 columns in it. This works fine until I start working with the report header. I do not want a page header that shows up on every page, I only want a header on the first page, a report header.

I first tried to hide the header by placing it in the Page Header section, then putting in the "page > 1" expression in the visibility property. This does what I want, except a large blank space is present at the top of my report (the header is about 1.2 "). This is unacceptable.

So my next test was to put the header into the Body section so that it only shows up in the beginning of the report. Because of this, I will need to remove the columns from the Body and make it only 1 column now. I decided to put the multi-column section into a subreport that has 2 columns and add this to the body of my report. But, this failed; the data appears in one column only. I can change the width the ensure it fits and set all other sorts of properties, nothing works.

I've researched both issues and found that these are both "bugs" in reporting services, although I cannot find thedocumented bugs.

Is there any workaround to putting a header onto only the first page of a multi-column report? Other reporting engines are able to handle this with ease, I'm suprised by Reporting Services lack of a "Report Header" section. I am an experienced .NET developer, so if there is a programmatic way through this, I am game.

Thanks,

Scott Steigerwald

I realize this thread is over a year and a half old. The point of this reply is to bring the issue back among the recent posts; a "bump" as it were.

I am struggling with a near identical problem, and have already tried all the workarounds proposed by Mr. Steigerwald, to no avail.

I hope that after 20 or so months, some solution has been discovered.

Thanks,

David Emigh

|||I am pretty confident there is still no solution to this.
I actually faked a multi column report by manipulating the dataset I was pulling across, but this was a failry specific situation where I knew approximately how many rows were always being returned.
|||

Thanks.

Sadly, I rather suspected this. At least I know now to look for a solution outside of SQL Reporting Services.

|||

Um, folks... hold on a sec .

I saw the re-post on this question and I think I have succeeded in doing what you want. (Sorry I didn't get around to posting this last night.)

It's a little hacky and it probably won't work for *every* situation, but I did get the basic parameters down:

* -- I've got a Body section with two columns

* -- I have a header that appears to stretch over both areas

* -- it "collapses" after the first page.

Here is what I did:

I couldn't get it to work as a Page header, for reasons you've already discussed. So, instead, I worked out how you could have a Body header that disappeared properly and stretched across.

The first step is to figure out where to put it. In my example, and I am not sure how many other ways there might be to do it, it's a group header and I page breaked on group. I don't think this is relevant, but whatever your data region you need a body element that will be placed at the top of every column.

The background of this page header element should be transparent, because we're going to change its contents for the second column (or more, if it's > 2 cols) and we want it to look as seamless -across as possible.

For the same reason (making the header look seamless-across), you probably want to set the colum spacing as low as possible (you can add some extra padding on the right side by adding an extra blank column, and merge the layout element across, to compensate).

Note that, just as we'll make the contents different for each col, text alignment can be an expression, so using what I"m doing here you could (say) have the left col header left aligned and the right col header right aligned.

I set the expression for this header element to =Code.MyUDF().

You can see my code below. Notice that the ColNo var is incremented each time, so I can use it both for "which column am I in" and "which page am I on".

The tricky part was just figuring out when the Visibility of the element would be evaluated with respect to this function being invoked -- so that I could set the visibility properly. With how I'm doing it here, the visibility expression has to be =Code.ColNo > 1 (one less than you might think, IOW).

The visibility expression would be a little different if I invoked one function to increment earlier, say in an earlier no-height line, and a second function to figure out the expressions to show, but this combined design works okay as well.

I also set the CanShrink property of this element to True to and I set the Visibility of the row to the same expression as the layout element.

Here's the code I used:

Code Snippet

Public ColNo AS Integer = 0


Function MyUDF AS String
Dim myheadpart As String
ColNo = ColNo + 1
If ColNo = 1
myheadpart= "1st part of header"
ElseIf ColNo = 2
myheadpart= "2nd part"
Else
myheadpart = ""
End If
Return myheadpart
End Function

... HTH,

>L<

|||

Thank you!

I've bookmarked this thread for future reference, as this situation will almost certainly come up again.

Unfortunately, in my particular situation, it doesn't seem applicable. I have a requirement to include an image that is wider than the the sum of the widths of the first column and the space between it and the second. The image has a minimum size and a non-negotiable aspect ratio.

I wasn't the thread starter on this one, but if I were, I would mark this as "answered"

Thanks again,

David

|||

Hi David

I see what you mean about the image -- I know this whole idea is a bit dodgy but there might be some way to split the image up into two? First make a "full image" the full width of the page, I mean with a lot of filler-empty space on the right (or on both sides, if you're trying to center it horizontally on the page), and then split it down the middle for column one and column two. No guarantees that it will work, of course, but worth a shot?

>> I would mark it

Well, I can mark it as a moderator but I won't <g>. I won't do that with my own answers unless they prove out (actually help somebody) <g>.

>L<

|||

Maybe I am misundertanding things but generally when I want a first page only header I create a second dataset that returns a single record by using a statment like "select x=1". Then I just use a table set to the dummy header at the top of my body section. A typical example where I would use it is for invoices.

|||

Lisa,

Perhaps another moderator will come along and do the deed which modesty prevents you doing yourself

My manager has decided on a different approach to this problem, one which precludes any image editing, but I will keep that in mind also.

David

|||

Hi there,

Yeah, a first page header *alone* is not the problem here. (There are lots of ways to do that -- for example you can group on something that will never break as an outer group...)

The problem we're trying to solve here is the multi-column report and getting the page header to stretch across those columns without using a page header...

>L<

|||

Hi David,

If you don't mind my asking... what did you and your manager settle on? (It's always good to be able to remove the requirement if the requirement is a PITA <rofl>)

>L<

|||

Hey Lisa,

The requirement didn't go away, we just opted to generate the report header and report body separately, then merge them later (probably as an active .pdf via a web app).

|||

Ah.

Well, good to know. (I have posted about combining files in a PDF a couple of times, and recently found a nice utility for this to complement my usual low-level ghostcript PDF approach... give a shout if you have a difficulties.

FWIW there are many reasons to do this that have nothing to do with your current problem, for example different orientation of a cover page. Repeat after me: a report is a document section, not a document. Extended essay on this subject here: http://spacefold.com/lisa/post/Reporting-Convergences-Chapter-The-one-about-multiple-sets-of-printing-instructions.aspx.

>L<

Report Header woes

I am creating a report which consists of data in two columns. I've set the Body section to have 2 columns in it. This works fine until I start working with the report header. I do not want a page header that shows up on every page, I only want a header on the first page, a report header.

I first tried to hide the header by placing it in the Page Header section, then putting in the "page > 1" expression in the visibility property. This does what I want, except a large blank space is present at the top of my report (the header is about 1.2 "). This is unacceptable.

So my next test was to put the header into the Body section so that it only shows up in the beginning of the report. Because of this, I will need to remove the columns from the Body and make it only 1 column now. I decided to put the multi-column section into a subreport that has 2 columns and add this to the body of my report. But, this failed; the data appears in one column only. I can change the width the ensure it fits and set all other sorts of properties, nothing works.

I've researched both issues and found that these are both "bugs" in reporting services, although I cannot find thedocumented bugs.

Is there any workaround to putting a header onto only the first page of a multi-column report? Other reporting engines are able to handle this with ease, I'm suprised by Reporting Services lack of a "Report Header" section. I am an experienced .NET developer, so if there is a programmatic way through this, I am game.

Thanks,

Scott Steigerwald

I realize this thread is over a year and a half old. The point of this reply is to bring the issue back among the recent posts; a "bump" as it were.

I am struggling with a near identical problem, and have already tried all the workarounds proposed by Mr. Steigerwald, to no avail.

I hope that after 20 or so months, some solution has been discovered.

Thanks,

David Emigh

|||I am pretty confident there is still no solution to this.
I actually faked a multi column report by manipulating the dataset I was pulling across, but this was a failry specific situation where I knew approximately how many rows were always being returned.
|||

Thanks.

Sadly, I rather suspected this. At least I know now to look for a solution outside of SQL Reporting Services.

|||

Um, folks... hold on a sec .

I saw the re-post on this question and I think I have succeeded in doing what you want. (Sorry I didn't get around to posting this last night.)

It's a little hacky and it probably won't work for *every* situation, but I did get the basic parameters down:

* -- I've got a Body section with two columns

* -- I have a header that appears to stretch over both areas

* -- it "collapses" after the first page.

Here is what I did:

I couldn't get it to work as a Page header, for reasons you've already discussed. So, instead, I worked out how you could have a Body header that disappeared properly and stretched across.

The first step is to figure out where to put it. In my example, and I am not sure how many other ways there might be to do it, it's a group header and I page breaked on group. I don't think this is relevant, but whatever your data region you need a body element that will be placed at the top of every column.

The background of this page header element should be transparent, because we're going to change its contents for the second column (or more, if it's > 2 cols) and we want it to look as seamless -across as possible.

For the same reason (making the header look seamless-across), you probably want to set the colum spacing as low as possible (you can add some extra padding on the right side by adding an extra blank column, and merge the layout element across, to compensate).

Note that, just as we'll make the contents different for each col, text alignment can be an expression, so using what I"m doing here you could (say) have the left col header left aligned and the right col header right aligned.

I set the expression for this header element to =Code.MyUDF().

You can see my code below. Notice that the ColNo var is incremented each time, so I can use it both for "which column am I in" and "which page am I on".

The tricky part was just figuring out when the Visibility of the element would be evaluated with respect to this function being invoked -- so that I could set the visibility properly. With how I'm doing it here, the visibility expression has to be =Code.ColNo > 1 (one less than you might think, IOW).

The visibility expression would be a little different if I invoked one function to increment earlier, say in an earlier no-height line, and a second function to figure out the expressions to show, but this combined design works okay as well.

I also set the CanShrink property of this element to True to and I set the Visibility of the row to the same expression as the layout element.

Here's the code I used:

Code Snippet

Public ColNo AS Integer = 0


Function MyUDF AS String
Dim myheadpart As String
ColNo = ColNo + 1
If ColNo = 1
myheadpart= "1st part of header"
ElseIf ColNo = 2
myheadpart= "2nd part"
Else
myheadpart = ""
End If
Return myheadpart
End Function

... HTH,

>L<

|||

Thank you!

I've bookmarked this thread for future reference, as this situation will almost certainly come up again.

Unfortunately, in my particular situation, it doesn't seem applicable. I have a requirement to include an image that is wider than the the sum of the widths of the first column and the space between it and the second. The image has a minimum size and a non-negotiable aspect ratio.

I wasn't the thread starter on this one, but if I were, I would mark this as "answered"

Thanks again,

David

|||

Hi David

I see what you mean about the image -- I know this whole idea is a bit dodgy but there might be some way to split the image up into two? First make a "full image" the full width of the page, I mean with a lot of filler-empty space on the right (or on both sides, if you're trying to center it horizontally on the page), and then split it down the middle for column one and column two. No guarantees that it will work, of course, but worth a shot?

>> I would mark it

Well, I can mark it as a moderator but I won't <g>. I won't do that with my own answers unless they prove out (actually help somebody) <g>.

>L<

|||

Maybe I am misundertanding things but generally when I want a first page only header I create a second dataset that returns a single record by using a statment like "select x=1". Then I just use a table set to the dummy header at the top of my body section. A typical example where I would use it is for invoices.

|||

Lisa,

Perhaps another moderator will come along and do the deed which modesty prevents you doing yourself

My manager has decided on a different approach to this problem, one which precludes any image editing, but I will keep that in mind also.

David

|||

Hi there,

Yeah, a first page header *alone* is not the problem here. (There are lots of ways to do that -- for example you can group on something that will never break as an outer group...)

The problem we're trying to solve here is the multi-column report and getting the page header to stretch across those columns without using a page header...

>L<

|||

Hi David,

If you don't mind my asking... what did you and your manager settle on? (It's always good to be able to remove the requirement if the requirement is a PITA <rofl>)

>L<

|||

Hey Lisa,

The requirement didn't go away, we just opted to generate the report header and report body separately, then merge them later (probably as an active .pdf via a web app).

|||

Ah.

Well, good to know. (I have posted about combining files in a PDF a couple of times, and recently found a nice utility for this to complement my usual low-level ghostcript PDF approach... give a shout if you have a difficulties.

FWIW there are many reasons to do this that have nothing to do with your current problem, for example different orientation of a cover page. Repeat after me: a report is a document section, not a document. Extended essay on this subject here: http://spacefold.com/lisa/post/Reporting-Convergences-Chapter-The-one-about-multiple-sets-of-printing-instructions.aspx.

>L<

Report header when using columns

Hi,
I am designing a report with two columns, and I'm trying to add a header
only on the first page of the report. I've added a text box in the body of
the report, but my problem is that this textbox can't be larger than the
column size.
Is there any way to put this header on the whole width of the report ?
Thanks in advance.
--
Florent MERYHi,
No need to add text boxes. Just follow the below steps
Right click on the table-> select properties->General Tab-> Uncheck the
"Repeat header row on each page"..
Regards,
Sriman.
"Florent" wrote:
> Hi,
> I am designing a report with two columns, and I'm trying to add a header
> only on the first page of the report. I've added a text box in the body of
> the report, but my problem is that this textbox can't be larger than the
> column size.
> Is there any way to put this header on the whole width of the report ?
> Thanks in advance.
> --
> Florent MERY|||Thank you for your answer, but it's not exactly what I'm trying to do. As I'm
using 2 columns in my report, the table headers will only appear on the top
of the first column.
What I would like to do is to have in fact a kind of title zone for my
report, only for the first page.
If I use the Page header, with a conditional visibility, I always get a
blanck zone at the top of every page, even when the header is not visible.
And if I use the table header rows, it only appear on the first column of
the page, and it does not use the whole width of the page.
Any workaround for my problem ?
Thanks in advance...
--
Florent MERY
"Sriman" wrote:
> Hi,
> No need to add text boxes. Just follow the below steps
> Right click on the table-> select properties->General Tab-> Uncheck the
> "Repeat header row on each page"..
> Regards,
> Sriman.
> "Florent" wrote:
> > Hi,
> >
> > I am designing a report with two columns, and I'm trying to add a header
> > only on the first page of the report. I've added a text box in the body of
> > the report, but my problem is that this textbox can't be larger than the
> > column size.
> >
> > Is there any way to put this header on the whole width of the report ?
> >
> > Thanks in advance.
> >
> > --
> > Florent MERY