Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 Getting sub report to repeat?

Author  Topic 

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2004-12-16 : 12:47:45
I'm creating a form with client information. When the user clicks on the report it suppose to fill the report with each clients information and then the user can send it to the client.

I have gotten it to work to some extent. I was able to get the form to fill, but only with the first data that comes up. The embedded form does not repeat somehow. When I try to insert the embedded form into the List box, it will only repeat about 20 or so time with the same information.

I'm not sure if there's a way to repeat text boxes for Reporting Services without having all the fields repeating in one page. Any suggetions?

jhermiz

3564 Posts

Posted - 2004-12-16 : 13:11:42
I'm not quite certain what you are looking for chris. Can you provide some data for us to look at.

You can right click on the report and head on over to properties. There you may select for repeating of data in groups, etc.

If you have more info please post it, even a sample would be great.

Jon
Go to Top of Page

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2004-12-16 : 14:34:36
Jon,

Since I can't attach files, I will just paste an image of the form that I'm trying to create. It is a very simple and straight forward form. I think the reason why I'm not able to repeat is because the field that I put in for the address information and account number is a text box and not a table. So when I generate the report I'm only getting the first Address on the list. A while back, someone say to use the form as a subreport within another report. I also did that and still no luck. The image here is only the subreport. I have another report that displays the header which only contains heading for the form.

I don't see where I can go and change the repeating by group in the properties. I think that only works if you insert a table or a list box. I'm not sure about text box.

Places that needs to be repeated for each form is the TO: for address and the Account Number: section.


Go to Top of Page

jhermiz

3564 Posts

Posted - 2004-12-16 : 14:38:50
i cant see it :(

Got an ftp ? Or somewhere to host the image?
Go to Top of Page

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2004-12-16 : 14:51:16
You are right about not being able to view the image. I was able to view it from my machine, but not from a friend's machine. If you don't mind can you email me your email so that I can send you the file to look at. This seems so simple, yet I can't get it to work. Only need two field to be able to repeat from page to page.

Email: "chriskhan2000@yahoo.com" Minus the qoute.
Go to Top of Page

jhermiz

3564 Posts

Posted - 2004-12-16 : 15:10:04
Chris I have gotten the image however, I think the rows returned will only display =FIRST(yourField) an aggregate.
I'm a bit confused on how you are populating the data. Is this a data set? If so why dont you create a table just for the header information and have it repeat ? With the table you will be able to set the repeatings on the groups of your choice.

BTW after looking at the report I think you should of choosen a tabular report form and merged the cells in the detail section where you needed more space. THis way you would be able to deal with repeats as well.

Sorry I didnt have a better answer :(
Go to Top of Page

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2004-12-16 : 15:23:10
Jon,

Is there a setting to set it so that the detail field for the table doesn't repeat with each data, but only for each page? I do understand what you are saying about using a table and put the address field there to have it repeat, but the problem I'm getting is 1 long list of addresses. Not one address per page.
Go to Top of Page

jhermiz

3564 Posts

Posted - 2004-12-16 : 15:34:19
Chris,

You have 2 options,

1) CHange the group by.
2) Insert a row under your first group by and insert your fields there. That way you can repeat. It's very hard to explain in the forums, I wish I could send you some sort of example. Your problem is very doable, I just wish I had access to your network :-). Got VCN ???? =)

As long as you can insert a row for a heading you will be able to group and repeat on that group.

Jon
Go to Top of Page

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2004-12-16 : 15:44:40
Do you think it will be possible for you to quickly create like Name and Address from adventurework and email me that report? Like display each address on each page without having it give you a long list of names and addresses. Because that's what my problem is. HEHEHE. I keep getting long list instead of just having one Contact in one page.
Go to Top of Page

jhermiz

3564 Posts

Posted - 2004-12-16 : 15:45:50
yes i have nothing to do at work
:)
ill then send u the rdl

jon
Go to Top of Page

jhermiz

3564 Posts

Posted - 2004-12-16 : 15:47:15
Hey i dont have adventure works could we use northwind or pubs ?

Go to Top of Page

jhermiz

3564 Posts

Posted - 2004-12-16 : 15:49:19
Theres a Customers table in northwind, the address information is directly in this table. I dont see why you cannot just group BY the CustomerID or Company Name, and force a new page "AFTER" the group ?????

Go to Top of Page

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2004-12-16 : 15:52:26
Yeah you can use northwind or pub. I'm not too familair with the Group By.
Go to Top of Page

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2004-12-16 : 16:07:58
I'm able to get the Address info to repeat from within each page now. Only problem now is to get the entire form to repeat instead of just the addresses. For example textboxes that I put in there and information that's not tied to dataset is not repeating.

I will try to use this as a subreport and have it in a list box and see if I can get it to repeat.
Go to Top of Page

jhermiz

3564 Posts

Posted - 2004-12-16 : 16:12:25
Notice rpt1 and rpt2 same customer, repeats on the header. Notice this repeat changes on a new page with another customer, rpt3.
rpt6 shows the query (I always use stored procedures however I just did it real quick so I used the query designer). rpt4 / rpt5 shows the groups etc...

http://www.jakrauseinc.com/jhermiz/rpt1.jpg
http://www.jakrauseinc.com/jhermiz/rpt2.jpg
http://www.jakrauseinc.com/jhermiz/rpt3.jpg
http://www.jakrauseinc.com/jhermiz/rpt4.jpg
http://www.jakrauseinc.com/jhermiz/rpt5.jpg
http://www.jakrauseinc.com/jhermiz/rpt6.jpg

The rdl:


<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2003/10/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<RightMargin>1in</RightMargin>
<Body>
<ReportItems>
<Table Name="table1">
<Style />
<Header>
<TableRows>
<TableRow>
<Height>0.29167in</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="textbox2">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>20</ZIndex>
<rd:DefaultName>textbox2</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>Customer ID</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox1">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<TextAlign>Center</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>19</ZIndex>
<rd:DefaultName>textbox1</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>Order ID</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox3">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<TextAlign>Center</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>18</ZIndex>
<rd:DefaultName>textbox3</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>Product Name</Value>
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
</TableRows>
</Header>
<Details>
<TableRows>
<TableRow>
<Height>0.29167in</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="textbox4">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>2</ZIndex>
<rd:DefaultName>textbox4</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="ProductID">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderColor>
<Default>LightGrey</Default>
</BorderColor>
<BorderStyle>
<Bottom>Solid</Bottom>
</BorderStyle>
<TextAlign>Center</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>1</ZIndex>
<rd:DefaultName>ProductID</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=Fields!ProductID.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="ProductName">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderColor>
<Default>LightGrey</Default>
</BorderColor>
<BorderStyle>
<Bottom>Solid</Bottom>
</BorderStyle>
<TextAlign>Center</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<rd:DefaultName>ProductName</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=Fields!ProductName.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
</TableRows>
</Details>
<DataSetName>DataSet1</DataSetName>
<Top>0.125in</Top>
<TableGroups>
<TableGroup>
<Header>
<TableRows>
<TableRow>
<Height>0.25in</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="CustomerID">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<FontStyle>Italic</FontStyle>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>17</ZIndex>
<rd:DefaultName>CustomerID</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=Fields!CustomerID.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox10">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>16</ZIndex>
<rd:DefaultName>textbox10</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox11">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>15</ZIndex>
<rd:DefaultName>textbox11</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
</TableRows>
<RepeatOnNewPage>true</RepeatOnNewPage>
</Header>
<Grouping Name="customerID">
<GroupExpressions>
<GroupExpression>=Fields!CustomerID.Value</GroupExpression>
</GroupExpressions>
<PageBreakAtEnd>true</PageBreakAtEnd>
</Grouping>
<Footer>
<TableRows>
<TableRow>
<Height>0.25in</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="textbox12">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>8</ZIndex>
<rd:DefaultName>textbox12</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox13">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>7</ZIndex>
<rd:DefaultName>textbox13</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox14">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>6</ZIndex>
<rd:DefaultName>textbox14</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
</TableRows>
</Footer>
</TableGroup>
<TableGroup>
<Header>
<TableRows>
<TableRow>
<Height>0.25in</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="textbox15">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>14</ZIndex>
<rd:DefaultName>textbox15</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="OrderID">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<TextAlign>Center</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>13</ZIndex>
<rd:DefaultName>OrderID</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=Fields!OrderID.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox17">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>12</ZIndex>
<rd:DefaultName>textbox17</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
</TableRows>
</Header>
<Grouping Name="table1_Group2">
<GroupExpressions>
<GroupExpression>=Fields!OrderID.Value</GroupExpression>
</GroupExpressions>
</Grouping>
<Footer>
<TableRows>
<TableRow>
<Height>0.25in</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="textbox18">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>5</ZIndex>
<rd:DefaultName>textbox18</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox19">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>4</ZIndex>
<rd:DefaultName>textbox19</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox20">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>3</ZIndex>
<rd:DefaultName>textbox20</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
</TableRows>
</Footer>
</TableGroup>
</TableGroups>
<Footer>
<TableRows>
<TableRow>
<Height>0.29167in</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="textbox7">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>11</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>10</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>9</ZIndex>
<rd:DefaultName>textbox9</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
</TableRows>
</Footer>
<TableColumns>
<TableColumn>
<Width>1.45833in</Width>
</TableColumn>
<TableColumn>
<Width>1.45833in</Width>
</TableColumn>
<TableColumn>
<Width>1.45833in</Width>
</TableColumn>
</TableColumns>
</Table>
</ReportItems>
<Style />
<Height>2in</Height>
</Body>
<TopMargin>1in</TopMargin>
<DataSources>
<DataSource Name="Northwind">
<rd:DataSourceID>0a92adc7-e617-4078-82de-f079625e21c9</rd:DataSourceID>
<DataSourceReference>Northwind</DataSourceReference>
</DataSource>
</DataSources>
<Width>4.375in</Width>
<DataSets>
<DataSet Name="DataSet1">
<Fields>
<Field Name="CustomerID">
<DataField>CustomerID</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="CompanyName">
<DataField>CompanyName</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="OrderID">
<DataField>OrderID</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
<Field Name="ProductID">
<DataField>ProductID</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
<Field Name="ProductName">
<DataField>ProductName</DataField>
<rd:TypeName>System.String</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>
</Fields>
<Query>
<DataSourceName>Northwind</DataSourceName>
<CommandText>SELECT Customers.CustomerID, Customers.CompanyName, Orders.OrderID, [Order Details].ProductID, Products.ProductName, [Order Details].UnitPrice,
[Order Details].Quantity
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>948b1b06-d1db-44a6-b719-02d803cd94b5</rd:ReportID>
<BottomMargin>1in</BottomMargin>
<Language>en-US</Language>
</Report>
Go to Top of Page

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2004-12-16 : 17:14:27
Jon,

Thanks for the example. I think with what you are doing, I'm able to do, but what I'm trying to do is in a way a little different. As you can see in the example that I sent you. I have static text and information on the report form. The only thing that I want to be from the dataset is the address and the account number, everything else in that form that the client can fill out is all static. However with your help about grouping, I was able to get it to display by each page now, but problem is getting those static text to display with it.

I manage to get it to display in each page, but the page break doesn't seem to be work or something. Sometimes, it will display 1 contact in a page or 2 contact in a page and makes the page extremely long. So it might have to do with formatting of the form. I will play around with it and see what turns out.

Again thanks for the help.
Go to Top of Page

jhermiz

3564 Posts

Posted - 2004-12-16 : 17:16:45
No problem if you use the grouping make sure you check of the "Repeat group on each page" and you also check on "Insert break point" / I think its called "New page" on each group (place this in the FOOTER of your group. Check out rpt4.jpg that I posted.

So your footer will control the client / customer and will insert a page break after the complete sections of that client / customer has been completed.

jon
Go to Top of Page

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2004-12-18 : 01:49:46
Jon,

With your help, I was able to get the form to output right. I ended up deleting the header though and just put the header in with the body section. That seems to output everything as intended.
Go to Top of Page
   

- Advertisement -