Showing posts with label repeat. Show all posts
Showing posts with label repeat. Show all posts

Tuesday, March 20, 2012

repeatwith property

I have tried for days to get certain textboxes and tables in page body

to repeat on multiple page reports

Any help is appreciated.

Hello,

The repeatwith property is not available on tables and is not supported by physical paginated renderes.

However, the RepeateOnNewPage property of table&group headers and footers is supported by all renderers.

Thank you,

Nico

|||

How to transfer parameter to Header and display it on next page.

I reference one report textbox to header textbox "= ReportItems!textbox1.Value "

But it didn't display on second page....

What can I do?

|||

Hello,

Could you provide the rdl so I can understand what you are trying to achieve?

Thanks,

Nico

|||

How to use static query in my header textbox

= "SELECT [Contractor Name] FROM tblvendor WHERE vendorID=" & Parameters!vendorID.Value

It display the text "SELECT [Contractor Name] FROM tblvendor WHERE vendorID=354" not the query result

RepeatWith in SSRS

I have a text box which is set to repeat with a list.
When I use Preview or when Deployed, the RepeatWith does not work and the
text box only apears on the first page.
Im new to SSRS and it's probabley something realy simple, but I have not
been able to find the answer anywhere.
Thanks in advance JoeOn Nov 28, 11:02 am, Joe <J...@.discussions.microsoft.com> wrote:
> I have a text box which is set to repeat with a list.
> When I use Preview or when Deployed, the RepeatWith does not work and the
> text box only apears on the first page.
> Im new to SSRS and it's probabley something realy simple, but I have not
> been able to find the answer anywhere.
> Thanks in advance Joe
The main export format that supports the 'repeat with' functionality
is web archive. You might try 'repeat with' for a different report
control (i.e., w/a table control, etc). Sorry that I could not be of
greater assistance.
Regards,
Enrique Martinez
Sr. Software Consultant|||Thanks for your reply, the issue is not with export as the RepeatWith does
not seem work at all.
I am using the List Function as I cannot use a matrix as there are multiple
lines for each record being reported on, I have a Text Box above the List
which is set to RepeatWith the List, but it just appears on the first page
and does not repeat on any subsequent page, this happens when running the
report with Visual Studio, running the Report once deployed or when the
report has been printed.
"EMartinez" wrote:
> On Nov 28, 11:02 am, Joe <J...@.discussions.microsoft.com> wrote:
> > I have a text box which is set to repeat with a list.
> >
> > When I use Preview or when Deployed, the RepeatWith does not work and the
> > text box only apears on the first page.
> >
> > Im new to SSRS and it's probabley something realy simple, but I have not
> > been able to find the answer anywhere.
> >
> > Thanks in advance Joe
>
> The main export format that supports the 'repeat with' functionality
> is web archive. You might try 'repeat with' for a different report
> control (i.e., w/a table control, etc). Sorry that I could not be of
> greater assistance.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
>

Repeating table header on "every" page

Hi guys,

I have a question and want to ask you a favor in terms of question. How do I let a table header repeat on every page. I know the "repeat on every page" property and I set that to true, but the problem is that, when the table is not displayed on a certain page, the header doesn't get displayed, especially if the sub-report in the page is large. In other words table is not displaying header on every page when itself is not on every page or something like that? I want that table header to repeat on every single page without glitching.

Any help and pointers?

Thanks for the help,

Enkh.

I have created many reports with subreports. Have you considered making one generic header in the header of the page? It will print on every page, even the subreports. Then you can add a simple text box if you want some unique text for a subreport. Just a thought.

Repeating Rows

Is there any way by which we can force to repeat the column headers to repeat
if the page changes. Like in EXCEL where we can mention those rows that need
to be repeat with the new pages.
ThanksClick on the header of the table (far left), there is a property called
repeatonnewpage that you set to true.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Asim" <Asim@.discussions.microsoft.com> wrote in message
news:7DD34123-91DC-44CD-BB57-9A2C018292AC@.microsoft.com...
> Is there any way by which we can force to repeat the column headers to
repeat
> if the page changes. Like in EXCEL where we can mention those rows that
need
> to be repeat with the new pages.
> Thanks
>|||Thanks! This is a matrix and when i go in properties of the particular FIELD
(Months), there is an option (ADVANCED TAB) which says
"REPEAT REPORT ITEM WITH DATA REGION ON EVERY PAGE" and then you can pick up
the specific data region from drop down. The problem here is that this option
is not available for me and couldnt be chosen.
"Bruce L-C [MVP]" wrote:
> Click on the header of the table (far left), there is a property called
> repeatonnewpage that you set to true.
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Asim" <Asim@.discussions.microsoft.com> wrote in message
> news:7DD34123-91DC-44CD-BB57-9A2C018292AC@.microsoft.com...
> > Is there any way by which we can force to repeat the column headers to
> repeat
> > if the page changes. Like in EXCEL where we can mention those rows that
> need
> > to be repeat with the new pages.
> > Thanks
> >
>
>|||Sorry, can't help you with the matrix problem you are having.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Asim" <Asim@.discussions.microsoft.com> wrote in message
news:AF07B84C-4D5A-4032-9BD5-014A795A6F6B@.microsoft.com...
> Thanks! This is a matrix and when i go in properties of the particular
FIELD
> (Months), there is an option (ADVANCED TAB) which says
> "REPEAT REPORT ITEM WITH DATA REGION ON EVERY PAGE" and then you can pick
up
> the specific data region from drop down. The problem here is that this
option
> is not available for me and couldnt be chosen.
>
> "Bruce L-C [MVP]" wrote:
> > Click on the header of the table (far left), there is a property called
> > repeatonnewpage that you set to true.
> >
> > --
> > Bruce Loehle-Conger
> > MVP SQL Server Reporting Services
> >
> > "Asim" <Asim@.discussions.microsoft.com> wrote in message
> > news:7DD34123-91DC-44CD-BB57-9A2C018292AC@.microsoft.com...
> > > Is there any way by which we can force to repeat the column headers to
> > repeat
> > > if the page changes. Like in EXCEL where we can mention those rows
that
> > need
> > > to be repeat with the new pages.
> > > Thanks
> > >
> >
> >
> >

Monday, March 12, 2012

Repeating Group headers on reports with subreports

I have a report that contains a table. The group header in the table is set
to repeat on a new page. However, as soon as I place a subreport in the table
of the main report and that subreport causes a page break...the group header
on the top-level report doesn't repeat. Is there a workaround for this
shortcoming?
Regards,
Dean NeroNero,
Did you ever find an answer for this? I am having the same issue...and
its killin' me!
Michael
"Dean Nero" wrote:
> I have a report that contains a table. The group header in the table is set
> to repeat on a new page. However, as soon as I place a subreport in the table
> of the main report and that subreport causes a page break...the group header
> on the top-level report doesn't repeat. Is there a workaround for this
> shortcoming?
> Regards,
> Dean Nero

Repeating Group Footer in a Subreport

I have a subreport that can be pages long. On each page, I need the group footer repeated. I can get the header to repeat, but not the footer.
Any help will be greatly appreciated!I think you can't.. as it appears at the end of the group...
could you use the page footer ?

Luc|||Thanks for letting me know that I can't repeat the group footer - now I'll have to try and take a different approach!

I suppose I could try sticking the subreports in the detail, so that I could have a page footer... I'll try it and see how it goes.

Repeating data regions on every page

Hi all, I want to create an invoice that will repeat numbers dates and
shipping info on every page that the list of items grows on to. You know,
to simulate a standard preprinted invoice page but fully generated by
reporting services.
Any assistance is appreciated.
Raul RubioThe sample report, at the end of this posting, should point in the direction
you need to go.
Since you will have a fairly regular structure I suggest that you use a
table instead of lists.
I think you will find them much easier to work with than a List which
contains a number of textboxes.
Note the use of the table group on OrderID.
--
Bruce Johnson [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Raul R" <roller8@.hotmail.com> wrote in message
news:e%23qgdx$nEHA.2900@.TK2MSFTNGP09.phx.gbl...
> Hi all, I want to create an invoice that will repeat numbers dates and
> shipping info on every page that the list of items grows on to. You know,
> to simulate a standard preprinted invoice page but fully generated by
> reporting services.
> Any assistance is appreciated.
> Raul Rubio
>
SampleInvoice.rdl
<?xml version="1.0" encoding="utf-8"?>
<Report
xmlns="http://schemas.microsoft.com/sqlserver/reporting/2003/10/reportdefini
tion"
xmlns:rd="">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<RightMargin>1in</RightMargin>
<Body>
<ReportItems>
<Table Name="table1">
<Height>1.5in</Height>
<Style />
<Header>
<TableRows>
<TableRow>
<Height>0.25in</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="textbox1">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<TextAlign>Right</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>17</ZIndex>
<rd:DefaultName>textbox1</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>Order ID</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox2">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>16</ZIndex>
<rd:DefaultName>textbox2</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>Order Date</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox3">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>15</ZIndex>
<rd:DefaultName>textbox3</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>Country</Value>
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
</TableRows>
</Header>
<Details>
<TableRows>
<TableRow>
<Height>0.25in</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="ProductName">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>2</ZIndex>
<rd:DefaultName>ProductName</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=Fields!ProductName.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="UnitPrice">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<TextAlign>Right</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>1</ZIndex>
<rd:DefaultName>UnitPrice</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=Fields!UnitPrice.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="Quantity">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<TextAlign>Right</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<rd:DefaultName>Quantity</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=Fields!Quantity.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
</TableRows>
</Details>
<DataSetName>Northwind</DataSetName>
<TableColumns>
<TableColumn>
<Width>2.16667in</Width>
</TableColumn>
<TableColumn>
<Width>2.16667in</Width>
</TableColumn>
<TableColumn>
<Width>2.16667in</Width>
</TableColumn>
</TableColumns>
<TableGroups>
<TableGroup>
<Header>
<TableRows>
<TableRow>
<Height>0.25in</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="OrderID">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<TextAlign>Right</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>14</ZIndex>
<rd:DefaultName>OrderID</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=Fields!OrderID.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="OrderDate">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>13</ZIndex>
<rd:DefaultName>OrderDate</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=First(Fields!OrderDate.Value)</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox12">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>12</ZIndex>
<rd:DefaultName>textbox12</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
<TableRow>
<Height>0.25in</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="CompanyName">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>11</ZIndex>
<rd:DefaultName>CompanyName</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=First(Fields!CompanyName.Value)</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="City">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>10</ZIndex>
<rd:DefaultName>City</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=First(Fields!City.Value)</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="Country">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>9</ZIndex>
<rd:DefaultName>Country</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=First(Fields!Country.Value)</Value>
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
</TableRows>
<RepeatOnNewPage>true</RepeatOnNewPage>
</Header>
<Grouping Name="OrderIDGroup">
<GroupExpressions>
<GroupExpression>=Fields!OrderID.Value</GroupExpression>
</GroupExpressions>
<PageBreakAtEnd>true</PageBreakAtEnd>
</Grouping>
<Footer>
<TableRows>
<TableRow>
<Height>0.25in</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="textbox4">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>5</ZIndex>
<rd:DefaultName>textbox4</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox5">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>4</ZIndex>
<rd:DefaultName>textbox5</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="Quantity_1">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<TextAlign>Right</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>3</ZIndex>
<rd:DefaultName>Quantity_1</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=Sum(Fields!Quantity.Value)</Value>
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
</TableRows>
</Footer>
</TableGroup>
</TableGroups>
<Footer>
<TableRows>
<TableRow>
<Height>0.25in</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="textbox7">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>8</ZIndex>
<rd:DefaultName>textbox7</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox8">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>7</ZIndex>
<rd:DefaultName>textbox8</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox9">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>6</ZIndex>
<rd:DefaultName>textbox9</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
</TableRows>
</Footer>
</Table>
</ReportItems>
<Style />
<Height>2in</Height>
</Body>
<TopMargin>1in</TopMargin>
<DataSources>
<DataSource Name="Northwind">
<rd:DataSourceID>ca33ccc8-f580-468b-ae00-bdebbfd7a5f0</rd:DataSourceID>
<ConnectionProperties>
<DataProvider>SQL</DataProvider>
<ConnectString>data source=localhost;initial
catalog=Northwind</ConnectString>
<IntegratedSecurity>true</IntegratedSecurity>
</ConnectionProperties>
</DataSource>
</DataSources>
<Width>6.5in</Width>
<DataSets>
<DataSet Name="Northwind">
<Fields>
<Field Name="CompanyName">
<DataField>CompanyName</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="City">
<DataField>City</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Country">
<DataField>Country</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="OrderID">
<DataField>OrderID</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
<Field Name="OrderDate">
<DataField>OrderDate</DataField>
<rd:TypeName>System.DateTime</rd:TypeName>
</Field>
<Field Name="UnitPrice">
<DataField>UnitPrice</DataField>
<rd:TypeName>System.Decimal</rd:TypeName>
</Field>
<Field Name="Quantity">
<DataField>Quantity</DataField>
<rd:TypeName>System.Int16</rd:TypeName>
</Field>
<Field Name="ProductName">
<DataField>ProductName</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
</Fields>
<Query>
<DataSourceName>Northwind</DataSourceName>
<CommandText>SELECT Customers.CompanyName, Customers.City,
Customers.Country, Orders.OrderID, Orders.OrderDate, [Order
Details].UnitPrice, [Order Details].Quantity,
Products.ProductName
FROM Customers INNER JOIN
Orders ON Customers.CustomerID = Orders.CustomerID
INNER JOIN
[Order Details] ON Orders.OrderID = [Order
Details].OrderID INNER JOIN
Products ON [Order Details].ProductID =Products.ProductID</CommandText>
</Query>
</DataSet>
</DataSets>
<LeftMargin>1in</LeftMargin>
<rd:SnapToGrid>true</rd:SnapToGrid>
<rd:DrawGrid>true</rd:DrawGrid>
<rd:ReportID>4d305298-f219-4b15-ab25-32b10f38c465</rd:ReportID>
<BottomMargin>1in</BottomMargin>
<Language>en-US</Language>
</Report>

repeating an insert statement

I want a insert statement to repeat X number of times (X will be a variable
passed from a user interface)...any hints on how to code the sql'
Thanks!!!Put it in a stored proc with a WHILE Loop.
CREATE PROC YourProc
@.Loop INT
AS
WHILE @.Loop > 0
BEGIN
INSERT INTO Table VALUES (x)
SET @.Loop = @.Loop - 1
END
Andrew J. Kelly SQL MVP
Solid Quality Mentors
"Gerry M" <GerryM@.discussions.microsoft.com> wrote in message
news:89A1C091-2DC5-485D-B652-6109C4BDA3D0@.microsoft.com...
>I want a insert statement to repeat X number of times (X will be a variable
> passed from a user interface)...any hints on how to code the sql'
> Thanks!!!|||And I might add that if X happens to be a large number, there may be a
need--for better performance--to control the number of INSERTs you want to
commit in a single transaction. By default, each INSERT commits as a single
transaction, which may not be most efficient if you are doing many
single-INSERT commits in a row.
Linchi
"Gerry M" wrote:
> I want a insert statement to repeat X number of times (X will be a variable
> passed from a user interface)...any hints on how to code the sql'
> Thanks!!!|||"Gerry M" <GerryM@.discussions.microsoft.com> wrote in message
news:89A1C091-2DC5-485D-B652-6109C4BDA3D0@.microsoft.com...
>I want a insert statement to repeat X number of times (X will be a variable
> passed from a user interface)...any hints on how to code the sql'
> Thanks!!!
What data do you want to insert? Perhaps you want all the integers from 1 to
X, in which case you can use a numbers table to help you:
INSERT INTO SomeTable (z)
SELECT num
FROM numbers
WHERE num BETWEEN 1 AND @.x -- your parameter ;
--
David Portas|||If it's SQL2005, you can do without a numbers auxiliary table. To insert the
same integer X times:
with tmp as (
select 1 as a, 1 as b
union all
select a, b+1 from tmp where b < 100 -- or @.x
)
insert junk(a)
select a from tmp;
To insert integers from 1 to @.x:
with tmp as (
select 1 as a
union all
select a + 1 from tmp where a < 100 -- or @.x
)
insert junk(a)
select a from tmp;
Linchi
"David Portas" wrote:
> "Gerry M" <GerryM@.discussions.microsoft.com> wrote in message
> news:89A1C091-2DC5-485D-B652-6109C4BDA3D0@.microsoft.com...
> >I want a insert statement to repeat X number of times (X will be a variable
> > passed from a user interface)...any hints on how to code the sql'
> >
> > Thanks!!!
> What data do you want to insert? Perhaps you want all the integers from 1 to
> X, in which case you can use a numbers table to help you:
>
> INSERT INTO SomeTable (z)
> SELECT num
> FROM numbers
> WHERE num BETWEEN 1 AND @.x -- your parameter ;
> --
> David Portas
>
>|||Hi Gerry!
You could try
INSERT INTO MyTable ( MyValue ) VALUES ( 1 )
GO 10;
This will loop through all statements in the batch 10 times. That's assuming
that you want identical copies of the same row to be inserted of course. And
it doesn't work with variables unfortunately, as they get re-declared and
re-assigned in every loop.
Regards,
Jan
"Gerry M" <GerryM@.discussions.microsoft.com> wrote in message
news:89A1C091-2DC5-485D-B652-6109C4BDA3D0@.microsoft.com...
>I want a insert statement to repeat X number of times (X will be a variable
> passed from a user interface)...any hints on how to code the sql'
> Thanks!!!|||> INSERT INTO MyTable ( MyValue ) VALUES ( 1 )
> GO 10;
The "GO n" method will work with SQL Server tools like SSMS or SQLCMD but
not from application code. GO is a batch terminator recognized only by the
SQL Server tools and is not actually sent to the server.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Jan Van der Eecken" <jkerner@.mweb.co.za> wrote in message
news:OBAl5ZaGIHA.4956@.TK2MSFTNGP06.phx.gbl...
> Hi Gerry!
> You could try
> INSERT INTO MyTable ( MyValue ) VALUES ( 1 )
> GO 10;
> This will loop through all statements in the batch 10 times. That's
> assuming that you want identical copies of the same row to be inserted of
> course. And it doesn't work with variables unfortunately, as they get
> re-declared and re-assigned in every loop.
> Regards,
> Jan
> "Gerry M" <GerryM@.discussions.microsoft.com> wrote in message
> news:89A1C091-2DC5-485D-B652-6109C4BDA3D0@.microsoft.com...
>>I want a insert statement to repeat X number of times (X will be a
>>variable
>> passed from a user interface)...any hints on how to code the sql'
>> Thanks!!!
>|||Andrew, how do I pass the variable to the stored proc? Do I use a select
statement to select it?...I want it all to fit into a single job...this is
what I have so far...but it only inserts a single record...
(In this example freeintfield_01 has a value of 100)
Select freeintfield_01
from absences
where type=206 and status=1 and freedatefield_05 is null
create proc sngen
@.freeintfield_01 int
as
while @.freeintfield_01>0
begin
insert into sngenerator (itemcode)
select itemcode
from absences
where type=206 and status=1 and freedatefield_05 is null and
freeintfield_01=@.freeintfield_01
set @.freeintfield_01=@.freeintfield_01-1
end
"Andrew J. Kelly" wrote:
> Put it in a stored proc with a WHILE Loop.
> CREATE PROC YourProc
> @.Loop INT
> AS
> WHILE @.Loop > 0
> BEGIN
> INSERT INTO Table VALUES (x)
> SET @.Loop = @.Loop - 1
> END
>
> --
> Andrew J. Kelly SQL MVP
> Solid Quality Mentors
>
> "Gerry M" <GerryM@.discussions.microsoft.com> wrote in message
> news:89A1C091-2DC5-485D-B652-6109C4BDA3D0@.microsoft.com...
> >I want a insert statement to repeat X number of times (X will be a variable
> > passed from a user interface)...any hints on how to code the sql'
> >
> > Thanks!!!
>|||Are you talking about a SQL Agent job? If so then like this:
DECLARE @.freeintfield_01 int
SET @.freeintfield_01 = (SELECT freeintfield_01
from absences
where type=206 and status=1 and freedatefield_05 is null )
EXEC dbo.sngen @.freeintfield_01
Andrew J. Kelly SQL MVP
Solid Quality Mentors
"Gerry M" <GerryM@.discussions.microsoft.com> wrote in message
news:819E8C07-8667-4865-BF86-D0AF005D3FC6@.microsoft.com...
> Andrew, how do I pass the variable to the stored proc? Do I use a select
> statement to select it?...I want it all to fit into a single job...this
> is
> what I have so far...but it only inserts a single record...
> (In this example freeintfield_01 has a value of 100)
> Select freeintfield_01
> from absences
> where type=206 and status=1 and freedatefield_05 is null
> create proc sngen
> @.freeintfield_01 int
> as
> while @.freeintfield_01>0
> begin
> insert into sngenerator (itemcode)
> select itemcode
> from absences
> where type=206 and status=1 and freedatefield_05 is null and
> freeintfield_01=@.freeintfield_01
> set @.freeintfield_01=@.freeintfield_01-1
> end
>
> "Andrew J. Kelly" wrote:
>> Put it in a stored proc with a WHILE Loop.
>> CREATE PROC YourProc
>> @.Loop INT
>> AS
>> WHILE @.Loop > 0
>> BEGIN
>> INSERT INTO Table VALUES (x)
>> SET @.Loop = @.Loop - 1
>> END
>>
>> --
>> Andrew J. Kelly SQL MVP
>> Solid Quality Mentors
>>
>> "Gerry M" <GerryM@.discussions.microsoft.com> wrote in message
>> news:89A1C091-2DC5-485D-B652-6109C4BDA3D0@.microsoft.com...
>> >I want a insert statement to repeat X number of times (X will be a
>> >variable
>> > passed from a user interface)...any hints on how to code the sql'
>> >
>> > Thanks!!!
>>|||Yes, the loop works fine but it does not insert the data (itemcode)100 times,
just once....?
"Andrew J. Kelly" wrote:
> Are you talking about a SQL Agent job? If so then like this:
> DECLARE @.freeintfield_01 int
> SET @.freeintfield_01 = (SELECT freeintfield_01
> from absences
> where type=206 and status=1 and freedatefield_05 is null )
> EXEC dbo.sngen @.freeintfield_01
>
> --
> Andrew J. Kelly SQL MVP
> Solid Quality Mentors
>
> "Gerry M" <GerryM@.discussions.microsoft.com> wrote in message
> news:819E8C07-8667-4865-BF86-D0AF005D3FC6@.microsoft.com...
> > Andrew, how do I pass the variable to the stored proc? Do I use a select
> > statement to select it?...I want it all to fit into a single job...this
> > is
> > what I have so far...but it only inserts a single record...
> > (In this example freeintfield_01 has a value of 100)
> >
> > Select freeintfield_01
> > from absences
> > where type=206 and status=1 and freedatefield_05 is null
> >
> > create proc sngen
> > @.freeintfield_01 int
> > as
> > while @.freeintfield_01>0
> >
> > begin
> >
> > insert into sngenerator (itemcode)
> > select itemcode
> >
> > from absences
> > where type=206 and status=1 and freedatefield_05 is null and
> > freeintfield_01=@.freeintfield_01
> >
> > set @.freeintfield_01=@.freeintfield_01-1
> > end
> >
> >
> > "Andrew J. Kelly" wrote:
> >
> >> Put it in a stored proc with a WHILE Loop.
> >>
> >> CREATE PROC YourProc
> >> @.Loop INT
> >>
> >> AS
> >>
> >> WHILE @.Loop > 0
> >> BEGIN
> >>
> >> INSERT INTO Table VALUES (x)
> >>
> >> SET @.Loop = @.Loop - 1
> >> END
> >>
> >>
> >> --
> >> Andrew J. Kelly SQL MVP
> >> Solid Quality Mentors
> >>
> >>
> >> "Gerry M" <GerryM@.discussions.microsoft.com> wrote in message
> >> news:89A1C091-2DC5-485D-B652-6109C4BDA3D0@.microsoft.com...
> >> >I want a insert statement to repeat X number of times (X will be a
> >> >variable
> >> > passed from a user interface)...any hints on how to code the sql'
> >> >
> >> > Thanks!!!
> >>
> >>
>|||If the loop is executing 100 times and the data is not being inserted you
must have an issue with the select statement.
--
Andrew J. Kelly SQL MVP
Solid Quality Mentors
"Gerry M" <GerryM@.discussions.microsoft.com> wrote in message
news:F8F7A55F-0E1B-4351-B157-AAB90FA04F59@.microsoft.com...
> Yes, the loop works fine but it does not insert the data (itemcode)100
> times,
> just once....?
> "Andrew J. Kelly" wrote:
>> Are you talking about a SQL Agent job? If so then like this:
>> DECLARE @.freeintfield_01 int
>> SET @.freeintfield_01 = (SELECT freeintfield_01
>> from absences
>> where type=206 and status=1 and freedatefield_05 is null )
>> EXEC dbo.sngen @.freeintfield_01
>>
>> --
>> Andrew J. Kelly SQL MVP
>> Solid Quality Mentors
>>
>> "Gerry M" <GerryM@.discussions.microsoft.com> wrote in message
>> news:819E8C07-8667-4865-BF86-D0AF005D3FC6@.microsoft.com...
>> > Andrew, how do I pass the variable to the stored proc? Do I use a
>> > select
>> > statement to select it?...I want it all to fit into a single
>> > job...this
>> > is
>> > what I have so far...but it only inserts a single record...
>> > (In this example freeintfield_01 has a value of 100)
>> >
>> > Select freeintfield_01
>> > from absences
>> > where type=206 and status=1 and freedatefield_05 is null
>> >
>> > create proc sngen
>> > @.freeintfield_01 int
>> > as
>> > while @.freeintfield_01>0
>> >
>> > begin
>> >
>> > insert into sngenerator (itemcode)
>> > select itemcode
>> >
>> > from absences
>> > where type=206 and status=1 and freedatefield_05 is null and
>> > freeintfield_01=@.freeintfield_01
>> >
>> > set @.freeintfield_01=@.freeintfield_01-1
>> > end
>> >
>> >
>> > "Andrew J. Kelly" wrote:
>> >
>> >> Put it in a stored proc with a WHILE Loop.
>> >>
>> >> CREATE PROC YourProc
>> >> @.Loop INT
>> >>
>> >> AS
>> >>
>> >> WHILE @.Loop > 0
>> >> BEGIN
>> >>
>> >> INSERT INTO Table VALUES (x)
>> >>
>> >> SET @.Loop = @.Loop - 1
>> >> END
>> >>
>> >>
>> >> --
>> >> Andrew J. Kelly SQL MVP
>> >> Solid Quality Mentors
>> >>
>> >>
>> >> "Gerry M" <GerryM@.discussions.microsoft.com> wrote in message
>> >> news:89A1C091-2DC5-485D-B652-6109C4BDA3D0@.microsoft.com...
>> >> >I want a insert statement to repeat X number of times (X will be a
>> >> >variable
>> >> > passed from a user interface)...any hints on how to code the sql'
>> >> >
>> >> > Thanks!!!
>> >>
>> >>
>>|||Yes, I found it...thanks for your help!
Gerry
"Andrew J. Kelly" wrote:
> If the loop is executing 100 times and the data is not being inserted you
> must have an issue with the select statement.
> --
> Andrew J. Kelly SQL MVP
> Solid Quality Mentors
>
> "Gerry M" <GerryM@.discussions.microsoft.com> wrote in message
> news:F8F7A55F-0E1B-4351-B157-AAB90FA04F59@.microsoft.com...
> > Yes, the loop works fine but it does not insert the data (itemcode)100
> > times,
> > just once....?
> >
> > "Andrew J. Kelly" wrote:
> >
> >> Are you talking about a SQL Agent job? If so then like this:
> >>
> >> DECLARE @.freeintfield_01 int
> >>
> >> SET @.freeintfield_01 = (SELECT freeintfield_01
> >> from absences
> >> where type=206 and status=1 and freedatefield_05 is null )
> >>
> >> EXEC dbo.sngen @.freeintfield_01
> >>
> >>
> >>
> >> --
> >> Andrew J. Kelly SQL MVP
> >> Solid Quality Mentors
> >>
> >>
> >> "Gerry M" <GerryM@.discussions.microsoft.com> wrote in message
> >> news:819E8C07-8667-4865-BF86-D0AF005D3FC6@.microsoft.com...
> >> > Andrew, how do I pass the variable to the stored proc? Do I use a
> >> > select
> >> > statement to select it?...I want it all to fit into a single
> >> > job...this
> >> > is
> >> > what I have so far...but it only inserts a single record...
> >> > (In this example freeintfield_01 has a value of 100)
> >> >
> >> > Select freeintfield_01
> >> > from absences
> >> > where type=206 and status=1 and freedatefield_05 is null
> >> >
> >> > create proc sngen
> >> > @.freeintfield_01 int
> >> > as
> >> > while @.freeintfield_01>0
> >> >
> >> > begin
> >> >
> >> > insert into sngenerator (itemcode)
> >> > select itemcode
> >> >
> >> > from absences
> >> > where type=206 and status=1 and freedatefield_05 is null and
> >> > freeintfield_01=@.freeintfield_01
> >> >
> >> > set @.freeintfield_01=@.freeintfield_01-1
> >> > end
> >> >
> >> >
> >> > "Andrew J. Kelly" wrote:
> >> >
> >> >> Put it in a stored proc with a WHILE Loop.
> >> >>
> >> >> CREATE PROC YourProc
> >> >> @.Loop INT
> >> >>
> >> >> AS
> >> >>
> >> >> WHILE @.Loop > 0
> >> >> BEGIN
> >> >>
> >> >> INSERT INTO Table VALUES (x)
> >> >>
> >> >> SET @.Loop = @.Loop - 1
> >> >> END
> >> >>
> >> >>
> >> >> --
> >> >> Andrew J. Kelly SQL MVP
> >> >> Solid Quality Mentors
> >> >>
> >> >>
> >> >> "Gerry M" <GerryM@.discussions.microsoft.com> wrote in message
> >> >> news:89A1C091-2DC5-485D-B652-6109C4BDA3D0@.microsoft.com...
> >> >> >I want a insert statement to repeat X number of times (X will be a
> >> >> >variable
> >> >> > passed from a user interface)...any hints on how to code the sql'
> >> >> >
> >> >> > Thanks!!!
> >> >>
> >> >>
> >>
> >>
>

Repeating a task

OK gentlemen, here's another one.

How do I repeat a task a few times over until the condition is met.

I have two tables(table1 and table2). Table 1 consists of an ID column and a number of user data columns. Table2 consists of one ID coloumn, one table1ID column and one user data column.

What I need to do is to take the data fields lying horizontally in table1, and stack them up vertically into table2 consecutively, while keeping their association with the appropriate id in table1.

It would look something like this:

table1
-------------------
id data1 data2 data3 data4
-------------------
1 appple orange melon kiwi
2 green red blue yellow
3 ford honda bmw mazeratti
4 Mary stacy Jane Sharon

table2
------------
id table1id data
------------
1 1 apple
2 1 orange
3 1 melon
4 1 kiwi
5 2 green
6 2 red
7 2 blue
. . .
. . .
. . .
15 4 Jane
16 4 Sharon

Any ideas about how to do that?

ThanksWell, the tables didn't come out the way I intended. But I hope you get the idea. :)|||table1
-------------------
id data1 data2 data3 data4
-------------------
1 appple orange melon kiwi
2 green red blue yellow
3 ford honda bmw mazeratti
4 Mary stacy Jane Sharon

table2
------------
id table1id data
------------
1 1 apple
2 1 orange
3 1 melon
4 1 kiwi

I didn't test it but something like this whould work :

Insert Into Table2 (table1id,data)
(Select Id, Data1 From Table1
Union
Select Id, Data2 From Table1
Union
Select Id, Data3 From Table1
Union
Select Id, Data4 From Table1
Order by 1)

Id form Table2 should be an auto-incremental id|||Insert Into Table2 (table1id,data)
(Select Id, Data1 From Table1
Union
Select Id, Data2 From Table1
Union
Select Id, Data3 From Table1
Union
Select Id, Data4 From Table1
)

Without the "order by" it works
but the data is not inserted in the good order
so if it matters you could dump the ordered data into a temp table
and then insert the rows from that temp table into Table2

Friday, March 9, 2012

Repeat title on every page

Hello all,
I'm trying to find solution to show sub-report title on every page of that
subreport.
What I have in the subreport is the text containing title and two tables
underneath.
The first table is a summary table and will only be shown on the first page.
The second table goes over few pages.
What I need is to get the title (which is above he first table) to show on
every page of that subreport, when exported to PDF.Instead its only shown on
the first page.
I have tried many things, nothing seems to work.
What should be the solution does NOT work: I have set a property on the
title text box to 'Repeat on every page with data region' , where data region
is set to be table 2.
Can anyone help me?
Many thanks
--
NatashaOn Sep 5, 11:12 pm, Natasha <batin...@.hotmail.com> wrote:
> Hello all,
> I'm trying to find solution to show sub-report title on every page of that
> subreport.
> What I have in the subreport is the text containing title and two tables
> underneath.
> The first table is a summary table and will only be shown on the first page.
> The second table goes over few pages.
> What I need is to get the title (which is above he first table) to show on
> every page of that subreport, when exported to PDF.Instead its only shown on
> the first page.
> I have tried many things, nothing seems to work.
> What should be the solution does NOT work: I have set a property on the
> title text box to 'Repeat on every page with data region' , where data region
> is set to be table 2.
> Can anyone help me?
> Many thanks
> --
> Natasha
You should be able to add a page header to the subreport (via 'Layout'
view in BIDS -> 'Report' drop-down menu -> 'Page Header'). This should
repeat on every page when exported to PDF. Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant|||Hi Enrique,
I have tried using subreport headers before, but it doesnot show them at all
- this is another MRS limitation. Only main report headers and/or footers are
displayed.
"EMartinez" wrote:
> On Sep 5, 11:12 pm, Natasha <batin...@.hotmail.com> wrote:
> > Hello all,
> > I'm trying to find solution to show sub-report title on every page of that
> > subreport.
> > What I have in the subreport is the text containing title and two tables
> > underneath.
> > The first table is a summary table and will only be shown on the first page.
> > The second table goes over few pages.
> > What I need is to get the title (which is above he first table) to show on
> > every page of that subreport, when exported to PDF.Instead its only shown on
> > the first page.
> > I have tried many things, nothing seems to work.
> > What should be the solution does NOT work: I have set a property on the
> > title text box to 'Repeat on every page with data region' , where data region
> > is set to be table 2.
> > Can anyone help me?
> >
> > Many thanks
> >
> > --
> > Natasha
>
> You should be able to add a page header to the subreport (via 'Layout'
> view in BIDS -> 'Report' drop-down menu -> 'Page Header'). This should
> repeat on every page when exported to PDF. Hope this helps.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
>|||A little clumsy, but you could add an additional dataset in the main
report to provide the subreport heading that you want to repeat - if
you want values from it to appear in the actual header, you need to
use the following trick to show dataset values in the header (or
footer):
Go to Report|Report Properties menu.
Put code similar to the following into the Code tab (for each field
you plan on using in the header, add a global variable and a function
to return it and/or a parameter).
Sample:
Public Shared reportTitle As String
Public Shared reportName As String
Public Shared Function StoreHeaderInfo( title As String, name As
String) As String
reportTitle = title
reportName = name
' we need the assignment statement below, because method must return
something
' otherwise, we can't use it in a table cell or textbox
StoreHeaderInfo = ""
End Function
Then, in the body of the report, add a hidden textbox that has an
expression similar to this:
=Code.StoreHeaderInfo( Fields!ReportTitle.Value, Fields!
ReportName.Value )
Finally, in the header, put in a text box that has the expression:
=Code.reportName or =Code.reportTitle|||Hello Parker,
I'd like to thank you for your response.
Unfortunatelly, I couldnt get it to work using this approach.I'm not sure if
I understood where Function StoreHeaderInfo supposed to go to, into the code
of the main report, or subreport?
I have tried both, but it didnt work..
I could not use the header of the main report, as I didnt want to use the
same header accross all subreports. The main header works fine if it is to be
applied throughout all report (will be applied to all subreports)...from what
I could find is that it can only be hidden on the first and/or the last page
if required...I couldnt find a way to control it accross subreports...
If I try to make use of the header in the subreport , it doesnt work
again...this header is completelly ignored once I run the whole report.
This is what I did at the end:
I have modified table 2 and made table 1 part of the table 2 (created new
group in table one and placed table 1 into it)...
I have then added Title which I wanted to repeat into the table 2 header.
Thank you again!
"Parker" wrote:
> A little clumsy, but you could add an additional dataset in the main
> report to provide the subreport heading that you want to repeat - if
> you want values from it to appear in the actual header, you need to
> use the following trick to show dataset values in the header (or
> footer):
> Go to Report|Report Properties menu.
> Put code similar to the following into the Code tab (for each field
> you plan on using in the header, add a global variable and a function
> to return it and/or a parameter).
> Sample:
> Public Shared reportTitle As String
> Public Shared reportName As String
> Public Shared Function StoreHeaderInfo( title As String, name As
> String) As String
> reportTitle = title
> reportName = name
> ' we need the assignment statement below, because method must return
> something
> ' otherwise, we can't use it in a table cell or textbox
> StoreHeaderInfo = ""
> End Function
> Then, in the body of the report, add a hidden textbox that has an
> expression similar to this:
> =Code.StoreHeaderInfo( Fields!ReportTitle.Value, Fields!
> ReportName.Value )
> Finally, in the header, put in a text box that has the expression:
> =Code.reportName or =Code.reportTitle
>

Repeat Row Values in Matrix Report

Is it possible to repeat row values in a matrix report?
Current:
Product Color Stock
Product A Red 7
Blue 2
Green 1
To:
Product Color Stock
Product A Red 7
Product A Blue 2
Product A Green 1
Thanks.Anyone has any idea?
Thanks,
Luca
"SStoyko" wrote:
> Is it possible to repeat row values in a matrix report?
> Current:
> Product Color Stock
> Product A Red 7
> Blue 2
> Green 1
>
> To:
> Product Color Stock
> Product A Red 7
> Product A Blue 2
> Product A Green 1
>
> Thanks.
>

Repeat Report Title On EveryPage

Dear Anyone,
All reports have report titles especially in RS. These are usually big textboxes that can be found in the beginning of the report.

When a report is executed, normally, these report titles, dissapear once we opted to go to another page of the report.

Is there a way to make the report titles repeat on each page?
Thanks,
Joseph OlleroYou could put it in the Page Header section.|||Any idea on how to do this on Report Builder?|||I read in another thread that it was not possible in RB.

dlesko|||

But you can't put Data in the Page Header section.

Lets say I have an Invoice. I want the Invoice Number and Customer information to show at the top of each page of the report.

Actually I want it to be configurable. using a report parameter.

Dave

|||

Hi Dave

DGNSP posted a solution to your problem in this thread... http://forums.microsoft.com/technet/ShowPost.aspx?postid=1379855&siteid=17

but it doesn't help poor old me!

Good luck!

Graham

Repeat Report Title On EveryPage

Dear Anyone,
All reports have report titles especially in RS. These are usually big textboxes that can be found in the beginning of the report.

When a report is executed, normally, these report titles, dissapear once we opted to go to another page of the report.

Is there a way to make the report titles repeat on each page?
Thanks,
Joseph OlleroYou could put it in the Page Header section.|||Any idea on how to do this on Report Builder?|||I read in another thread that it was not possible in RB.

dlesko|||

But you can't put Data in the Page Header section.

Lets say I have an Invoice. I want the Invoice Number and Customer information to show at the top of each page of the report.

Actually I want it to be configurable. using a report parameter.

Dave

|||

Hi Dave

DGNSP posted a solution to your problem in this thread... http://forums.microsoft.com/technet/ShowPost.aspx?postid=1379855&siteid=17

but it doesn't help poor old me!

Good luck!

Graham

Repeat Report Title On EveryPage

Dear Anyone,
All reports have report titles especially in RS. These are usually big textboxes that can be found in the beginning of the report.

When a report is executed, normally, these report titles, dissapear once we opted to go to another page of the report.

Is there a way to make the report titles repeat on each page?
Thanks,
Joseph OlleroYou could put it in the Page Header section.|||Any idea on how to do this on Report Builder?|||I read in another thread that it was not possible in RB.

dlesko|||

But you can't put Data in the Page Header section.

Lets say I have an Invoice. I want the Invoice Number and Customer information to show at the top of each page of the report.

Actually I want it to be configurable. using a report parameter.

Dave

|||

Hi Dave

DGNSP posted a solution to your problem in this thread... http://forums.microsoft.com/technet/ShowPost.aspx?postid=1379855&siteid=17

but it doesn't help poor old me!

Good luck!

Graham

Repeat report item with data region on every page

Does this functionality work?
I've tried textboxes, rectangles...nothing seems to "repeat" when my data
region (table) object spans multiple pages.
Advise'
Thx,
RussellTry using a list... I had the same problem... In the properties find Dataset
Name, select your data set, set PageBrakeAtEnd = True
"Russell Hardie" wrote:
> Does this functionality work?
> I've tried textboxes, rectangles...nothing seems to "repeat" when my data
> region (table) object spans multiple pages.
> Advise'
> Thx,
> Russell
>
>

Repeat on New Page

If I have my header row set to "repeat on new page", is there a way to add
the text "continued" to the header if the data has spilled over to the next
page? I want to distinguish between the first time a group of data appears
and when it is continuing on the next page.
ie. Page 1: January 1, 2004
Page 2: January 1, 2004 continued
January 2, 2004
Page 3: January 2, 2004 continued
Thanks,
MelissaThere's no way to do this given the current architecture of the system.
Content of the report body is calculated first, then pagination is applied
after the fact. So there's no way to have the content of the report body
depend on pagination.
The closest you can get is putting the "continued" part in the page header:
1. Put a hidden column in your table with an expression something like
this:
=iif(Fields!Date.Value=Previous(Fields!Date.Value),Nothing,"X")
2. Put a texbox in the page header with an expression something like this:
=First(ReportItems!DateTextbox.Value) &
iif(First(ReportItems.MarkerTextbox.Value)="X"," continued","")
--
This post is provided 'AS IS' with no warranties, and confers no rights. All
rights reserved. Some assembly required. Batteries not included. Your
mileage may vary. Objects in mirror may be closer than they appear. No user
serviceable parts inside. Opening cover voids warranty. Keep out of reach of
children under 3.
"Melissa" <a@.a.com> wrote in message
news:eBi9yKZeEHA.3928@.TK2MSFTNGP11.phx.gbl...
> If I have my header row set to "repeat on new page", is there a way to add
> the text "continued" to the header if the data has spilled over to the
next
> page? I want to distinguish between the first time a group of data
appears
> and when it is continuing on the next page.
> ie. Page 1: January 1, 2004
> Page 2: January 1, 2004 continued
> January 2, 2004
> Page 3: January 2, 2004 continued
> Thanks,
> Melissa
>

Repeat on Every Page - For Headers

Using SSRS 2005:
I created a text box in my report header, which references a text box in my
report body: =ReportItems!textbox88.Value
In my report body, hidden textbox88 contains my data:
=Format(Parameters!StartDate.Value, "dd MMM yy HH:mm:ss")
This all works great, except for the fact that textbox88 only exists on the
first page, so the header only has a value on the first page.
Here's the question: How do I make textbox88 Repeat on Every Page, which
let's me see a value in the header on Every Page?
Thanks,
--
RandyYou could copy that box into your page header instead of your report
headrer.
"randy1200" <randy1200@.newsgroups.nospam> wrote in message
news:6BAB5E73-F556-4778-8B89-766C99075F90@.microsoft.com...
> Using SSRS 2005:
> I created a text box in my report header, which references a text box in
> my
> report body: =ReportItems!textbox88.Value
> In my report body, hidden textbox88 contains my data:
> =Format(Parameters!StartDate.Value, "dd MMM yy HH:mm:ss")
> This all works great, except for the fact that textbox88 only exists on
> the
> first page, so the header only has a value on the first page.
> Here's the question: How do I make textbox88 Repeat on Every Page, which
> let's me see a value in the header on Every Page?
> Thanks,
> --
> Randy|||I'm working with SSRS 2005 using Visual Studio 2005. I don't see what the
difference is between a page header and report header. I created the header
by viewing the report in the Layout tab, right-clicking off to the side of
the page, and selecting "Page Header."
There are many posts in the archives here that describe why you can't put
fields directly into headers. Fields must be put into something in the body
and then the header can reference that something to allow the data in appear
in the header.
I still haven't been able to spot anything that allows a field in the body
to repeat on every page, so that the data in the field appears in the header
on every page.
--
Randy
"Ben Watts" wrote:
> You could copy that box into your page header instead of your report
> headrer.
> "randy1200" <randy1200@.newsgroups.nospam> wrote in message
> news:6BAB5E73-F556-4778-8B89-766C99075F90@.microsoft.com...
> > Using SSRS 2005:
> >
> > I created a text box in my report header, which references a text box in
> > my
> > report body: =ReportItems!textbox88.Value
> >
> > In my report body, hidden textbox88 contains my data:
> > =Format(Parameters!StartDate.Value, "dd MMM yy HH:mm:ss")
> >
> > This all works great, except for the fact that textbox88 only exists on
> > the
> > first page, so the header only has a value on the first page.
> >
> > Here's the question: How do I make textbox88 Repeat on Every Page, which
> > let's me see a value in the header on Every Page?
> >
> > Thanks,
> > --
> > Randy
>
>|||I see that textbox88 takes its value from a report parameter rather than a
dataset, so there is no need for the page header text box to take its value
from textbox88. It can be taken directly from the parameter!The expression
for your page header textbox can be:
=Format(Parameters!StartDate.Value, "dd MMM yy HH:mm:ss")
HTH,
magendo_man
"randy1200" wrote:
> Using SSRS 2005:
> I created a text box in my report header, which references a text box in my
> report body: =ReportItems!textbox88.Value
> In my report body, hidden textbox88 contains my data:
> =Format(Parameters!StartDate.Value, "dd MMM yy HH:mm:ss")
> This all works great, except for the fact that textbox88 only exists on the
> first page, so the header only has a value on the first page.
> Here's the question: How do I make textbox88 Repeat on Every Page, which
> let's me see a value in the header on Every Page?
> Thanks,
> --
> Randy

Repeat on each "page"

After finally overcoming a number of hurdles with LisaNicholls help, I've got one hurdle left that I can't seem to get around. A system I'm updating currently outputs attendance registers in HTML which is built using some complex ASP.NET code. To make this more manageable, I decided to try and handle this output in Reporting Services.

Whilst the output looks fairly inocious and simple, in theory it's been a nightmare to implement. Because it's inteded for print output, my intention was to output the report straight to PDF, however I'm encountering an issue trying to get some of the data to "repeat" on each of the PDF pages.

If you look at the following image; http://mparter.pwp.blueyonder.co.uk/images/register_page.png, you'll see 4 main areas.

The problem areas are the red, green and blue ones.

The unmarked bottom section is a matrix which pages fine on PDF. The TEXBOXES in the red area can possibly be worked-around by using report parameters. The TABLES in the blue and green areas are the main problem. I can't include them in a report header workaround because there could be multiple rows per table

So, back to my question, how do I get the three marked coloured areas to repeat on each "page" of the PDF?

you can keep those coloured part in page header.insert page header and insert row above and keep the data in the header section.it will display in each page|||But you can't put controls into a report header? Unless I'm reading your post wrong?|||I presume there's no solution for this fundamental issue?

Repeat on each "page"

After finally overcoming a number of hurdles with LisaNicholls help, I've got one hurdle left that I can't seem to get around. A system I'm updating currently outputs attendance registers in HTML which is built using some complex ASP.NET code. To make this more manageable, I decided to try and handle this output in Reporting Services.

Whilst the output looks fairly inocious and simple, in theory it's been a nightmare to implement. Because it's inteded for print output, my intention was to output the report straight to PDF, however I'm encountering an issue trying to get some of the data to "repeat" on each of the PDF pages.

If you look at the following image; http://mparter.pwp.blueyonder.co.uk/images/register_page.png, you'll see 4 main areas.

The problem areas are the red, green and blue ones.

The unmarked bottom section is a matrix which pages fine on PDF. The TEXBOXES in the red area can possibly be worked-around by using report parameters. The TABLES in the blue and green areas are the main problem. I can't include them in a report header workaround because there could be multiple rows per table

So, back to my question, how do I get the three marked coloured areas to repeat on each "page" of the PDF?

you can keep those coloured part in page header.insert page header and insert row above and keep the data in the header section.it will display in each page|||But you can't put controls into a report header? Unless I'm reading your post wrong?|||I presume there's no solution for this fundamental issue?

Repeat List across page, not just down?

I want to use a List (or similar), but I want the fields from each row of the source datatable to repeat across the page before wrapping to the next line. For example:

row1-FieldA row1-FieldB row2-FieldA row2-FieldB
row3-FieldA row3-FieldB row4... etc

Is this possible?

Quick and dirthy is to write the expression

select the required report item(table in ur list)

choose expression for property(value)

==Iif(RowNumber("table") mod 2,FieldA,"")