SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Problem with a report.


Problem with a report.

Author
Message
dbman
dbman
Say Hey Kid
Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)

Group: General Forum Members
Points: 689 Visits: 1537
Hello,


I have a Dataset with: Company, Depot, Account, Year Period, Ethical, Glaxo, Drug, Surgical, General, PI, Misc, Phone, PostCode, CustomerName, DepotName, SalesMan, Salesman Number, Drug, General, Status.


I have used Visual Studio to create a report. In design view i have created two tables.The first table contains:


Account, CustomerName, Phone, DepotName, SalesMan, Salesman Number, Depot, PostCode.


I have created a second table above using the fields: Account, CustomerName, DepotName, SalesMan, Salesman Number, Depot, PostCode.


So in essense when the report is run the Account details will be shown first and then the Sales Details will be shown below.


What is happening when i run the report is that the Account Details in the first table are appearing multiple times as opposed to only once.

I assume this is due to the number of periods and year in the Sales fields.


Can anyone suggest a solution to enable me to view the Account details per Sales in a report.
anthony.green
anthony.green
One Orange Chip
One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)

Group: General Forum Members
Points: 25804 Visits: 6519
Please provide the current report along with what the report should look like,

But it sounds me that you need to add some grouping, but cannot be sure without seeing what you have now and what you want it to actually look like.



Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
When a question, really isn't a question - Jeff Smith
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger


dbman
dbman
Say Hey Kid
Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)

Group: General Forum Members
Points: 689 Visits: 1537
The report is supposed to look like:


Account1, Account, Custome, Phone, PostCode, Group, Status, Depot, SalesMan, Salesman Number



Account, Year, Period, Ethical, Glaxo, Drug, Generic, Surgical, General, PI, Misc, Specials.



The second line works correctly. I have Grouped on Account and created a page break so that you can see the Account sales on One Page.
anthony.green
anthony.green
One Orange Chip
One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)

Group: General Forum Members
Points: 25804 Visits: 6519
Need data or pictures of what it looks like now and what it should look like after.



Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
When a question, really isn't a question - Jeff Smith
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger


dbman
dbman
Say Hey Kid
Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)

Group: General Forum Members
Points: 689 Visits: 1537
Hi
The report is supposed to look as the image attached.

Regards
Attachments
report.png (18 views, 25.00 KB)
anthony.green
anthony.green
One Orange Chip
One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)

Group: General Forum Members
Points: 25804 Visits: 6519
Yes I get that, but what does it look like now when you run the report, and what is wrong with it so I know what I need to do to make it your required output.



Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
When a question, really isn't a question - Jeff Smith
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger


dbman
dbman
Say Hey Kid
Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)

Group: General Forum Members
Points: 689 Visits: 1537
Hello,
As i mentioned i would like the Account Details to show in the first table and in the second table the sales data.

So in image (first.png) the Account details for one Account should be displayed. When you run the report, If you click the next page button you see the same customer details 10 times. (The same account details per page). This happens with each account.


When you get to a certain page e.g. 7000, you then begin to see the start of the Account Sales (two.png).


I need the corresponding Account to show with the sales details on the same page.

Thanks
Attachments
first.png (15 views, 23.00 KB)
two.png (17 views, 33.00 KB)
dbman
dbman
Say Hey Kid
Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)Say Hey Kid (689 reputation)

Group: General Forum Members
Points: 689 Visits: 1537
Anyone any ideas on a solution to this?

Thanks
peterzeke
peterzeke
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2058 Visits: 1766
As Anthony.Green mentioned, it sounds like you need to be grouping your data in the first table. Without seeing a sample dataset it's difficult to provide info on what to group by -- I'd be guessing if I simply said group by Account...

--Pete



Tee Time
Tee Time
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1111 Visits: 465
Send a screenshot of the grouping section for each table so we have a better understanding of what that looks like.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search